Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

Instagram Shortcode to Media ID (V3)

API 文档
https://api.sandbase.ai/v1/api/instagram/v3/shortcode-to-media-id

Converts an Instagram post shortcode into its corresponding numeric media ID. Requires a post shortcode string to return the unique platform identifier.

价格
$0.002美元 / 次调用
方法
POST
响应
JSON
参数
1 个必填 · 0 个可选

Playground

输入
Post shortcode
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

Instagram Shortcode to Media ID (V3) API

Convert an Instagram post or reel shortcode (the part after /p/ or /reel/ in the link) into its numeric media ID.

Use cases

  • Turn post or reel links into the media ID that comment, liker and post-detail APIs need.
  • Recover a post's creation time from its media ID (see Notes).

Request

curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/shortcode-to-media-id" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shortcode": "DUajw4YkorV"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
shortcodestringYesPost shortcode

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "media_id": "3826528124109228757",
  "shortcode": "DUajw4YkorV"
}

Response fields

FieldMeaning
media_idNumeric media ID as a string; keep it as a string (beyond JavaScript's safe integer range).
shortcodeThe shortcode you sent.

Notes

  • An Instagram media ID and its shortcode are the same number in two encodings. The shortcode is the media ID written in base 64 with the alphabet A-Z a-z 0-9 - _ (A = 0, _ = 63), so DRhvwVLAHAG and 3774507992167247878 name the same post. The media ID itself is a 64-bit snowflake: the top 41 bits are milliseconds since Instagram's epoch (2011-08-24 21:07:01.721 UTC), followed by 13 bits of shard ID and 10 bits of sequence, so media_id >> 23 plus 1314220021721 gives the post's creation time in Unix milliseconds. Media IDs longer than 19 digits, with a _<user_id> suffix, are the same ID with the owner appended: drop the suffix before converting.
  • v1, v2 and v3 return the same ID; v1 is the cheapest.

Pricing

$0.002 per successful call. Failed calls, including lookups whose target does not exist, are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
Instagram$0.002 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.008 每次调用JSON
Instagram$0.002 每次调用JSON
Instagram$0.008 每次调用JSON

指南:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared

问题

常见问题

如何使用 Instagram Shortcode to Media ID (V3) API?

向 https://api.sandbase.ai/v1/api/instagram/v3/shortcode-to-media-id 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

Instagram Shortcode to Media ID (V3) API 的价格是多少?

每次调用 $0.002,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

Instagram Shortcode to Media ID (V3) API 接受哪些参数?

必填:shortcode (string)。 Parameters 表和本页的 Playground 列出了每个字段。

Instagram Shortcode to Media ID (V3) API 返回什么?

在同一个 HTTP 请求中返回的 JSON 响应(同步)。 本页的 README 包含一个示例响应。

我需要 Instagram 开发者账户或 API key 吗?

不需要。Instagram Shortcode to Media ID (V3) 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 Instagram API 访问权限。