Instagram API
Post Details
Get full details for an Instagram post by its shortcode.
POST
$0.01/call/v1/instagram/postUsage
const res = await fetch('https://api.yepapi.com/v1/instagram/post', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ shortcode: 'C5xAbCdEfGh' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/instagram/post \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"shortcode": "C5xAbCdEfGh"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
shortcode | string | Yes | Post shortcode from the Instagram URL | — |
Response
{
"ok": true,
"data": {
"id": "3456789012345678901",
"shortcode": "C5xAbCdEfGh",
"type": "GraphImage",
"caption": "A stunning sunset over the Sahara Desert. Photo by @photographer_name",
"like_count": 450000,
"comment_count": 1200,
"taken_at": 1712345678,
"display_url": "https://scontent.cdninstagram.com/...",
"is_video": false,
"video_url": null,
"video_view_count": null,
"video_duration": null,
"owner": {
"id": "787132",
"username": "natgeo",
"full_name": "National Geographic",
"profile_pic_url": "https://scontent.cdninstagram.com/...",
"is_verified": true
},
"location": {
"name": "Sahara Desert",
"lat": 23.4162,
"lng": 25.6628
},
"tagged_users": [
{
"username": "photographer_name",
"full_name": "John Photographer"
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.id | string | Unique post identifier |
data.shortcode | string | Post shortcode |
data.type | string | Post type: GraphImage, GraphVideo, or GraphSidecar |
data.caption | string | Post caption text |
data.like_count | number | Number of likes |
data.comment_count | number | Number of comments |
data.taken_at | number | Unix timestamp of when the post was published |
data.display_url | string | Full-size image URL |
data.is_video | boolean | Whether the post is a video |
data.video_url | string|null | Video URL (null for images) |
data.video_view_count | number|null | Video view count (null for images) |
data.owner | object | Post author information |
data.location | object|null | Tagged location (if any) |
data.tagged_users | object[] | Users tagged in the post |
The shortcode is the unique identifier found in Instagram post URLs: https://www.instagram.com/p/{shortcode}/