Instagram 附近的地点 API

按 location_id 列出这个地点附近的地点:每行有 name、category、lat、lng、post_count,有的还带 price_range 和 hours_status,每千次 $0.56。

  • 一次给全,没有下一页
  • origin 标出你查的地点
  • 失败和空结果不收费
免费开始

接口健康状态

24h 健康值
正常
  • 健康 / 正常
  • 可用
  • 少量可用
  • 基本不可用
正常

24 小时趋势

30 天趋势

  1. 1请求

    POST /api/v1/social
    {
      "platform": "instagram",
      "action": "location_nearby",
      "params": {
        "location_id": "212988663"
      }
    }
  2. 2JSON 响应

    {
      "results": [
        {
          "rank": 1,
          "location_id": "105978888134411",
          "name": "Long Island City",
          "category": "Government Building"
        },
        …
      ],
      "count": 20
    }
  3. 3表格行

    ranklocation_idnamecategory
    1105978888134411Long Island CityGovernment Building
    2106075139432188New York, N.Y.Government organization
  4. 4CSV

    instagram-location_nearby-sample.csv rank,location_id,name,category,lat,lng,post_count,post_count_label,price_range,hours_status,thumbnail_url,url,platform,origin

请求带 location_id,同一个响应里回来这个地点附近的地点,每行有 name、lat、lng 等字段,再变成表格行和 CSV。

能拿到什么数据

表里是一次真实调用的结果:地点 212988663,2026年11月21日 15:18(UTC)采集,返回 20 行。你自己调用时,按字段表返回这些字段;origin 对象是你查的那个地点,每行相同。

ranklocation_idnamecategorylatlngpost_countpost_count_labelprice_rangehours_statusthumbnail_urlurlplatformorigin
1105978888134411Long Island CityGovernment Building40.714199791679-74.00640606880222002.2K postsnullnullhttps://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/894460983_17948449221127280_215263549254016924_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMTk4MzE0NDE1NTc3ODIyMzE3OTQ4NDQ5MjE1MTI3Mjgw.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3R…https://www.instagram.com/explore/locations/105978888134411/long-island-city/instagram{"location_id":"212988663","name":"New York, New York","lat":40.7142,"lng":-74.0064}
2106075139432188New York, N.Y.Government organization40.716666666667-7414000001.4M postsnullnullhttps://scontent-lax7-1.cdninstagram.com/v/t51.71878-15/916393440_1696283865348282_5708378039583168201_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNTEzNDEwNDI4MDk0MTk1MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnh…https://www.instagram.com/explore/locations/106075139432188/new-york-ny/instagram{"location_id":"212988663","name":"New York, New York","lat":40.7142,"lng":-74.0064}

用途

  • 找周边的同类场所

    读 category,从附近的地点里挑出同一类的。

  • 把周边画到地图上

    用每行的 lat 和 lng 定位,再用 origin 标出中心点。

  • 比较周边地点的热度

    读 post_count,看附近哪些地点下的帖子更多。

  • 看价位和营业状态

    读 price_range 和 hours_status,有才给。

Instagram Graph API 与 EveryInfra 对比

下面从平台范围,比 Instagram 官方 Graph API 和 EveryInfra location_nearby。

对比项Instagram Graph APIEveryInfra
平台范围"The Instagram Platform is a collection of APIs that allows your app to access data for Instagram professional accounts, including business and creator accounts."读的是一个地点附近的地点,不是哪个专业账号的数据;不用先把 Instagram 账号接到你的应用上。

引文出自 Meta 开发者文档,2026-11-22 核对;这里只比接入条件。 官方出处: Instagram Platform overview (更新于 2026-10-29)

限制和注意事项

  • location_id 必填:帖子 location_detail 里的 id,或地点页链接里的那串数字,直接给链接也行。
  • 一次给全,没有下一页;返回的条数因地点而异。
  • 有的地点 Instagram 不给附近的地点,这时返回空结果,不扣费。
  • price_range、hours_status 没有时不出现。
  • post_count_label 是 Instagram 页面上写的帖子数,原样给出,如 2.2K posts。
  • origin 是你查的那个地点,每行相同。

价格

每次调用 $0.000556,按次计费,不按行数算。没有翻页,一次给全。失败和空结果不收费。

调用次数费用
10,000$5.56
100,000$55.56
1,000,000$555.56

合计按每次调用的标价算。

代码示例

#
bash
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": "location_nearby",
  "params": {
    "location_id": "212988663"
  }
}'

OpenAPI 定义 (JSON)示例从环境变量 EVERYINFRA_API_KEY 读取 Key,复制出去的代码不含你的 Key。

API 参考

下面是 location_nearby 的参数、响应字段、错误和计费,可以复制整页,或用 Markdown 打开后交给 AI 助手。

POST

AI 提示词

#
请帮我用 EveryInfra 的「Instagram 附近的地点」接口(instagram/location_nearby)写一个数据采集脚本。

接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 instagram,action 填 location_nearby,参数放在 params 里。
- 必填参数:
  - location_id:地点编号:帖子 location_detail 里的 id,或地点页链接(https://www.instagram.com/explore/locations/212988663/)里的那串数字,直接给链接也行。
- 返回一组记录,每条记录的主要字段:rank(名次)、location_id(地点编号)、name、category、lat(纬度)、lng(经度)、post_count、post_count_label(Instagram 页面上写的帖子数)、price_range((location_nearby)…)、hours_status((location_nearby)…)、thumbnail_url、url;一共 13 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=instagram。
- 示例请求体:
{
  "platform": "instagram",
  "action": "location_nearby",
  "params": {
    "location_id": "212988663"
  }
}
- 计费:$0.56 / 千次;失败和空结果不扣费。
- 一次要采几十上百个时,在请求体加 "mode": "async":先拿到 job_id,再轮询 GET https://api.everyinfra.com/api/v1/jobs/{job_id} 取结果。
- 返回 422 时,按错误信息里的候选参数和允许值修正;返回 429 或 503 时,按 Retry-After 等待后重试。

写代码前,先问清楚我要采哪些对象、一共多少个、需要哪些字段、结果存成什么格式,再把方案和大概花费讲给我确认。

请求参数

#
参数名位置类型必填默认值说明
Authorizationheaderstring是-Bearer 加你的 API Key。在控制台创建;不要放进网址或代码仓库。
platformbodystring是instagram平台标识,固定值。
actionbodystring是location_nearby能力标识,固定值。
location_idbody.paramsstring是-地点编号:帖子 location_detail 里的 id,或地点页链接(https://www.instagram.com/explore/locations/212988663/)里的那串数字,直接给链接也行。返回这个地点附近的地点,一次 20 个左右,没有下一页;有的地点 Instagram 不给附近的地点,这时返回空结果,不扣费。

响应示例

#
2026年11月21日 15:18(北京时间)用上方代码示例的参数真实调用所得。results 与 count 是那次的真实返回,已隐去名字、账号、头像、主页链接、联系方式等个人信息,列表只保留前 2 条;id、billing、quota 每次调用都不同,只给结构。
json
{  "id": "req_…",  "platform": "instagram",  "action": "location_nearby",  "results": [    {      "rank": 1,      "location_id": "105978888134411",      "name": "Long Island City",      "category": "Government Building",      "lat": 40.714199791679,      "lng": -74.006406068802,      "post_count": 2200,      "post_count_label": "2.2K posts",      "thumbnail_url": "https://scontent-lax7-1.cdninstagram.com/v/t51.82787-15/894460983_17948449221127280_215263549254016924_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzMTk4MzE0NDE1NTc3ODIyMzE3OTQ4NDQ5MjE1MTI3Mjgw.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3R…",      "url": "https://www.instagram.com/explore/locations/105978888134411/long-island-city/",      "platform": "instagram",      "origin": {        "location_id": "212988663",        "name": "New York, New York",        "lat": 40.7142,        "lng": -74.0064      }    },    {      "rank": 2,      "location_id": "106075139432188",      "name": "New York, N.Y.",      "category": "Government organization",      "lat": 40.716666666667,      "lng": -74,      "post_count": 1400000,      "post_count_label": "1.4M posts",      "thumbnail_url": "https://scontent-lax7-1.cdninstagram.com/v/t51.71878-15/916393440_1696283865348282_5708378039583168201_n.jpg?stp=dst-jpg_e15_tt6&_nc_cat=110&_nc_map=urlgen_bucketless&ig_cache_key=NDAzNTEzNDEwNDI4MDk0MTk1MA%3D%3D.3-ccb7-5&ccb=7-5&_nc_sid=58cdad&efg=eyJ2ZW5jb2RlX3RhZyI6IkNMSVBTLnh…",      "url": "https://www.instagram.com/explore/locations/106075139432188/new-york-ny/",      "platform": "instagram",      "origin": {        "location_id": "212988663",        "name": "New York, New York",        "lat": 40.7142,        "lng": -74.0064      }    }  ],  "count": 20,  "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名称。用于账号/商品/商家类能力,指该对象本身的名字。
category分类名称,取值为原平台的分类体系,未做跨平台归一。
lat纬度。
lng经度。
post_count发布内容总数。null 表示不公开,不等于 0。
post_count_labelInstagram 页面上写的帖子数,原样给出,如 2.2K posts、1.2M posts。
price_range(location_nearby)价位,Instagram 给的写法,如 $$;没有时不出现。
hours_status(location_nearby)营业状态,Instagram 给的写法;没有时不出现。
thumbnail_url缩略图链接,分辨率低于 image_url。
url该记录在原平台上的可访问链接。
platform数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。
origin(location_nearby)查的那个地点,每行相同,对象:location_id、name、lat、lng。

错误与计费

#
401
缺少 Key 或 Key 无效。
402
余额不足,先充值。
422
参数名或取值不对,按错误信息给的候选改;不扣费。
429
超过每分钟请求上限,按 Retry-After 等待后再试。
503
暂时无法完成,预扣的费用退回;结果未知时先核对,不要直接重发。
200 空结果
没有数据,不扣费。

错误码

常见问题

Instagram 附近地点接口返回什么?

每行一个附近的地点:location_id、name、category、lat、lng、post_count、url,有的还带 price_range、hours_status。

能翻页吗?

不能。一次调用给全,没有 next_page_token;条数因地点而异。

rank 表示什么?

rank 是这一行在这次结果里的顺序,从 1 开始。

读一次附近地点要多少钱?

每次 $0.000556,每千次 $0.56,按调用次数算,不按行数算。失败和空结果不收费。

要登录 Instagram 吗?

不用。请求头里放一把 EveryInfra API Key(Authorization: Bearer),请求只带 location_id,不需要 Instagram 登录或访问令牌。

同一把 Key 还能调用 Instagram 的其他能力,比如用 location_info 读某个附近地点的详情。

Google Analytics 同意才加载 隐私