Instagram Media ID API
Convert Instagram shortcode to numeric media ID. Utility endpoint from $0.01/call.
Convert an Instagram post shortcode to its numeric media ID. Useful for integrating with other Instagram APIs that require numeric IDs.
Try it live
Fill in the fields and hit Run to see a real response.
{
"ok": true,
"data": {
"shortcode": "CxYzAbCdEf",
"media_id": "3123456789012345678"
}
}Features
Takes a post shortcode (such as CxYzAbCdEf) and returns its numeric media_id (such as 3123456789012345678), bridging the two ways Instagram identifies a post.
The conversion is a single fast call with no pagination or media payload — just the identifier you asked for, returned immediately.
A focused helper endpoint with one input and one output, designed to slot into pipelines that need numeric IDs rather than shortcodes.
Use cases
API Integration
Convert shortcodes to numeric IDs for use with other Instagram APIs.
Data Normalization
Normalize Instagram identifiers across different data sources.
Quick start
Copy this snippet and start making calls.
const res = await fetch('https://api.yepapi.com/v1/instagram/media-id', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"shortcode": "CxYzAbCdEf"
}),
});
const data = await res.json();
console.log(data);Convert an Instagram shortcode to its numeric media ID
The YepAPI Instagram Media ID API converts a post shortcode — the CxYzAbCdEf string from a post URL — into the numeric media_id Instagram uses internally, like 3123456789012345678. A POST to /v1/instagram/media-id returns that ID instantly, bridging the human-readable and machine identifiers for the same post.
It is the glue utility of the YepAPI Instagram suite. The Post, Comments, and Likers endpoints accept shortcodes, but other systems and integrations often require numeric IDs — this endpoint reconciles the two. One key also covers TikTok, YouTube, SEO, and AI endpoints, so a normalization step you add here works inside any wider data pipeline.
What is an Instagram media ID API?
An Instagram media ID API converts between Instagram's two identifiers for a single post: the shortcode that appears in its URL, and the long numeric media ID used internally and by many integrations. You send {"shortcode": "CxYzAbCdEf"} and receive {"media_id": "3123456789012345678"}. There is no media or engagement data — it is a deterministic identifier lookup. It exists because the human-facing shortcode and the system-facing numeric ID are not the same string, and crossing between them by hand is error-prone. This endpoint does that conversion reliably.
Build Instagram ID conversion into your pipeline
Drop the Media ID endpoint into any workflow that collects shortcodes from URLs but needs numeric IDs downstream — normalizing identifiers across data sources, matching records between systems, or feeding tools that key on the numeric form. Because it is a single deterministic call, it slots cleanly into ETL jobs and ingestion pipelines. Use it ahead of any integration that expects numeric media IDs, then continue with the YepAPI Post or Comments endpoints, which take the shortcode directly.
Instagram Media ID API pricing — $0.01 per call
Each conversion is a flat $0.01, the same as every other YepAPI endpoint, with no minimums. Even normalizing tens of thousands of identifiers stays affordable, and the spend shares one balance with your other calls. You pay per conversion only, so an ID-normalization step adds negligible cost to a pipeline that is already pulling richer Instagram data.
A conversion the official API leaves to you
Instagram's official Graph API works in numeric media IDs and provides no public helper to derive one from a shortcode you found in a URL — you are left to reverse-engineer the encoding yourself. The YepAPI Media ID API performs that conversion as a reliable, supported call, so you can take any public post URL and turn it into the numeric ID downstream systems expect, without writing fragile decoding logic.
Try the Instagram Media ID API free
Sign up for $5 in free credit, no card required. That is 500 conversions — more than enough to wire shortcode-to-media-ID normalization into your pipeline before you pay anything.
Start making API calls in 30 seconds
$5 free credit on signup. No credit card required. Pay per call.
What developers say
“Switched from SerpAPI and cut our SERP costs by 80%. Same data quality, way simpler billing.”
“One API key for AI models, SERP data, and web scraping. Saved us from managing 4 separate providers.”
“The $5 free credit let us prototype our entire rank tracking feature before committing. No other API does that.”
Frequently asked questions
Convert an Instagram post shortcode to its numeric media ID. Useful for integrating with other Instagram APIs that require numeric IDs.
Each API call costs $0.01. No monthly minimums or subscriptions — you only pay for what you use.
Sign up for a free API key, then send a POST request to /v1/instagram/media-id. Check the code example above for a ready-to-use snippet in JavaScript, cURL, or Python.
YepAPI bundles SEO, AI, and web scraping APIs under one key with no monthly minimums. You get lower per-call pricing, a unified dashboard, and one billing account instead of managing multiple providers.
Ready to integrate?
Get your API key and start making calls in 30 seconds. $5 free credit on signup — no credit card required.
More instagram api endpoints
Search
$0.01Search Instagram users, hashtags, and places. Discovery and research from $0.01/call.
User
$0.01Get Instagram user profiles — followers, bio, posts count, and verification from $0.01/call.
User About
$0.01Get extended Instagram user info — account category, contact details, and business info from $0.01/call.