Alerts for Game Sales

Hey fellow dev’s,

I’m creating this topic because I’ve really not seen this asked before, either because it’s not been considered, or because I’m the only one unaware of it… So basically, I’m wondering if there’s IRC notifications for when a user purchases a game using the button below a stream. When I bought the E3 Digital Ticket, that alerted in the official Twitch channel’s chat, but I’m unsure if every game, such as Ghost Recon Wildlands, triggers a message in chat for the viewer to enter a message with (like resubs).
I can see it’s available for PubSub under “Commerce Events”, but does it trigger in IRC? If it does, is there a sample message to show the parameters?
If there isn’t, it could be a useful thing to implement!


This is an IRC capture from an old event back when the feature first launched:

@badges=subscriber/0,bits/100;color=#FF1F1F;display-name=Nervous_Habit;emotes=151888:0-7;id=b69b5ff7-873f-4d08-9a73-d6dea0db09f8;login=nervous_habit;mod=0;msg-id=purchase;msg-param-asin=B06XK192R7;msg-param-channelID=35833485;msg-param-imageURL=;msg-param-title=Warframe\sProminence\sBundle;msg-param-userID=69777126;room-id=35833485;subscriber=1;system-msg=Purchased\sWarframe\sProminence\sBundle\sin\schannel.;tmi-sent-ts=1491342820515;turbo=0;user-id=69777126;user-type= USERNOTICE #brozime :zimeGrin

You want the PubSub commerce topic outlined here:

But yes, seems that there is a UserNotice attached to it (still) as well

Collected and JSON formated (sorry I don’t have the RAW IRC line)

{ badges: [ [ 'subscriber', '0' ], [ 'premium', '1' ] ],
  color: '#A60808',
  display_name: '<removed>',
  emotes: true,
  id: '<removed>',
  login: '<removed>',
  mod: '0',
  msg_id: 'purchase',
  msg_param_asin: 'B06XP9TRLC',
  msg_param_bits: '10',
  msg_param_channelID: '<removed>',
  msg_param_crateCount: '1',
  msg_param_emoticons: '158655',
  msg_param_imageURL: '',
  msg_param_title: 'Darkest\\sDungeon',
  msg_param_userID: '<removed>',
  room_id: '<removed>',
  subscriber: '1',
  system_msg: 'Purchased\\sDarkest\\sDungeon\\sin\\schannel.',
  tmi_sent_ts: '1498394697011',
  turbo: '0',
  user_id: '<removed>',
  user_type: true }

It would seem that the UserNotice provides some additional information over the pubsub topic, such as the Crate contents if a crate is opened, assuming the crate(s) was opened before the user runs the share dialog, so you also gotcha watch for a message here.

@george Thank you for the IRC capture message, this seems very handy. I assume if we wanted to get the price of this game, we’d simply search an API for the parameter msg-param-asin=B06XK192R7; ? I’ll look into writing something that works around this, it seems nice and simple.

@BarryCarlyon Thank you for posting the PubSub sample, and for letting me know about the UserNotice providing extra information. I never actually knew it could share the contents of the crate, that’s a pretty neat feature!

I’ll get to work writing something that listens for these events, and does something with them. Thanks again for the help guys! :slight_smile:

The price of the item doesn’t take into account that tax exists. I did find this end point: for example that contains price data.

But since thats a standard Amazon ASIN B06XK192R7 I’m sure theres a Amazon MWS endpoint of use somewhere…

Generally the game being purchased SHOULD be the current game that is being played, and msg_param_title in the user notice example will match for the /details lookup

Thank you Barry for responding, and this quickly too! I’ll check out the Amazon API’s, I’d guarantee there’s an endpoint somewhere containing that data. Also, the API link you posted returns an Error 404, not sure if it’s been changed or something. I’ll let you know how it goes!

Use APIv5 you made a call over v3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.