media_idstringจำเป็น
Post media ID (numeric ID)
https://api.sandbase.ai/v1/api/instagram/v3/media-id-to-shortcodeConverts a numeric Instagram media ID into a post shortcode for constructing web URLs. Requires the target post numeric identifier via media_id.
[
{
"data": {
"media_id": "3964706607397327650",
"shortcode": "DcFd6dMj9Mi"
}
}
]เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
Convert a numeric Instagram media ID into the post shortcode, so you can rebuild the public link https://www.instagram.com/p/<shortcode>/.
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/media-id-to-shortcode" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"media_id": "3850699893338385742"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
media_id | string | Yes | Post media ID (numeric ID) |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"media_id": "3850699893338385742",
"shortcode": "DVwbyavEa1O"
}
| Field | Meaning |
|---|---|
shortcode | Shortcode for instagram.com/p/<shortcode>/. |
media_id | The media ID you sent. |
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.$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.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v3/media-id-to-shortcode" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"media_id": "3964706607397327650"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
media_idstringจำเป็นPost media ID (numeric ID)
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"media_id": "3964706607397327650",
"shortcode": "DcFd6dMj9Mi"
}
}
]สำรวจเพิ่มเติม
| 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
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/instagram/v3/media-id-to-shortcode โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.002 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: media_id (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ
ไม่จำเป็น Instagram Media ID to Shortcode (V3) ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง Instagram API แยกต่างหาก