跳转到主要内容
通过异步任务 API 以 JSON 读取公开的 Instagram 数据。发送 taskType SOCIAL 并设置 platform instagram,用 action 选择要读取的内容。每次完成的请求消耗 0.5 积分。

请求

提交任务后,轮询 GET /v1/async/task/{id} 或通过 webhook 接收。参见异步任务。

操作

username 接受用户名或个人主页 URL。postUrl 接受帖子、Reel 或 IGTV 的 URL,例如 https://www.instagram.com/p/Df147tCiAyB/。

参数

  • query:search 必填。关键词、话题标签词或品牌名。
  • limit:可选。search 范围 1-30,默认 10。posts 范围 1-12,默认 12。comments 范围 1-500,默认 50。

响应示例

结果字段

  • 每个响应都会原样返回 platform 和 action。列表带有 returnedCount。
  • profile 返回 id、username、displayName、biography、bioLinks、avatarUrl、profileUrl、isVerified、isPrivate、followerCount、followingCount、postCount、hasReels、highlights、threadsUsername、pronouns 和 recentPosts。账号有快拍在线时会出现 latestStoryAt,isMemorialized 表示纪念账号。
  • posts 返回 posts,即账号最新的 12 条帖子,带有从每条帖子页面读取的 likeCount、commentCount 和 publishedAt。
  • post 返回 post 和帖子的前几条 comments。帖子包含 id、code、url、mediaType(image、video 或 carousel)、caption、imageUrl、images、videoUrl、width、height、likeCount、commentCount、publishedAt、username、authorFullName、authorIsVerified、authorProfileImageUrl、coauthors、taggedUsers、topics、audio(歌曲或作者的原创音频)、hasAudio、captionIsEdited、aiLabel 和 commentsDisabled。
  • comments 返回 comments,每条评论包含 id、text、username、likeCount、replyCount 和 publishedAt。GIF 评论带有 gifUrl。availableCount 是帖子的评论数,partial: true 表示列表短于该数量。
  • search 返回 posts,包含 position、作者的 username、authorId、authorIsVerified 和 authorProfileImageUrl,Reels 还有 playCount。Instagram 为该关键词提供搜索页时,source 为 instagram,并加上该页的 title、relatedKeywords、Instagram 对该关键词的 summary,以及脚注编号所指的 sources。其他关键词的 source 为 web,posts 包含最近 30 天的公开帖子和 Reels。
  • Instagram 向未登录的访客显示个人主页最新的 12 条帖子和一条帖子的十几条评论,posts、post 和 comments 返回的就是这些内容。搜索结果的计数和发布时间请用 post 读取。
  • 不存在的账号或帖子、私密帖子,或 Instagram 只向已登录访客显示的页面,会使任务以 PAGE_UNAVAILABLE 结束。只对完成的请求计费。

相关