Support needed? Reach out! 📧

Instagram Posts API

Access Instagram posts and media for content analysis, trend spotting, and social media strategy.

python-logo Python
Instagram User Posts
1 import requests
2  
3 root = "https://ensembledata.com/apis"
4 endpoint = "/instagram/user/posts"
5 params = {
6   "user_id"18428658,
7   "depth"1,
8   "oldest_timestamp"1666262030,
9   "chunk_size"10,
10   "start_cursor""",
11   "alternative_method"False,
12   "token""YOUR-TOKEN-HERE"
13 }
14  
15 res = requests.get(root+endpoint, params=params)
16 print(res.json())
17  

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

Scrape Instagram Data Effortlessly

Explore Instagram user posts to identify trending content and analyze audience engagement.

deco-icon

Plug & Play API

Integrate in minutes with clear docs and code samples. Get started with a single REST call.

deco-icon

Real-Time Results

Every request scrapes the latest data in seconds. No stale datasets, just up-to-date insights.

deco-icon

Flexible APIs

Need something special? We tailor endpoints and data delivery to your unique business needs.

Instagram Scraping Features

Discover user-generated content on Instagram for trend analysis and social media strategy enhancement.

  • Instagram Posts Scraper
  • Media Content Analysis
  • Trend Spotting
  • Audience Engagement
  • User-Generated Content
  • Social Media Strategy
  • Instagram media analytics
  • Hashtag performance tracking

Starting crawling Instagram now!

deco-icon

Get Your API Key in Minutes

Create a free account (no credit card required) and receive an API token instantly to test endpoints, pull live data, and rapidly prototype integrations. Upgrade as your needs grow.

Get started free
deco-icon

Developer Support

Need help integrating or customizing data for your workflows? Our developer success team offers onboarding, guidance, and enterprise support to get your project production-ready.

Contact us

Frequently Asked Questions

A Instagram data scraping API allows you to programmatically collect and analyze public data from Instagram and other platforms. This helps businesses, researchers, and marketers gain insights, monitor trends, and automate data collection for various use cases.

Our API only accesses publicly available Instagram data in compliance with GDPR and other privacy regulations. We do not support scraping private or restricted content, ensuring ethical and legal data usage for all clients.

Our API is designed to be easy to use for both developers and non-developers. We provide clear documentation, code samples, and a user-friendly dashboard to help you get started quickly, even if you have limited technical experience.

You can extract a wide range of public data from Instagram, including user profiles, posts, videos, comments, hashtags, followers, and engagement statistics.

Our platform delivers real-time Instagram data with high reliability and minimal downtime. Most requests are processed in under 5 seconds, ensuring you always have access to the latest public Instagram data for your needs.