shortcodestringerforderlich
Post shortcode
https://api.sandbase.ai/v1/api/instagram/v1/shortcode-to-media-idConvert an Instagram post shortcode (from instagram.com/p/<shortcode>/) into the numeric media ID required by the Instagram post, comments and likes APIs.
[
{
"data": {
"media_id": "3904247334455780408",
"shortcode": "DYurEPdgKQ4",
"status": true
}
}
]Wählen Sie ein Beispiel aus, um seine Eingaben und das Ergebnis in den Playground zu laden.
Convert the shortcode in an Instagram post or reel link (instagram.com/p/<shortcode>/ or /reel/<shortcode>/) into the numeric media ID that the comments, likers and post-detail APIs require.
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v1/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.
| Name | Type | Required | Description |
|---|---|---|---|
shortcode | string | Yes | Post shortcode |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"media_id": "3774507992167247878",
"shortcode": "DRhvwVLAHAG",
"status": true
}
| Field | Meaning |
|---|---|
media_id | Numeric media ID as a string. Keep it as a string: it exceeds the 53-bit integer range of JavaScript. |
shortcode | The shortcode you sent. |
status | true when the conversion succeeded. |
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.001 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.
Jetzt loslegen
Plattform-API-Endpunkt mit einheitlicher Authentifizierung und Nutzungsnachverfolgung.
curl -X POST "https://api.sandbase.ai/v1/api/instagram/v1/shortcode-to-media-id" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"shortcode": "DYurEPdgKQ4"
}'Legen Sie Ihren SandBase API-Schlüssel in Ihrer Serverumgebung fest. Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie Ihren Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis.
shortcodestringerforderlichPost shortcode
Gespeicherte Beispielantwort für diese API; beim Anzeigen wird keine Live-Anfrage gesendet.
[
{
"data": {
"media_id": "3904247334455780408",
"shortcode": "DYurEPdgKQ4",
"status": true
}
}
]Mehr entdecken
| API | Preis | Antwort |
|---|---|---|
Instagram Shortcode to Media IDDiese API Instagram | $0.001 pro Aufruf | JSON |
Instagram | $0.001 pro Aufruf | JSON |
Instagram | $0.001 pro Aufruf | JSON |
Instagram | $0.001 pro Aufruf | JSON |
Instagram | $0.001 pro Aufruf | JSON |
Instagram | $0.001 pro Aufruf | JSON |
Anleitungen:Instagram API cost: official limits and per-call pricesBest Instagram API in 2026: Pricing Compared
Fragen
Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/instagram/v1/shortcode-to-media-id mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.
$0.001 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.
Erforderlich: shortcode (string). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.
Eine JSON-Antwort, die in derselben HTTP-Anfrage zurückgegeben wird (synchron). Die README auf dieser Seite enthält eine Beispielantwort.
Nein. Instagram Shortcode to Media ID läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für Instagram API beantragen.