Support needed? Reach out! 📧

How to scrape Instagram User Posts And Media

This tutorial shows how to use Instagram User Posts And Media API to scrape and crawl structured Instagram data in real-time.
Extract full Instagram post feeds for any public account including captions, media URLs, like counts, and comment totals, useful for content benchmarking and competitive research.

Access Instagram Data in 3 Steps

Start crawling Instagram user posts data. Follow these steps to extract social media data in minutes.

1

Create Your Account

Go to our registration page and make an account. It's free, no credit card, and you get credits right away to play around with.

2

Verify Your Email Address

You'll get a verification email, click the link in it. Once that's done, you can grab your API token from the dashboard.

3

Make Your First API Call

Copy the code snippet below, swap in your API key, and run it. You'll get Instagram data back as JSON within a few seconds.

Code Sample

Here's a JavaScript example to get you going. Swap out the token and you're good, works the same way in any language that can make HTTP requests. Start collecting user posts data via our REST API!

javascript-logo JavaScript
Instagram User Posts
1 const root = 'https://ensembledata.com/apis'
2 const endpoint = '/instagram/user/posts'
3 const params = {
4   "user_id"18428658,
5   "depth"1,
6   "oldest_timestamp"1666262030,
7   "chunk_size"10,
8   "start_cursor""",
9   "alternative_method": false,
10   "token""YOUR-TOKEN-HERE"
11 }
12  
13 const queryString = new URLSearchParams(params).toString();
14 const url = `${root}${endpoint}?${queryString}`;
15  
16 await fetch(url)
17   .then(response => response.json())
18   .then(data => console.log(data))
19   .catch(error => console.error(error));
20  

Parameters

user_id (integer) ID of the user. REQUIRED
depth (integer) Abstraction of the API pagination. Depth 1 returns X results, depth N returns N * X results. Note that the exact number of results per depth (X) may differ per endpoint. Please refer to the specific endpoint description for more information. REQUIRED
oldest_timestamp (integer) This parameter is used as a stopping condition for fetching posts. If a post older than the provided `oldest_timestamp` is found, the system will stop fetching posts and return the results. For instance, if depth is 10, the system will aim to send 10 requests. However, if an `oldest_timestamp` is set, and we find a post which is older than the `oldest_timestamp`, the system will not send any more requests and return the results. Note: we do not filter out posts older than the provided `oldest_timestamp` before returning the results. Please do this filtering in your own integration if required.
chunk_size (integer) The number of posts to fetch per depth. If alternative_method=False, the maximum allowed chunk_size is 20. If alternative_method=True, the maximum chunk_size is 12.
start_cursor (string) Parameter to manually handle pagination. Each response contains a `last_cursor` which can be used to retrieve the next page of results by sending it as the next `start_cursor`. If the `last_cursor` is not present in the response, it means that there are no more results to retrieve.
alternative_method (boolean) If true, use a different method to fetch the user posts from the ID (this method returns at least 1 non pinned post when `start_cursor` is an empty string). The response JSON will be differ from the default method.
token (string) Private token assigned to each client to access the APIs. REQUIRED

Fetch Instagram Data at Scale

Collect Instagram posts in bulk for trend analysis, content benchmarking, or building datasets for academic or industry research.

deco-icon

Quick Integration

Connect in minutes using our REST endpoints or ready-made SDKs. One API call is all you need to crawl data.

deco-icon

Live Data Delivery

Retrieve fresh, up-to-the-minute data with every request. No cached or outdated datasets, always real-time accuracy.

deco-icon

Custom Solutions

Tailor API parameters, output formats, and delivery schedules to match your specific business intelligence requirements.

What You Can Scrape from Instagram

  • Scrape Instagram Posts From Username
  • Instagram Post Data Api Python
  • Get All Instagram Posts Programmatically
  • Extract Instagram Captions And Media Urls
  • Instagram Post History Api No Login
  • Instagram Feed Scraper Tutorial
  • Bulk Instagram Content Extraction Tool
  • Instagram Post Engagement Data Api

Frequently Asked Questions

Our Instagram user posts API lets you send simple REST requests to extract structured public data from Instagram in real time. You provide parameters such as keywords, usernames, or hashtags, and the API returns clean JSON responses ready for analysis, reporting, or integration into your applications.

Yes. EnsembleData only collects publicly available Instagram data and operates in full compliance with GDPR and applicable data privacy laws. We never access private accounts or restricted content, so your data collection workflows remain ethical and lawful.

The API supports extracting a wide range of public Instagram data, including user profiles, posts, videos, comments, likes, shares, hashtags, follower counts, engagement metrics, and trending content; all returned as structured JSON for easy processing.

Responses are returned in real time, typically within 2–4 seconds per request. Our infrastructure maintains 99.9%+ uptime with automatic failover, ensuring you always receive fresh, up-to-date Instagram data whenever you need it.

Yes. You can sign up for a free account, no credit card required, and receive API credits to test any endpoint immediately. This lets you validate data quality and integration before committing to a paid plan that scales with your usage.