0

I am trying to use requests to make an api call that this page is making https://www.betonline.ag/sportsbook/martial-arts/mma.

requests.post(
    url='https://api.betonline.ag/offering/api/offering/sports/offering-by-league',
    headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15'}
    json={"Sport":"martial-arts","League":"mma","ScheduleText":None,"Period":0}
)

Request through Chrome

I have also tried including all the headers I see in the image but am still unable to get a 200 and get the response.

What am I missing?

radio23
  • 87
  • 1
  • 8
  • The response status shows 200. So I'm not sure what the issue is. – ewokx Aug 04 '22 at 04:21
  • That is the response status in chrome network tab but when I try in python it does not work @ewong – radio23 Aug 04 '22 at 04:22
  • So, it is 200 in a normal browser, but 403 in your program? Maybe some kind of protection from bots. – qrsngky Aug 04 '22 at 04:23
  • Correct 200 in normal browser, 403 in my python code @qrsngky – radio23 Aug 04 '22 at 04:24
  • Similar problem: https://stackoverflow.com/questions/69816008/browser-gives-200-return-while-requests-get-gives-403 – qrsngky Aug 04 '22 at 04:24
  • Authentication cookie? – zigarn Aug 04 '22 at 04:26
  • I don't see one getting passed in chrome @zigarn – radio23 Aug 04 '22 at 04:28
  • May also be related: https://stackoverflow.com/questions/32572674/python-3-web-scraping-error-403 https://stackoverflow.com/questions/16627227/problem-http-error-403-in-python-3-web-scraping – qrsngky Aug 04 '22 at 04:29
  • 403 related to the Authorization problem, you don’t have permission to access this resource is an HTTP status code that occurs when the web server understands the request but can’t provide additional access. – Mehmaam Aug 04 '22 at 04:41

0 Answers0