Get channel subscriptions

Hello everyone,

I have a question with channel’s subscriptions API:

according to [twitch api] (https://github.com/justintv/Twitch-API/blob/master/v3_resources/subscriptions.md), I can get response

Example Response

{
  "_total": 3,
  "_links": {
    "next": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions?limit=25&offset=25",
    "self": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions?limit=25&offset=0"
  },
  "subscriptions": [
    {
      "_id": "88d4621871b7274c34d5c3eb5dad6780c8533318",
      "user": {
        "_id": 38248673,
        "logo": null,
        "type": "user",
        "bio": "I'm testuser",
        "created_at": "2012-12-06T00:32:36Z",
        "name": "testuser",
        "updated_at": "2013-02-06T21:27:46Z",
        "display_name": "testuser",
        "_links": {
          "self": "https://api.twitch.tv/kraken/users/testuser"
        }
      },
      "created_at": "2013-02-06T21:33:33Z",
      "_links": {
        "self": "https://api.twitch.tv/kraken/channels/test_channel/subscriptions/testuser"
      }
    },
    ...
  ]
}

but when user have 3 months of a subscription, what response data will be returned?

or one subscription record is equal to one month?

If you are looking for information regarding the badge they will have in chat, the best way is via the tags sent alongside the message

ex. @badges=moderator/1,subscriber/6,premium/1 – subscriber/6 indicates I have the 6 month sub badge, and when I hit 12 months it’ll update to /12 but not before then.

Beyond that, you can use the ‘created_at’ date (on the subscription level, not the user level) but I am 99% sure that data resets if the user doesn’t renew their subscription immediately but still re-subscribes within 30 days. They keep their streak but the returned date in the api is incorrect.

So, there isn’t really a 100% perfect way to identify when a user had started their subscription (as they can let it lapse but then sub again within 30 days to keep streak).

If a user doesnt let their subscription lapse, then their object will be returned the same month over month.

Thank you very much.

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