# Instagram 地点下的帖子 API (instagram.location_posts)

- Canonical page: [https://everyinfra.com/instagram-api/location_posts](https://everyinfra.com/instagram-api/location_posts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "location_posts", "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 12 per call (limit is ignored; pass the top-level next_page_token from the response as page_token for the next page)
- Pagination: pass next_page_token back as page_token for the next page, other params unchanged; one call per page, tokens last 24 hours
- 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_posts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| location_id | not declared | yes | not declared | 地点 ID：帖子 location_detail 里的 id，或地点页链接（https://www.instagram.com/explore/locations/<数字>/…）里的那串数字，直接给链接也行。 |
| page_token | not declared | no | not declared | 翻页令牌：把上一次响应里的 next_page_token 原样传回，拿下一页；不传是第一页。翻页时其他参数要和第一页一样。令牌 24 小时有效，每页算一次调用。没有 next_page_token 就是翻不下去了。 |
| sort | enum: recent / top | no | not declared | top 是热门（不传时就是 top），recent 是最新。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| post_id | 帖子短码，就是链接里 /p/ 或 /reel/ 后面那段（不是数字编号）。 |
| url | 该记录在原平台上的可访问链接。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| media_type | 取值只有两个：video（视频，Reels 也是 video）、image（图片；轮播帖也记作 image，有 product_type 时，product_type 为 carousel_container 的就是轮播）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| view_count | 浏览/播放数。null 表示不公开，不等于 0。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| location | 地理位置描述，原文透传，格式随平台而异。 |
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| video_url | 视频文件链接：带声音的完整 mp4，能直接播放。轮播帖里有视频时是第一个视频；不是视频时不出现。链接带签名，会过期；有 video_url_expires_at 时以它为准。 |
| author_id | 作者在原平台的唯一 ID。 |
| width | 原图或原视频的宽，像素。 |
| height | 原图或原视频的高，像素。 |
| is_comments_disabled | 帖子是否关闭评论。 |
| author_follower_count | 作者粉丝数。null 表示不公开。 |
| hashtags | 正文里的话题标签数组，按出现顺序；没有时不出现这个字段。 |
| top_comments | 帖子下展示的几条评论，每项含正文（text）和评论人（author_username）；没有时不出现这个字段。 |
| product_type | Instagram 自己分的内容形态：feed 普通帖、clips Reels、carousel_container 轮播、longform 长视频。 |
| play_count | 播放量。 |
| fb_play_count | 作者把这条同时发到 Facebook 时，Facebook 那边的播放数；只有这样的帖子才出现。 |
| fb_like_count | 作者把这条同时发到 Facebook 时，Facebook 那边的点赞数；只有这样的帖子才出现。 |
| fb_comment_count | 作者把这条同时发到 Facebook 时，Facebook 那边的评论数；只有这样的帖子才出现。 |
| share_count | 分享/转发数。null 表示不公开，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| duration_sec | 时长，秒。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_estimated | 为 true 表示 duration_sec 是从视频链接里读出的整秒数，和精确时长最多差 1 秒。只在这样读出时出现。 |
| image_count | 图片张数：单图帖为 1；轮播帖是里面图片的张数，不算视频。 |
| video_count | 轮播帖里视频的个数；只有轮播帖有。 |
| video_url_expires_at | video_url 的过期时间，ISO 8601，UTC。 |
| video_hd_url | 清晰度最高的视频画面轨：只有画面、没有声音。会过期，过期时间见 video_hd_expires_at。要带声音的视频，把它和 audio_url 合成（比如用 ffmpeg 合并两条轨），或者直接用 video_url。 |
| video_hd_height | video_hd_url 的画面高度，像素。 |
| audio_url | 视频的音轨，只有声音；和 video_hd_url 差不多同时过期（见 video_hd_expires_at）。视频没有单独的音轨时（比如无声视频）不出现。 |
| video_hd_expires_at | video_hd_url 的过期时间，ISO 8601，UTC；audio_url 差不多同时过期。 |
| is_paid_partnership | 帖子是否标了「付费合作」（Paid partnership）。页面给了这项信息才出现，可能为 false。 |
| is_pinned | 是否置顶。帖子（user_posts、tagged_posts、recent_posts，以及 location_posts、audio_posts、explore 等返回帖子的接口）：被作者置顶在主页网格或 Reels 标签页，只在置顶时出现，值为 true。评论（comments）：被帖子作者置顶，只在置顶时出现，值为 true。精选（highlights）：是否被置顶在主页精选栏最前。 |
| likes_hidden | 作者隐藏了点赞数。只在隐藏时出现，值为 true；这时一般没有 like_count。 |
| caption_is_edited | 正文编辑过。只在编辑过时出现，值为 true。 |
| accessibility_caption | Instagram 自动生成的图片描述（替代文字，英文）。 |
| author_is_verified | 作者账号是否有认证标。出现在 user_posts、tagged_posts、location_posts、audio_posts、explore、stories、comment_replies，以及 post、discover、reels、hashtag、reels_search 的行里（有值才出现）。 |
| author_is_private | 作者是不是私密账号。 |
| author_avatar_url | 作者头像图片链接（多数平台带签名、会过期）。 |
| posted_at_estimated | 为 true 表示页面没给发布时间，posted_at 是按帖子的数字编号（id）推算出的上传时间；一般和发布时间相同，定时发布的帖子会早一些。只在推算时出现（tagged_posts 常见）。 |
| mentions | 正文里 @ 到的用户名，数组。 |
| tagged_users | 图片、视频里被标记的人的用户名，数组；轮播帖里每一张的都算。 |
| coauthors | 合著者：和作者一起署名发这条帖子的账号的用户名，数组。 |
| sponsors | 付费合作里标注的品牌方账号的用户名，数组。 |
| media | 轮播帖里的每一张，一张一项：type（image 或 video）、image_url（图片地址，视频是封面图；带签名，会过期）、video_url（只有视频有，带声音的 mp4）、width、height（像素）。只有轮播帖有。 |
| music | 帖子或 Reels 用的音乐，对象：歌手（artist）、曲名（title）；有的还带 audio_id（音乐编号）、is_original（true 是作者自己录的原声，false 是曲库里的歌）、is_explicit（曲库歌曲是否标了含露骨内容）、is_trending（原声是否正在流行，只有原声有）、url（Instagram 上这段音乐的页面）。原声的 title 一般是 Original audio，artist 是原声作者的用户名。没有时不出现这个字段。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| location_detail | 帖子挂的地点的详细信息，对象：id（地点编号）、name（地点名，和 location 相同）、short_name（短名）、city、address、lat、lng、url（Instagram 上这个地点的页面），有的才带。没挂地点时不出现。 |
| location_info | （location_posts）查的这个地点，每行相同，对象：id（地点编号）、name（地点名）、category（地点类别，如 City）、lat、lng、post_count（这个地点下的帖子总数）、url（Instagram 上这个地点的页面），有的才带。 |

## 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_posts",
  "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_posts",
        "params": {
            "location_id": "212988663",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "location_posts",
  "results": [
    {
      "post_id": …,
      "url": …,
      "text": …,
      "media_type": …,
      "like_count": …,
      "comment_count": …,
      "view_count": …,
      "author_username": …,
      "author_name": …,
      "posted_at": …,
      "location": …,
      "id": …,
      "image_url": …,
      "video_url": …,
      "author_id": …,
      "width": …,
      "height": …,
      "is_comments_disabled": …,
      "author_follower_count": …,
      "hashtags": …,
      "top_comments": …,
      "product_type": …,
      "play_count": …,
      "fb_play_count": …,
      "fb_like_count": …,
      "fb_comment_count": …,
      "share_count": …,
      "repost_count": …,
      "duration_sec": …,
      "duration_seconds": …,
      "duration_estimated": …,
      "image_count": …,
      "video_count": …,
      "video_url_expires_at": …,
      "video_hd_url": …,
      "video_hd_height": …,
      "audio_url": …,
      "video_hd_expires_at": …,
      "is_paid_partnership": …,
      "is_pinned": …,
      "likes_hidden": …,
      "caption_is_edited": …,
      "accessibility_caption": …,
      "author_is_verified": …,
      "author_is_private": …,
      "author_avatar_url": …,
      "posted_at_estimated": …,
      "mentions": …,
      "tagged_users": …,
      "coauthors": …,
      "sponsors": …,
      "media": …,
      "music": …,
      "platform": …,
      "location_detail": …,
      "location_info": …
    }
  ],
  "next_page_token": …,
  "pagination": { … },
  "count": …,
  "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
