综合搜索(支持分页)/General search (with pagination)
Instagramapi
About
综合搜索(支持分页)/General search (with pagination)
Documentation
综合搜索(支持分页)/General search (with pagination)
[中文]
用途:
- Instagram综合搜索接口(支持分页)
- 支持通过 next_max_id 分页获取大量搜索结果
- 返回用户、话题标签、地点等综合结果
参数:
- query: 搜索关键词
- next_max_id: 分页ID,首次请求不传,从上一次响应的
data.next_max_id获取 - rank_token: 排序token,首次请求不传,从上一次响应的
data.rank_token获取 - enable_metadata: 是否启用元数据
返回:
data.num_results: 结果数量data.users: 用户搜索结果列表data.places: 地点搜索结果列表data.hashtags: 话题标签搜索结果列表data.next_max_id: 下一页分页ID(传给下次请求的next_max_id参数)data.rank_token: 排序token(传给下次请求的rank_token参数)data.has_more: 是否有更多结果
注意事项:
- ⚠️ 已知问题: 综合搜索结果可能存在重复数据,这是 Instagram API 的已知行为
- 搜索话题标签时,query 需要带上
#前缀,例如搜索 fashion 话题应传入#fashion #符号在 URL 中需要进行 URL 编码为%23,例如:?query=%23fashion- 如果使用 HTTP 客户端库(如 requests/httpx),直接传入
#fashion即可,库会自动处理编码
分页使用方法:
- 首次请求:只传
query参数 - 获取响应中的
next_max_id和rank_token - 下次请求:传入
query、next_max_id和rank_token - 重复步骤 2-3 直到
has_more为 false
价格:
- 0.008 USD/请求
[English]
Purpose:
- Instagram general search API (with pagination)
- Support pagination via next_max_id to fetch more search results
- Returns blended results of users, hashtags, places, etc.
Parameters:
- query: Search keyword
- next_max_id: Pagination ID, omit for first request, get from previous response
data.next_max_id - rank_token: Rank token, omit for first request, get from previous response
data.rank_token - enable_metadata: Enable metadata
Return:
data.num_results: Number of resultsdata.users: User search resultsdata.places: Place search resultsdata.hashtags: Hashtag search resultsdata.next_max_id: Next page pagination ID (use as next_max_id in next request)data.rank_token: Rank token (use as rank_token in next request)data.has_more: Whether has more results
Notes:
- ⚠️ Known Issue: General search results may contain duplicate data, this is a known behavior of Instagram API
- When searching for hashtags,
querymust include the#prefix, e.g., use#fashionto search for the fashion hashtag - The
#character must be URL-encoded as%23in the URL, e.g.,?query=%23fashion - If using an HTTP client library (e.g., requests/httpx), just pass
#fashiondirectly and the library will handle encoding automatically
Pagination usage:
- First request: Only pass
queryparameter - Get
next_max_idandrank_tokenfrom response - Next request: Pass
query,next_max_idandrank_token - Repeat steps 2-3 until
has_moreis false
Price:
- 0.008 USD/request
示例/Example
query = "justin"
Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.
Try 综合搜索(支持分页)/General search (with pagination)
Test this model in the Sandbase Playground with your own prompts.
Open in PlaygroundRelated Models
批量翻译评论/Bulk translate commentsInstagramapi获取评论的子评论/回复/Get comment repliesInstagramapi获取探索页推荐帖子/Get explore feedInstagramapi从URL提取短码/Extract shortcode from URLInstagramapi获取话题标签帖子列表/Get hashtag postsInstagramapi获取Highlight精选详情/Get highlight storiesInstagramapi获取地点详情/Get location infoInstagramapi获取地点附近内容/Get nearby location contentInstagramapi