如何从 Instagram API 中提取 cookie [英] How to extract cookie from Instagram API

查看:32
本文介绍了如何从 Instagram API 中提取 cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是保存用户的故事,所以我正在研究 Instagram API.

现在我知道抓取用户的故事是非官方的,所以我们使用 https://i.instagram.com/api/v1/feed/reels_tray/

该请求需要一个包含 ds_user_idsessionId 的 cookie.我试图从 Postman 那里获取它,但我所做的只是获取官方 API 的访问令牌.

我应该执行什么请求来存储它ds_user_idsessionId?

更新设法通过浏览器获取它,但不能通过邮递员获取.任何帮助将不胜感激.

解决方案

  1. 下载最新的本地邮递员应用,或者您可以使用Chrome 应用

  2. 在 chrome 中安装 邮递员拦截器

  3. 您可以启动拦截器并捕获 cookie 并将它们存储在邮递员内部的环境变量中.

  4. 在您的请求中使用这些变量.

你可以参考这个问题来了解如何使用拦截器:如何使用 Postman Interceptor

另请参阅有关在 Postman 中使用变量的文档::>

还有很棒的 - 社区支持

测试愉快!

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.

解决方案

  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!

这篇关于如何从 Instagram API 中提取 cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆