YepAPI
Instagram API

User Posts

Get recent posts from an Instagram user's profile.

POST/v1/instagram/user-posts
$0.01/call

Usage

const res = await fetch('https://api.yepapi.com/v1/instagram/user-posts', {
  method: 'POST',
  headers: {
    'x-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ username: 'natgeo' }),
});
const { data } = await res.json();
console.log(data);
curl -X POST https://api.yepapi.com/v1/instagram/user-posts \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"username": "natgeo"}'

Request Body

ParameterTypeRequiredDescriptionDefault
usernamestringYesInstagram username
end_cursorstringNoPagination cursor from previous response

Response

{
  "ok": true,
  "data": {
    "has_next_page": true,
    "end_cursor": "QVFDcE...",
    "posts": [
      {
        "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/...",
        "thumbnail_url": "https://scontent.cdninstagram.com/...",
        "is_video": false,
        "video_view_count": null,
        "accessibility_caption": "Photo of desert landscape at sunset"
      }
    ]
  }
}

Response Fields

FieldTypeDescription
okbooleanWhether the request succeeded
data.has_next_pagebooleanWhether more posts are available
data.end_cursorstringCursor for fetching the next page
data.postsobject[]Array of post objects
data.posts[].idstringUnique post identifier
data.posts[].shortcodestringPost shortcode (used in URLs)
data.posts[].typestringPost type: GraphImage, GraphVideo, or GraphSidecar
data.posts[].captionstringPost caption text
data.posts[].like_countnumberNumber of likes
data.posts[].comment_countnumberNumber of comments
data.posts[].taken_atnumberUnix timestamp of when the post was published
data.posts[].display_urlstringFull-size image URL
data.posts[].is_videobooleanWhether the post is a video
data.posts[].video_view_countnumber|nullVideo view count (null for images)

Use the end_cursor value from the response as the end_cursor parameter to fetch the next page of posts.

On this page