Jump to content

API 502 response


sonderangebot10

Featured Comment

Posted

Hi, I've been experimenting with the stake.com graphql API recently. While everything works as expected with very few request (approx. 1/second) I've been getting a 502 HTTP request quite frequently. Is anyone else facing the same issue?

Posted

Hey,

 

All stake sites and mirrors are now protected with cloudflare.

To use the API you have to bypass this, they are several ways to do this, depending language you use.

For example, in python you can bypass it with selenium by collecting the cf_clearance cookies values and send it with each request ( you can collect it with the undetected chrome driver, i test it and it work quite fine).

 

The other solution, and probably the best, is to use requests with python, you can use cfscape to create your requests and simply bypass cloudflare, that's my solution actually.

But 502 error mean bad gateway, and this is maybe not an API problem ( normally API return 403 if you dont bypass CF).

Good Luck.

  • 2 weeks later...
Posted

@Blackshires I am using python and the cfscraper package, but I am still getting 403'd. Am I missing something? 

Quote

 

cfSession = cfscrape.CloudflareScraper()

cfSession.headers["x-access-token"] = X_ACCESS_TOKEN

response = cfSession.post("https://stake.com/_api/graphql", json=payload)

print(response)

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Privacy Policy Terms of Use