登录
使用 JS token

Instagram scrapers 配合您的 JavaScript token 效果最佳。

API 用法

Crawling API 请求中添加 &scraper=instagram-hashtag。在 url 参数中对目标 URL 进行 URL 编码。

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.instagram.com/explore/tags/love/' \
  --data-urlencode 'scraper=instagram-hashtag' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.instagram.com/explore/tags/love/',
    {'scraper': 'instagram-hashtag'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://www.instagram.com/explore/tags/love/',
  { scraper: 'instagram-hashtag' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.instagram.com/explore/tags/love/', scraper: 'instagram-hashtag')
data = JSON.parse(res.body)

示例输入 URL

url 参数中传入的 URL(为便于阅读已 URL 解码):

https://www.instagram.com/explore/tags/love/

响应结构

JSON 响应正文。当源页面未提供该值时,字段类型可能为 null

hashtag
string
话题标签(不含 #)。
post_count
integer | null
使用该话题标签的帖子总数(若显示)。
top_posts
array
该标签下排名靠前的帖子。
recent_posts
array
该标签下的最新帖子。
posts[].id
string
帖子短代码。
posts[].thumbnail_url
string
缩略图 URL。
posts[].like_count
integer
点赞数。
posts[].comment_count
integer
评论数。
posts[].url
string
永久链接。

示例响应

{
  "hashtag": "love",
  "post_count": 2100000000,
  "top_posts": [
    {
      "id": "C7xY...",
      "thumbnail_url": "https://scontent.cdninstagram.com/...jpg",
      "like_count": 847000,
      "comment_count": 2102,
      "url": "https://www.instagram.com/p/C7xY..."
    }
  ]
}