Instagram 按编号查账号 API

用 Instagram 账号的数字 user_id 读它现在的 username 和主页资料:follower_count、following_count、post_count,每千次 $0.56。

  • 账号改了用户名,user_id 不变
  • 不含 recent_posts 和 highlight_count
  • 帖子结果里的 author_id 可以直接当 user_id 用
免费开始

接口健康状态

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

24 小时趋势

30 天趋势

  1. 1请求

    POST /api/v1/social
    {
      "platform": "instagram",
      "action": "profile_by_id",
      "params": {
        "user_id": "787132"
      }
    }
  2. 2JSON 响应

    {
      "results": {
        "username": "n•••o",
        "bio": "Step into wonder and find your inner explorer with National Geographic 🌎",
        "follower_count": 268002941,
        "following_count": 195,
        …
      }
    }
  3. 3字段

    usernamebiofollower_countfollowing_count
    n•••oStep into wonder and find your inner explorer with National Geographic 🌎268002941195
  4. 4CSV

    instagram-profile_by_id-sample.csv username,display_name,bio,follower_count,following_count,post_count,is_private,is_verified,is_business,is_professional,category,external_url,avatar_url,user_id,avatar_hd_url,external_urls,has_reels,url,reels_count,business_email,business_phone,threads_username,fbid,is_memorialized,is_joined_recently,account_type,emails,phones,pronouns,bio_links_detail,messaging_ids,business_address,platform

请求带数字 user_id,返回一个 JSON 对象,里面有 username、bio、follower_count 等字段,列成字段表,也可下载为 CSV。

能拿到什么数据

下表是对 787132 的一次真实调用,采集于 2026年11月21日 15:18(UTC),返回一个对象;灰条是隐去的个人信息(CSV 里是 •••)。你自己调用时,按字段表返回这些字段。

usernamedisplay_namebiofollower_countfollowing_countpost_countis_privateis_verifiedis_businessis_professionalcategoryexternal_urlavatar_urluser_idavatar_hd_urlexternal_urlshas_reelsurlreels_countbusiness_emailbusiness_phonethreads_usernamefbidis_memorializedis_joined_recentlyaccount_typeemailsphonespronounsbio_links_detailmessaging_idsbusiness_addressplatform
n•••oN•••cStep into wonder and find your inner explorer with National Geographic 🌎26800294119532196falsetruetruetruenullhttp://visitstore.bio/natgeo787132[{"url":"http://visitstore.bio/natgeo"},{"url":"https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002","title":"Subscribe Here!"}]truehttps://www.instagram.com/natgeo/1nullnulln•••onullnullbusinessnullnullnull[{"url":"http://visitstore.bio/natgeo","type":"external"},{"url":"https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002","title":"Subscribe Here!","type":"external"}]nullnullinstagram

用途

  • 账号改名后找回

    手里只有旧的 user_id,用它读现在的 username,账号改了用户名也找得到。

  • 把帖子作者换成用户名

    帖子结果里的 author_id 就是 user_id,传进来换出作者现在的 username 和 follower_count。

  • 按编号长期建档

    用 user_id 当账号的主键,每次读 username 和 bio,记录改名和简介变化。

  • 补全联系方式

    读 external_urls、bio_links_detail 和 business_email,补全一个账号的外链和公开联系方式。

Instagram Graph API 与 EveryInfra 对比

下面从账号编号、能读哪些账号、访问条件三方面,比 Instagram 官方 Graph API 和 EveryInfra profile_by_id。

对比项Instagram Graph APIEveryInfra
账号编号字段 id:"App-scoped User ID."user_id 是账号的数字编号,如 787132;账号改了用户名,编号不变,返回的是这个账号现在的 username。
能读哪些账号"Get fields and edges on an Instagram Business or Creator Account."user_id 指定的账号;返回 is_business、is_professional、account_type 标记。
访问条件访问令牌:"Required. App user’s User access token."一把 EveryInfra API Key 放在 Authorization: Bearer 请求头里,不用登录 Instagram,也不用 Instagram 访问令牌。

引文出自 Meta 开发者文档(IG User 页),2026-11-22 核对。 官方出处: IG User (更新于 2026-04-22)

限制和注意事项

  • user_id 必填,填账号的数字编号,如 787132。
  • 取得编号:profile 结果里的 user_id,或帖子结果里的 author_id。
  • 返回的字段同 profile,但不含 recent_posts 和 highlight_count。
  • 一次调用读一个账号,返回一个对象。

价格

每次调用 $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": "profile_by_id",
  "params": {
    "user_id": "787132"
  }
}'

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

API 参考

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

POST

AI 提示词

#
请帮我用 EveryInfra 的「Instagram 按编号查账号」接口(instagram/profile_by_id)写一个数据采集脚本。

接口约定:
- 请求:POST https://api.everyinfra.com/api/v1/social,请求头 Authorization: Bearer <API Key>;Key 从环境变量 EVERYINFRA_API_KEY 读取,不要写进代码。
- 请求体里 platform 填 instagram,action 填 profile_by_id,参数放在 params 里。
- 必填参数:
  - user_id:Instagram 账号的数字编号,如 787132;profile 结果里的 user_id、帖子结果里的 author_id 都是它。账号改了用户名,编号不变。
- 返回一个对象,主要字段:username、display_name、bio、follower_count、following_count、post_count、is_private(是否私密账号)、is_verified、is_business(是否为商家账号)、is_professional(是否为专业账号(商家或创作者))、category、external_url(主页外链);一共 32 个字段,完整列表见 https://api.everyinfra.com/api/v1/social/catalog?platform=instagram。
- 示例请求体:
{
  "platform": "instagram",
  "action": "profile_by_id",
  "params": {
    "user_id": "787132"
  }
}
- 计费:$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是profile_by_id能力标识,固定值。
user_idbody.paramsstring是-Instagram 账号的数字编号,如 787132;profile 结果里的 user_id、帖子结果里的 author_id 都是它。账号改了用户名,编号不变。返回这个账号现在的用户名和主页资料,不含最近帖子和精选数。

响应示例

#
2026年11月21日 15:18(北京时间)用上方代码示例的参数真实调用所得。results 与 count 是那次的真实返回,已隐去名字、账号、头像、主页链接、联系方式等个人信息;id、billing、quota 每次调用都不同,只给结构。
json
{  "id": "req_…",  "platform": "instagram",  "action": "profile_by_id",  "results": {    "username": "n•••o",    "display_name": "N•••c",    "bio": "Step into wonder and find your inner explorer with National Geographic 🌎",    "follower_count": 268002941,    "following_count": 195,    "post_count": 32196,    "is_private": false,    "is_verified": true,    "is_business": true,    "is_professional": true,    "external_url": "http://visitstore.bio/natgeo",    "avatar_url": "https://scontent-fra5-1.cdninstagram.com/•••",    "user_id": "787132",    "avatar_hd_url": "https://scontent-fra5-1.cdninstagram.com/•••",    "external_urls": [      {        "url": "http://visitstore.bio/natgeo"      },      {        "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002",        "title": "Subscribe Here!"      }    ],    "has_reels": true,    "url": "https://www.instagram.com/natgeo/",    "reels_count": 1,    "threads_username": "n•••o",    "fbid": "•••",    "account_type": "business",    "bio_links_detail": [      {        "url": "http://visitstore.bio/natgeo",        "type": "external"      },      {        "url": "https://ngmdomsubs.nationalgeographic.com/servlet/OrdersGateway?cds_mag_code=NGM&cds_page_id=283562&cds_response_key=I5FX10002",        "title": "Subscribe Here!",        "type": "external"      }    ],    "platform": "instagram"  },  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

返回字段

#

业务数据在 results 里;下表是每条记录可能包含的字段,平台没有提供的值不会被编造。

字段含义
username用户名(@handle)。
display_name显示名,可能与 username 不同。
bio个人简介,账号自己填写的文本。可能含换行和 emoji。
follower_count粉丝数。null 表示不公开,不等于 0。
following_count关注数。null 表示不公开,不等于 0。
post_count发布内容总数。null 表示不公开,不等于 0。
is_private是否私密账号。
is_verified是否为平台认证账号(蓝V等)。null 表示无法判定。
is_business是否为商家账号。
is_professional是否为专业账号(商家或创作者)。
category分类名称,取值为原平台的分类体系,未做跨平台归一。
external_url主页外链。
avatar_url头像图片链接。部分平台给的是带尺寸参数的 CDN 链接,可能有时效。
user_id用户在原平台的唯一 ID。
avatar_hd_url高清头像链接(avatar_url 是小图)。
external_urls简介里的全部外链:url、title(external_url 只是第一个)。
has_reels是否发过 Reels。
url该记录在原平台上的可访问链接。
reels_count这个账号发过的 Reels 条数(整数)。
business_email商家账号在主页「联系」(Contact)按钮里公开的邮箱。没有时不出现。
business_phone商家账号在主页「联系」(Contact)按钮里公开的电话。没有时不出现。
threads_username主页上 Threads 徽章显示的名字,一般就是这个人的 Threads 用户名。
fbidMeta 给这个账号的另一个数字编号,和 user_id 不是同一个数。
is_memorialized是纪念账号(本人去世后 Instagram 设成的纪念状态)。只在是纪念账号时出现,值为 true。
is_joined_recently主页上标着「最近加入」(Joined recently)。只在有这个标记时出现,值为 true。
account_type账号类型:personal 个人、business 商家、creator 创作者。
emails联系邮箱列表(一条记录可能有多个),原文透传、去重。
phones本人公开写在简介里的电话号码,数组。只收以 + 或 00 开头的号码,或者前面写明 WhatsApp、电话这类字样的号码。没有时不出现。
pronouns主页上填写的人称代词,数组。
bio_links_detail简介区的每个链接,一个链接一项:url(真实地址,已去掉 Instagram 包的那层跳转)、title(链接标题,有的才带)、type(Instagram 给的链接类型,如 external)。external_urls 是同一批链接的 url 和 title。
messaging_ids简介里公开写的聊天账号,一个账号一项 {app, id};app 如 wechat、line、telegram、kakao、skype、signal。
business_address商家账号公开的地址,对象:street、city、zip、lat、lng,有的才带。
platform数据来源平台标识,与请求里的 platform 一致(如 xiaohongshu、tiktok)。

错误与计费

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

错误码

常见问题

按编号查 Instagram 账号能返回哪些字段?

返回一个对象:username、display_name、bio、follower_count、following_count、post_count、is_private、is_verified、account_type、external_url、user_id 等。

user_id 从哪里拿?

profile 结果里的 user_id,或帖子结果里的 author_id,都是这个编号。

按编号查一个账号多少钱?

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

按编号查账号要登录 Instagram 吗?

不用。请求头里放一把 EveryInfra API Key(Authorization: Bearer),不用登录 Instagram,也不用 Instagram 访问令牌。

profile_by_id 和 profile 有什么区别?

输入不同:profile_by_id 用数字 user_id,profile 用 username。profile_by_id 的结果不含 recent_posts 和 highlight_count。

同一把 Key 还能调用 Instagram 的其他能力,比如按 username 读主页资料的 profile。

Google Analytics 同意才加载 隐私