Skip to content

Getting JSON response from Instagram stories API Python #21431

Answered by mpboom
CodeWithAwais asked this question in General
Discussion options

You must be logged in to vote

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 a request.Session() and pass in those headers and cookies from the start.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gido3823
Comment options

@mpboom
Comment options

Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants