Instagram 城市下的地点 API
按 city_id(c 加数字)列出 Instagram 地点目录里这个城市下的地点:location_id、name、slug、url,每千次 $0.56。
location_id接location_info- 城市页链接也能当输入
- 失败和空结果不收费
接口健康状态
- 24h 健康值
- 正常
- 健康 / 正常
- 可用
- 少量可用
- 基本不可用
24 小时趋势
30 天趋势
1请求
POST /api/v1/social { "platform": "instagram", "action": "city_locations", "params": { "city_id": "c2728325" } }2JSON 响应
{ "results": [ { "rank": 1, "location_id": "3000346", "name": "St. Patrick's Cathedral", "slug": "st-patricks-cathedral" }, … ], "count": 96 }3表格行
rank location_id name slug 1 3000346 St. Patrick's Cathedral st-patricks-cathedral 2 1176464239075912 New York City - Manhattan - Nyc new-york-city-manhattan-nyc 4CSV
instagram-city_locations-sample.csv rank,location_id,name,slug,url,city_id,city_name,country_code,country_name,platform
city_id,同一个响应里回来这个城市在地点目录里的一页地点,每行有 location_id、name、slug,再变成表格行和 CSV。能拿到什么数据
表里是一次真实调用的结果:城市 c2728325,2026年11月21日 15:18(UTC)采集,返回 96 行。你自己调用时,按字段表返回这些字段。
| rank | location_id | name | slug | url | city_id | city_name | country_code | country_name | platform |
|---|---|---|---|---|---|---|---|---|---|
1 | 3000346 | St. Patrick's Cathedral | st-patricks-cathedral | https://www.instagram.com/explore/locations/3000346/st-patricks-cathedral/ | c2728325 | MidtownEast | US | United States | |
2 | 1176464239075912 | New York City - Manhattan - Nyc | new-york-city-manhattan-nyc | https://www.instagram.com/explore/locations/1176464239075912/new-york-city-manhattan-nyc/ | c2728325 | MidtownEast | US | United States |
用途
列出一个城市里的地点
给一个
city_id,读地点目录里这个城市下的地点。接着读地点详情
把
location_id交给location_info,读坐标和类别。接着读地点下的帖子
把
location_id交给location_posts,看这个地点下的帖子。建一份城市地点清单
存下
name、slug和url,对回地点目录里的页面。
Instagram Graph API 与 EveryInfra 对比
下面从账号条件、接入审核两方面,比 Instagram 官方 Graph API 和 EveryInfra city_locations。
| 对比项 | Instagram Graph API | EveryInfra |
|---|---|---|
| 账号条件 | "To use the APIs, your app users must have an Instagram professional account" | 请求只带 city_id 和一把 EveryInfra API Key,不要求你或你的用户有 Instagram 专业账号。 |
| 接入审核 | Advanced Access:"Advanced Access is the access level required if your app serves Instagram professional accounts that you don’t own or manage" 以及 "This access level requires App Review and Business Verification." | 一把 EveryInfra API Key 放在 Authorization: Bearer 请求头里,不用提交 Meta 应用审核,也不用登录 Instagram。 |
引文出自 Meta 开发者文档,2026-11-22 核对;这里只比接入条件。 官方出处: Instagram Platform overview (更新于 2026-10-29)
限制和注意事项
city_id必填:c加数字,如c2728325,取自location_cities的city_id,城市页链接也行。- 返回的是 Instagram 地点目录里这个城市下的地点;城市不在目录里时返回空结果,不扣费。
- 一次返回一页。响应有
next_page_token就原样作page_token传回,其他参数和第一页一样;令牌 24 小时有效,每页算一次调用;没有next_page_token就翻不下去了。 - 最后一页可能不满。
city_name每行相同,是城市在地点目录里的名字。- 这一项只列地点,不读地点的坐标和类别,要详情用
location_info。
价格
每次调用 $0.000556,按次计费,不按行数算。每翻一页算一次调用。失败和空结果不收费。
| 调用次数 | 费用 |
|---|---|
| 10,000 | $5.56 |
| 100,000 | $55.56 |
| 1,000,000 | $555.56 |
合计按每次调用的标价算。
代码示例
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "instagram",
"action": "city_locations",
"params": {
"city_id": "c2728325"
}
}'OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。
API 参考
下面是 city_locations 的参数、响应字段、错误和计费,可以复制整页,或用 Markdown 打开后交给 AI 助手。
AI 提示词
#请帮我用 EveryInfra 的「Instagram 城市下的地点」接口(instagram/city_locations)写一个数据采集脚本。
接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 instagram,action 填 city_locations,参数放在 params 里。
- 必填参数:
- city_id:城市编号:location_cities 结果里的 city_id(c 加数字,如 c2728325),直接给城市页链接也行。返回 Instagram 地点目录里这个城市下的地点,一页 96 个。
- 可选参数:
- page_token:翻页令牌:把上一次响应里的 next_page_token 原样传回,拿下一页;不传是第一页。翻页时其他参数要和第一页一样。令牌 24 小时有效,每页算一次调用。没有 next_page_token 就是翻不下去了。
- 返回一组记录,每条记录的主要字段:rank(名次)、location_id(地点编号)、name、slug(Instagram 地点目录链接里…)、url、city_id(城市编号)、city_name((city_locations)城…)、country_code(国家代码)、country_name(国家的英文名)。
- 示例请求体:
{
"platform": "instagram",
"action": "city_locations",
"params": {
"city_id": "c2728325"
}
}
- 计费:$0.56 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。
写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。请求参数
#| 参数名 | 位置 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
Authorization | header | string | 是 | - | Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。 |
platform | body | string | 是 | instagram | 平台标识,固定值。 |
action | body | string | 是 | city_locations | 能力标识,固定值。 |
city_id | body.params | string | 是 | - | 城市编号:location_cities 结果里的 city_id(c 加数字,如 c2728325),直接给城市页链接也行。返回 Instagram 地点目录里这个城市下的地点,一页 96 个。 |
page_token | body.params | string | 否 | - | 翻页令牌:把上一次响应里的 next_page_token 原样传回,拿下一页;不传是第一页。翻页时其他参数要和第一页一样。令牌 24 小时有效,每页算一次调用。没有 next_page_token 就是翻不下去了。 |
响应示例
#{ "id": "req_…", "platform": "instagram", "action": "city_locations", "results": [ { "rank": 1, "location_id": "3000346", "name": "St. Patrick's Cathedral", "slug": "st-patricks-cathedral", "url": "https://www.instagram.com/explore/locations/3000346/st-patricks-cathedral/", "city_id": "c2728325", "city_name": "MidtownEast", "country_code": "US", "country_name": "United States", "platform": "instagram" }, { "rank": 2, "location_id": "1176464239075912", "name": "New York City - Manhattan - Nyc", "slug": "new-york-city-manhattan-nyc", "url": "https://www.instagram.com/explore/locations/1176464239075912/new-york-city-manhattan-nyc/", "city_id": "c2728325", "city_name": "MidtownEast", "country_code": "US", "country_name": "United States", "platform": "instagram" } ], "next_page_token": …, "pagination": { … }, "count": 96, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
返回字段
#业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。
| 字段 | 含义 |
|---|---|
rank | 名次,从 1 开始,是这一行在这次结果里的顺序。user_search:先是 Instagram 搜索框给的账号(matched_by 为 search_box),按搜索框的顺序;后面是用这个关键词搜到的帖子的作者,用来补足条数(matched_by 为 post_author);没有 matched_by 的结果是 Instagram 给这个关键词排的账号位置。similar_profiles:相似账号的名次,按粉丝数从多到少。likers:点赞名单里的顺序。 |
location_id | 地点编号。可以拿去调 location_info、location_nearby、location_posts。 |
name | 名称。用于账号/商品/商家类能力,指该对象本身的名字。 |
slug | Instagram 地点目录链接里的那段名字,如 st-patricks-cathedral。 |
url | 该记录在原平台上的可访问链接。 |
city_id | 城市编号,c 加数字,如 c2728325。拿去调 city_locations 看这个城市下的地点。 |
city_name | (city_locations)城市在 Instagram 地点目录里的名字,每行相同。 |
country_code | 国家代码,两个大写字母(ISO 3166-1),如 US。 |
country_name | 国家的英文名,如 United States。 |
platform | 数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。 |
错误与计费
#- 401
- 缺少 Key 或 Key 无效。
- 402
- 余额不足,先充值。
- 422
- 参数名或取值不对,按错误信息给的候选改;不扣费。
- 429
- 超过每分钟请求上限,按 Retry-After 等待后再试。
- 503
- 暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
- 200 空结果
- 没有数据,不扣费。
官方资料参照
#只用于核对对象与术语,不表示平台对 EveryInfra 的授权或背书。
- Instagram 地点目录:城市页下的地点 ↗
Instagram 公开的地点目录里,城市页(如 Singapore, Singapore,编号 c2160986)列出该城市下的地点,每个地点链接里是数字地点编号。可证明「城市下的地点」是 Instagram 自己的目录结构,地点按数字编号定位;这是目录页本身,不是接口文档,不证明每页 96 个、分页方式、rank 的含义或目录是否完整。
核对于 2026-11-21
常见问题
Instagram 城市下的地点接口返回什么?
每行一个地点:location_id、name、slug、url,加上 city_id、city_name、country_code、country_name 和 rank。
city_id 从哪里拿?
取自 location_cities 结果里的 city_id(c 加数字),也可以直接给城市页链接。
怎么取下一页?
响应有 next_page_token 时,原样作 page_token 传回,其他参数不变。没有 next_page_token 就翻不下去了。
读一页地点要多少钱?
每次 $0.000556,每千次 $0.56,每页算一次调用,不按行数算。失败和空结果不收费。
要登录 Instagram 吗?
不用。请求头里放一把 EveryInfra API Key(Authorization: Bearer),请求只带 city_id,不需要 Instagram 登录或访问令牌。
相关的 Instagram 能力
同一把 Key 还能调用 Instagram 的其他能力,比如用 location_posts 读某个地点下的帖子。
- 单条内容
post每千次 $0.56单条内容:返回列表,默认 11 条、单次最多 11 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 主页或对象详情
profile每千次 $0.56主页或对象详情:返回单个对象;主要字段 username、display_name、bio、follower_count、following_count、post_count。 - 账号画像
persona每千次 $0.56账号画像:返回单个对象;主要字段 username、display_name、bio、follower_count、following_count、post_count。 - 用户内容
user_posts每千次 $0.56用户内容:返回列表,默认 30 条、单次最多 200 条;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 内容发现
discover每千次 $0.56内容发现:返回列表,默认 30 条、单次最多 200 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 评论
comments每千次 $0.79评论:返回列表,默认 50 条、单次最多 100 条;主要字段 id、text、url、like_count、reply_count、author_username。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - Reels 短视频
reels每千次 $1.19Reels 短视频:返回列表,默认 30 条、单次最多 100 条;主要字段 post_id、url、text、media_type、like_count、comment_count。 - 话题内容
hashtag每千次 $0.56话题内容:返回列表,默认 30 条、单次最多 30 条(传更大的数按 30 条返回);主要字段 post_id、url、text、media_type、like_count、comment_count。 - 粉丝数量
followers每千次 $0.56粉丝数量:返回单个对象;主要字段 id、username、url、name、avatar_url、follower_count。 - 粉丝列表
followers_list每千次 $0.56粉丝列表:返回列表,默认 50 条、单次最多 500 条;主要字段 id、username、url、name、avatar_url、is_private。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 关注列表
following_list每千次 $0.56关注列表:返回列表,默认 50 条、单次最多 500 条;主要字段 id、username、url、name、avatar_url、is_private。 - 账号搜索
user_search每千次 $4.81账号搜索:返回列表,默认 20 条、单次最多 30 条;主要字段 rank、username、user_id、display_name、is_verified、is_private。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - Reels 关键词搜索
reels_search每千次 $7.19Reels 关键词搜索:返回列表,默认 20 条、单次最多 200 条;主要字段 post_id、id、url、text、play_count、like_count。 - 相似账号
similar_profiles每千次 $8.81相似账号:返回列表,默认 20 条、单次最多 30 条;主要字段 rank、username、user_id、display_name、is_verified、is_private。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 被标记的帖子
tagged_posts每千次 $7.44被标记的帖子:返回列表,默认 20 条、单次最多 200 条;主要字段 post_id、url、tagged_username、author_username、author_id、text。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - Stories 内容
stories每千次 $1.5Stories 内容:返回列表,默认 100 条、单次最多 100 条(传更大的数按 100 条返回);主要字段 id、url、media_url、media_type、duration_seconds、duration_sec。 - 精选合集
highlights每千次 $1.6精选合集:返回列表,默认 100 条、单次最多 100 条(传更大的数按 100 条返回);主要字段 id、url、title、media_count、cover_url、created_at。 - 评论回复
comment_replies每千次 $0.88评论回复:返回列表,每次一页、每页最多 10 条,条数不固定(短页不代表到底),要更多就把响应顶层的 next_page_token 作为 page_token 再调,没有 next_page_token 才是到底;limit 照收但不起作用;主要字段 id、text、like_count、posted_at、author_username、author_id。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 点赞用户列表
likers每千次 $1.32点赞用户列表:返回列表,每次一页、每页最多 100 条,条数不固定(短页不代表到底),要更多就把响应顶层的 next_page_token 作为 page_token 再调,没有 next_page_token 才是到底;limit 照收但不起作用;主要字段 id、username、url、name、avatar_url、is_private。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 地点下的帖子
location_posts每千次 $0.56地点下的帖子:返回列表,每次一页、固定 12 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 同一段音乐的 Reels
audio_posts每千次 $0.56同一段音乐的 Reels:返回列表,每次一页、固定 12 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 发现页推荐
explore每千次 $0.56发现页推荐:返回列表,每次一页、固定 12 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 互动率统计
engagement每千次 $0.56互动率统计:返回单个对象;主要字段 username、display_name、url、follower_count、is_verified、sample_size。 - 按编号查账号
profile_by_id每千次 $0.56按编号查账号:返回单个对象;主要字段 username、display_name、bio、follower_count、following_count、post_count。 - 账号所在地与改名记录
user_about每千次 $0.56账号所在地与改名记录:返回单个对象;主要字段 username、user_id、joined_at、joined_text、country、former_usernames_count。 - 地点资料
location_info每千次 $0.56地点资料:返回单个对象;主要字段 location_id、name、category、lat、lng、address。 - 链接识别
resolve_links每千次 $0.56链接识别:返回单个对象;主要字段 shortcode、media_id、url、platform。 - 帖子嵌入代码
oembed每千次 $0.56帖子嵌入代码:返回单个对象;主要字段 version、type、title、author_name、author_url、author_id。 - 帖子正文翻译
post_translation每千次 $6.39帖子正文翻译:返回单个对象;主要字段 media_id、shortcode、url、author_username、text、translation。 - 附近的地点
location_nearby每千次 $0.56附近的地点:返回列表,每个目标一页、每页最多 20 条,没有 next_page_token(要往后读,用单目标能力逐个翻页);limit 照收但不起作用;主要字段 rank、location_id、name、category、lat、lng。 - 话题搜索
hashtag_search每千次 $0.56话题搜索:返回列表,每个目标一页、每页最多 15 条,没有 next_page_token(要往后读,用单目标能力逐个翻页);limit 照收但不起作用;主要字段 rank、name、id、post_count、post_count_label、url。 - 精选合集里的快拍
highlight_stories每千次 $0.56精选合集里的快拍:返回列表,每个目标一页、每页最多 100 条,没有 next_page_token(要往后读,用单目标能力逐个翻页);limit 照收但不起作用;主要字段 id、url、media_url、media_type、duration_seconds、duration_sec。 - 评论翻译
comment_translations每千次 $6.39评论翻译:返回列表,每个目标一页、每页最多 10 条,没有 next_page_token(要往后读,用单目标能力逐个翻页);limit 照收但不起作用;主要字段 comment_id、text、translation、source_language、target_language、author_username。 - 推荐 Reels
recommended_reels每千次 $1.18推荐 Reels:返回列表,每次一页、固定 10 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 账号转发的帖子
user_reposts每千次 $0.56账号转发的帖子:返回列表,每次一页、固定 12 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 post_id、url、text、media_type、like_count、comment_count。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 国家下的城市
location_cities每千次 $0.56国家下的城市:返回列表,每次一页、固定 96 条(最后一页可能更少),要更多就把响应顶层的 next_page_token 作为 page_token 再调;limit 照收但不起作用;主要字段 rank、city_id、name、slug、url、country_code。支持翻页:把响应里的 next_page_token 作为 page_token 传回拿下一页,其他参数不变,每页算一次调用。 - 批量查账号
profiles_batch每千次 $0.56批量查账号:返回列表;主要字段 username、display_name、bio、follower_count、following_count、post_count。