Getting JSON response from Instagram stories API Python #21431
-
I got this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @CodeWithAwais and welcome! In general, it’s often not the most reliable to copy DevTools requests. Rather, try making use of the official Instagram API. If you’re determined to follow this path, make sure everything in your Python session is the same as in your browser session. Think about not only URLs and their parameters, but also cookies and, what seems to break you up in this case, headers like the If you’re using the Python |
Beta Was this translation helpful? Give feedback.
Hey @CodeWithAwais and welcome!
In general, it’s often not the most reliable to copy DevTools requests. Rather, try making use of the official Instagram API.
If you’re determined to follow this path, make sure everything in your Python session is the same as in your browser session. Think about not only URLs and their parameters, but also cookies and, what seems to break you up in this case, headers like the
User-Agent
header.If you’re using the Python
requests
module, you can use arequest.Session()
and pass in those headers and cookies from the start.