Jump to content

API TO PULL CRASH HISTORY TO BE DISPLAYED IN A WIN WINDOW


Featured Comment

Posted

Could someone help me with an API to pull the crash history and always see new results in real time? It can be in other languages but preferably in Python or Js

Posted (edited)

js example from browser console:

const query = `
  query CrashGameListHistory($limit: Int, $offset: Int) {
    crashGameList(limit: $limit, offset: $offset) {
      id
      startTime
      crashpoint
      hash {
        id
        hash
        __typename
      }
      __typename
    }
  }
`;

const variables = {
  limit: 10,
  offset: 0
};

fetch('https://stake.com/_api/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    query: query,
    variables: variables,
    operationName: 'CrashGameListHistory'
  })
})
.then(response => response.json())
.then(data => {
  console.log('Success:', data);
  
  // Parse the crashpoint values
  const crashpoints = data.data.crashGameList.map(game => game.crashpoint);
  console.log('Crashpoints:', crashpoints);
})
.catch(error => console.error('Error:', error));
 

 

if you're making outside calls, you need to include these headers.

'cookie': '__cf_bm=<cookie>; cf_clearance=<cookie>',

'x-access-token': '<api key>',

'origin': 'https://stake.com/',

'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',

'Content-Type': 'application/json',

'Accept': 'application/json',

 

x-access-token is your api key and it's only needed for certain calls. 

__cf_bm and cf_clearance are needed to bypass Cloudflare, but they rotate every ~5 days

Edited by daveyj

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Privacy Policy Terms of Use