Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

Instagram Shortcode to Media ID (V2)

เอกสาร API
https://api.sandbase.ai/v1/api/instagram/v2/shortcode-to-media-id

Converts an Instagram post shortcode into its numeric media ID. Provide the shortcode extracted from a post URL to receive the corresponding media identifier.

ราคา
$0.002USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
1 จำเป็น · 0 ไม่บังคับ

Playground

อินพุต
Post shortcode
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

Instagram Shortcode to Media ID (V2) 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/v2/shortcode-to-media-id" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"shortcode": "DRhvwVLAHAG"}'

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": "3774507992167247878",
  "shortcode": "DRhvwVLAHAG",
  "status": true
}

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.002 ต่อการเรียกJSON
Instagram$0.002 ต่อการเรียกJSON
Instagram$0.002 ต่อการเรียกJSON
Instagram$0.002 ต่อการเรียกJSON
Instagram$0.002 ต่อการเรียกJSON

คู่มือ:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ Instagram Shortcode to Media ID (V2) API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/instagram/v2/shortcode-to-media-id โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

Instagram Shortcode to Media ID (V2) API ราคาเท่าไร?

$0.002 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

Instagram Shortcode to Media ID (V2) API รับพารามิเตอร์อะไรบ้าง?

ที่ต้องระบุ: shortcode (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

Instagram Shortcode to Media ID (V2) API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ Instagram ไหม?

ไม่จำเป็น Instagram Shortcode to Media ID (V2) ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Instagram API แยกต่างหาก