Get Bit Price using Twitch API

Is there a way I can get the current Twitch Bit Price via the api? I want to build a currency converter as a little project.

If not. Does the Bit price ever change?

No

Nope

Basically it’s 1:1 1 bit is 1 cent for the streamer, viewers are charged a fee on top when they purchase the bits from Twitch.

Twitch probably isn’t in the market of letting people work this out offsite really…

Actually this seems to be possible, as is triggered when clicking the “Get Bits” button above any twitch stream.

Albeit the endpoint being undocumented and therefore 100% unreliable.

var clientID = "";

var myObj = [
  {
    operationName: "GetBitsButton_Bits",
    query: "query GetBitsButton_Bits() {\n  bitsOffers {\n    ...bitsOffersFragment\n    __typename\n  }\n}\n\nfragment bitsOffersFragment on BitsOffer {\n  id\n  type\n  bits\n  ... on BitsBundleOffer {\n    price\n    discount\n  }\n  __typename\n}"
  }
];
$.ajax({
  url: "https://gql.twitch.tv/gql",
  method: "POST",
  headers: {
    "Client-ID": clientID
  },
  data: JSON.stringify( myObj )
});

Returns

[
  {
    "data": {
      "bitsOffers": [
        {
          "id": "B017L2UX4C",
          "type": "BUNDLE",
          "bits": 100,
          "price": "$1.40",
          "discount": 0,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B018WMZKR0",
          "type": "BUNDLE",
          "bits": 500,
          "price": "$7.00",
          "discount": 0,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B073RTRHTZ",
          "type": "BUNDLE",
          "bits": 1000,
          "price": "$10.00",
          "discount": 0.27,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B018WMZN5E",
          "type": "BUNDLE",
          "bits": 1500,
          "price": "$19.95",
          "discount": 0.05,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B018WMZSPY",
          "type": "BUNDLE",
          "bits": 5000,
          "price": "$64.40",
          "discount": 0.08,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B018WMZYPI",
          "type": "BUNDLE",
          "bits": 10000,
          "price": "$126.00",
          "discount": 0.1,
          "__typename": "BitsBundleOffer"
        },
        {
          "id": "B01G4BISOS",
          "type": "BUNDLE",
          "bits": 25000,
          "price": "$308.00",
          "discount": 0.12,
          "__typename": "BitsBundleOffer"
        }
      ]
    },
    "extensions": {
      "durationMilliseconds": 884,
      "operationName": "GetBitsButton_Bits"
    }
  }
]

Very much so.

And doesn’t take in account VAT/Sales Tax additions…

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