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

Instagram Media ID to Shortcode (V3)

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

Converts a numeric Instagram media ID into a post shortcode for constructing web URLs. Requires the target post numeric identifier via media_id.

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

Playground

อินพุต
Post media ID (numeric ID)
เอาต์พุตตัวอย่าง
การตอบกลับoutputs · 105 B · 8 บรรทัด
[
  {
    "data": {
      "media_id": "3964706607397327650",
      "shortcode": "DcFd6dMj9Mi"
    }
  }
]

ตัวอย่าง

เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground

API README

Instagram Media ID to Shortcode (V3) API

Convert a numeric Instagram media ID into the post shortcode, so you can rebuild the public link https://www.instagram.com/p/<shortcode>/.

Use cases

  • Build clickable post links for media IDs returned by comment, tag or analytics APIs.
  • Store posts by ID and render links only when needed.

Request

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.

Parameters

NameTypeRequiredDescription
media_idstringYesPost media ID (numeric ID)

Example response

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

{
  "media_id": "3850699893338385742",
  "shortcode": "DVwbyavEa1O"
}

Response fields

FieldMeaning
shortcodeShortcode for instagram.com/p/<shortcode>/.
media_idThe media ID 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.
  • Same result as the v1 and v2 versions; 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 Media ID to Shortcode (V3) API ได้อย่างไร?

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

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

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

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

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

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

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

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

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