Search code examples
apiinstagraminstagram-api

How to extract cookie from Instagram API


I have this task to save user's strories, so I'm diiging into Instagram API.

For now I know that it's unofficial to grab user's story, so we are using https://i.instagram.com/api/v1/feed/reels_tray/

That request needs a cookie with ds_user_id and sessionId inside. I'm trying to grab it from Postman, but all I've managed to do is to get the access token to official API.

What request should I perform to store that ds_user_id and sessionId?

UPD Managed to get it through browser, but not through postman. Any help would be appreciated.


Solution

    1. Download the latest native Postman app or you can use the Chrome App

    2. Install Postman Interceptor in chrome

    3. You can start the interceptor and capture the cookies and store them in environment variables inside postman.

    4. Use those variables in your requests.

    You can refer this issue on how to use the interceptor: How to use Postman Interceptor

    Also refer are the docs on using variables in Postman:

    And the great - Community Support

    Happy Testing!