Get Bit Price using Twitch API

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"
    }
  }
]