# Instagram 附近的地点 API (instagram.location_nearby)

- Canonical page: [https://everyinfra.com/instagram-api/location_nearby](https://everyinfra.com/instagram-api/location_nearby?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "location_nearby", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, one page of 20 per target, no next_page_token (to read further, page one target at a time with the single-target action; limit is ignored)
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=instagram&action=location_nearby

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| location_id | not declared | yes | not declared | 地点编号：帖子 location_detail 里的 id，或地点页链接（https://www.instagram.com/explore/locations/212988663/）里的那串数字，直接给链接也行。返回这个地点附近的地点，一次 20 个左右，没有下一页；有的地点 Instagram 不给附近的地点，这时返回空结果，不扣费。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| 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_label | Instagram 页面上写的帖子数，原样给出，如 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。 |

## Example

```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"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "instagram",
        "action": "location_nearby",
        "params": {
            "location_id": "212988663",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:18:47Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "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": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=instagram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
