Instagram Scraper - Scrape Instagram Posts, Hashtags, and Photos
RealdataAPI / instagram-scraper
Extract and save Instagram places, posts, hashtags, comments, and photos. Supports URL lists and search questions. Download the scraped data as an RSS feed, XML, CSV, JSON file, or HTML table. Use our scraper in Australia, Canada, Germany, France, Singapore, USA, UK, UAE, and India and more.
Instagram Scraper permits you to crawl Instagram posts from hashtags pages, user profiles, or locations. If you provide an Instagram post link in the input, it can also extract comments for that post.
Instagram Scraper is an unofficial API that we have designed to give you the functionality to access deleted public data from the Instagram API in the past. Further, it allows anyone to collect public data from the platform without restricting their account type.
This Instagram Scraper has the following features:
Extract Profiles - you can scrape Instagram posts or metadata from the required user profile.
Extract Locations - the scraper allows you to extract metadata or post from any location for a specific search query.
Extract Hashtags - you can scrape metadata or post from any hashtag for a specific search keyword.
Extract Comments - the scraper allows you to extract comments from Instagram posts.
Do You Want to Scrape Only Instagram Profiles, Hashtags, Comments, or Posts?
We have dedicated Instagram scrapers to collect specific data. You can use them instead of a universal Instagram Scraper to get quick results. To use them, just feed the URL or username and tap on the scrape option.
Do you need anything different with specific customization?
You can try our Instagram API Scraper with customization if you still need to get everything you expect from Instagram Scraper. Or you can contact us if you need a more custom solution for Instagram data scraping.
Why Scrape data from Instagram?
As the platform has over 1 billion active users, especially youth, most brands need help to reach out. With these many active Instagram users, you'll get valuable data.
Here are a few ideas to use the scraped data using Instagram Scraper.
Get location-based data to find risks or opportunities impacting your business decisions or investment.
Extract likes and hashtags to check what is trending. To take advantage of short-term popularities, you can create a niche product.
Extract Instagram comments to learn how your audiences see your business or brand.
Search influencers on Instagram who can help share your products on their account and monitor user engagement.
Perform academic or market research that goes beyond pools and surveys.
Compile an updated dataset on your interests, city, or industry to gain ongoing change insights.
Check out the Industry page section for more ideas and see how many brands already use web data scraping.
How can I use Instagram Scraper?
If you wish to learn about the process of Instagram Scraper working, check out the stepwise tutorial with examples.
Can I Scrape Instagram Data Legally?
Our Instagram Scraper has an ethical algorithm that doesn't extract personal data like gender, email address, or location. This Scraper only collects publically accessible Instagram data. Hence, we believe that our scraper is safe to use. But you may get some private data in your results by mistake. Regulations like GDPR protects personal data in the world. You can't extract any private information without genuine reason. If unsure whether you have a simple objective to Scrape personal data, you must consult your lawyer before scraping it.
Usage Cost
To execute the Instagram data scraper on the Real Data API platform, here are the two major factors to consider:
Compute Unit Consumption: scraper consumes them during execution.
Traffic Proxy Server Traffic: you need to use it while sending scraping requests to Instagram.
Depending on the page type you are scraping from Instagram, the cost of scraper usage varies. There are a few pages you just need to open, like details, and a few pages you need to scroll down, like comments on the post. You must compare how much time it will consume to do these actions manually and learn how to transfer utilization costs from case to case.
What is the cost of usage to scrape an Instagram profile?
Extracting data from one thousand profiles needs 0.24 GB proxy traffic and 10 compute units.
Sample Pricing
With the Real Data API pricing, scraping data from one thousand profiles will cost 0.24 GB * 12.5 USD + 10 CU * 0.25 USD which totals 5.5 USD. The personal plan of 49 USD on our platform allows you to extract nine thousand profiles monthly from Instagram.
Input Parameters of Instagram Scraper
You should feed the list of Instagram pages in the JSON format to visit on Instagram. Here is the example input tab with the list.
During the execution, the scraper will send you output messages to share which page scrapes from the platform. Every alert message includes a short label mentioning which page the scraper is crawling. You must see the message after loading page items with total and loaded item counts. If you submit the wrong input to the Instagram Scraper, it will instantly fail to run and display the reason for failure.
Output Format of Instagram Scraper
The scraper stores its outputs in a formatted dataset. Every data item is unique in it.
You can get the output in any coding language like PHP, Python, NPM, or Node.js. To learn more about how to get results, check the API reference.
Scraped Posts from Instagram
While scrolling Instagram lists, you'll see the structure of the items in the following format.
{
"#debug": {
"pageType": "user",
"id": "teslamotors",
"userId": "297604134",
"userUsername": "teslamotors",
"userFullName": "Tesla",
"limit": 1000000,
"scrollWaitSecs": 0,
"shortcode": "B27C4aRBfet",
"postLocationId": null,
"postOwnerId": "297604134"
},
"queryUsername": "teslamotors",
"position": 10,
"type": "Image",
"shortCode": "B27C4aRBfet",
"caption": "@hub3rt picked up his Model 3 and brought our London team a cake. /nIf there is a purer thing in this world we would like to hear about it.",
"hashtags": [],
"mentions": [
"hub3rt"
],
"url": "https://www.instagram.com/p/B27C4aRBfet",
"commentsCount": 926,
"latestComments": [],
"dimensionsHeight": 1080,
"dimensionsWidth": 1080,
"displayUrl": "https://instagram.fyyc3-1.fna.fbcdn.net/v/t51.2885-15/e35/70538312_1124483511275040_7970075346943975868_n.jpg?_nc_ht=instagram.fyyc3-1.fna.fbcdn.net&_nc_cat=100&_nc_ohc=UBV8F4hhd_AAX_INMgA&oh=be328b96f1ad3fbb95b54a35b8b0eb79&oe=5F0D6E0E",
"id": "2142318720331413421",
"alt": "Photo by Tesla on September 27, 2019. Image may contain: one or more people, people standing and car",
"likesCount": 181500,
"timestamp": "2019-09-27T17:11:54.000Z",
"locationName": null,
"locationId": null,
"ownerUsername": "teslamotors",
"ownerId": "297604134"
}
Scraped Comments from Instagram
Below is the example structure of every Instagram comment item.
{
"#debug": {
"index": 1,
"pageType": "post",
"id": "BwrsO1Bho2N",
"postCommentsDisabled": false,
"postIsVideo": false,
"postVideoViewCount": 0,
"postVideoDurationSecs": 0
},
"id": "17900515570488496",
"postId": "BwrsO1Bho2N",
"text": "When is Tesla going to make boats? It was so nice to see clear water in Venice during the covid lockdown!",
"position": 1,
"timestamp": "2020-06-07T12:54:20.000Z",
"ownerId": "5319127183",
"ownerIsVerified": false,
"ownerUsername": "mauricepaoletti",
"ownerProfilePicUrl": "https://scontent-lhr8-1.cdninstagram.com/v/t51.2885-19/s150x150/84630643_482577542360727_932647097444859904_n.jpg?_nc_ht=scontent-lhr8-1.cdninstagram.com&_nc_ohc=B3lQcy6UHX4AX8RjJKN&oh=1df825b662e1f1412eb21fc581c5db75&oe=5F0A760B"
}
Scraped User Profiles from Instagram
Below is the example structure of every Instagram user profile.
{
"#debug": {
"url": "https://www.instagram.com/avengers/"
},
"id": "6622284809",
"username": "avengers",
"fullName": "Avengers: Endgame",
"biography": "Marvel Studios’ /"Avengers: Endgame” is now playing in theaters.",
"externalUrl": "http://www.fandango.com/avengersendgame",
"externalUrlShimmed": "https://l.instagram.com/?u=http%3A%2F%2Fwww.fandango.com%2Favengersendgame&e=ATNWJ4avEN0vwSx1YQCqQqFJst7aAFzINa-BzGZLoTVrdC6sTRTmjM9QNgWKR3URJHMxwg9x",
"followersCount": 8212505,
"followsCount": 4,
"hasChannel": false,
"highlightReelCount": 3,
"isBusinessAccount": true,
"joinedRecently": false,
"businessCategoryName": "Content & Apps",
"private": false,
"verified": true,
"profilePicUrl": "https://scontent-ort2-2.cdninstagram.com/vp/eaea4675dc1e937f3b449dba21ac3867/5D5DF0E0/t51.2885-19/s150x150/54446499_2222190077828037_3317168817985028096_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"profilePicUrlHD": "https://scontent-ort2-2.cdninstagram.com/vp/38a36006532165263f0d82c32de1d0ce/5D767E98/t51.2885-19/s320x320/54446499_2222190077828037_3317168817985028096_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"facebookPage": null,
"igtvVideoCount": 5,
"latestIgtvVideos": [
{
"type": "Video",
"shortCode": "Bwr3OkpnZZ5",
"title": "Marvel Studios’ Avengers: Endgame | “Don’t Do It”",
"caption": "Don’t do it. #DontSpoilTheEndgame",
"commentsCount": 115,
"commentsDisabled": false,
"dimensionsHeight": 1333,
"dimensionsWidth": 750,
"displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/1c063ea4ff0e4768a852411c74470bae/5CCD7FE3/t51.2885-15/e35/58684999_167806787545179_7836940807335402934_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"likesCount": 123,
"videoDuration": 21.688,
"videoViewCount": 77426
},
// ...
],
"postsCount": 274,
"latestPosts": [
{
"type": "Video",
"shortCode": "Bw7jACTn3tC",
"caption": "“We need to take a stand.” Marvel Studios’ #AvengersEndgame is in theaters now. Get tickets: [link in bio]",
"commentsCount": 1045,
"dimensionsHeight": 750,
"dimensionsWidth": 750,
"displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/c336cf708e62596cd46879656f86ad70/5CCD112C/t51.2885-15/e35/57649006_653609661751971_8438348841277997450_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"likesCount": 142707,
"videoViewCount": 482810,
"timestamp": "2019-05-01T18:44:12.000Z",
"locationName": null
},
// ...
],
"following": [],
"followedBy": [],
}
Scraped Hashtags from Instagram
Below is the example structure of every Instagram hashtag detail.
{
"#debug": {
"url": "https://www.instagram.com/explore/tags/endgame/"
},
"id": "17843854051054595",
"name": "endgame",
"topPostsOnly": false,
"profilePicUrl": "https://scontent-ort2-2.cdninstagram.com/vp/c3074c4492e7594fdd330ff8b81cf724/5D558BBC/t51.2885-15/e15/s150x150/58410922_577374706107933_1468173581283089454_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"postsCount": 1510549,
"topPosts": [
{
"type": "Image",
"shortCode": "Bw9UYRrhxfl",
"caption": "Here is the second part😂😂 Find the first part on the page/nGuess the pictures😏/n-/n-/n-/n#marvel #mcu #dceu #worldofdc #endgame #superhero #superheros #infinitywar #batman #superman #wonderwoman #iroman #captainamerica #thor #thanos #memes #news #dc #dcuniverse #power #funny #fun" "@marvel",
"hashtags": ["marvel", "mcu", "etc..."],
"mentions": ["marvel"],
"commentsCount": 9,
"dimensionsHeight": 1326,
"dimensionsWidth": 1080,
"displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/4d67498d0bc033cbfdf8b666d0fce6d1/5D629B3E/t51.2885-15/e35/57216878_2119889691397544_8022105877563047858_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"likesCount": 2342,
"timestamp": "2019-05-02T11:14:55.000Z",
"locationName": null
},
// ...
],
"latestPosts": [
{
"type": "Sidecar",
"shortCode": "Bw9flNKl56O",
"caption": "Mínimo lo se mi tributo a semejante peli pero bue algo quería hacer me llore la vidaaaaa #endgame #avengersendgame #avengers #thanos #ironman #hulk #thor #makeupcomic #makeup #moviemakeup #makeupeyes #makeupfantasy #makeupavengers #makeuphero",
"commentsCount": 0,
"dimensionsHeight": 936,
"dimensionsWidth": 1080,
"displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/d97b7e434dbbb4141552c9af9c8fb05b/5D5F34FD/t51.2885-15/e35/58087917_2268263940082789_7711745336102849043_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com",
"likesCount": 12312,
"timestamp": "2019-05-02T12:52:48.000Z",
"locationName": null
},
// ...
]
}
Scraped Places Data from Instagram
Below is the example structure of every Instagram place information.
Below is the example structure of every Instagram post's details.
{
"#debug": {
"requestId": "YCyUc93vUGzK9eA",
"url": "https://www.instagram.com/p/BwrsO1Bho2N",
"loadedUrl": "https://www.instagram.com/p/BwrsO1Bho2N/",
"method": "GET",
"retryCount": 0,
"errorMessages": null
},
"type": "Sidecar",
"shortCode": "BwrsO1Bho2N",
"caption": "Newly upgraded Model S and X drive units rolling down the production line at Gigafactory 1 #tesla #model3 @elonmusk",
"hashtags": ["tesla", "model3"],
"mentions": ["elonmusk"],
"position": 1,
"url": "https://www.instagram.com/p/BwrsO1Bho2N",
"commentsCount": 711,
"latestComments": [
{
"ownerUsername": "mauricepaoletti",
"text": "When is Tesla going to make boats? It was so nice to see clear water in Venice during the covid lockdown!"
},
// ...
],
"dimensionsHeight": 1350,
"dimensionsWidth": 1080,
"displayUrl": "https://instagram.fist4-1.fna.fbcdn.net/v/t51.2885-15/e35/57840129_308705413159630_8358160330083042716_n.jpg?_nc_ht=instagram.fist4-1.fna.fbcdn.net&_nc_cat=110&_nc_ohc=g7JIBg70oHMAX_QGayb&oh=1402875349a6d1cd8693f14f2b617fd6&oe=5F0DBA1F",
"id": "2029910590113615245",
"firstComment": "@miszdivastatuz",
"likesCount": 153786,
"timestamp": "2019-04-25T14:57:01.000Z",
"locationName": "Tesla Gigafactory 1",
"locationId": "2172837629656184",
"ownerFullName": "Tesla",
"ownerUsername": "teslamotors",
"ownerId": "297604134",
"captionIsEdited": false,
"hasRankedComments": false,
"commentsDisabled": false,
"displayResourceUrls": [
"https://instagram.fist4-1.fna.fbcdn.net/v/t51.2885-15/e35/57840129_308705413159630_8358160330083042716_n.jpg?_nc_ht=instagram.fist4-1.fna.fbcdn.net&_nc_cat=110&_nc_ohc=g7JIBg70oHMAX_QGayb&oh=1402875349a6d1cd8693f14f2b617fd6&oe=5F0DBA1F",
"https://instagram.fist4-1.fna.fbcdn.net/v/t51.2885-15/e35/56744724_532173877312018_171181625703519178_n.jpg?_nc_ht=instagram.fist4-1.fna.fbcdn.net&_nc_cat=110&_nc_ohc=_zTxcKu_hyYAX9KtDax&oh=175f7e2fceb3f6b20f84e148baf4d9f9&oe=5F0C7535"
],
"childPosts": [
// ...
],
"locationSlug": "tesla-gigafactory-1",
"isAdvertisement": false,
"taggedUsers": [],
"likedBy": []
}
Instagram Scraper with Real Data API Integrations
Lastly, you can connect Instagram Scraper with any web application or cloud service with the help of Real Data API integrations. Many Scraper integration options include Zapier, Airbyte, Make, Slack, Google Drive, GitHub, and Google Sheets. You can also use Webhooks to commence an action in case of an event occurrence, like setting an alert once the Instagram Scraper completes the execution successfully.
Using Instagram Data Scraper with Real Data API
The Real Data API platform gives you programmatic Instagram Scraper access. We have organized the Instagram API around RESTful HTTP endpoints that allow you to schedule, manage, and execute it. The scraper also allows you to track its performance, access datasets, retrieve outputs, update or create new versions, etc.
To use the scraper using Python, try our client PyPl package, and to use it with Node.js, try our client NPM package.
You should have a Real Data API account to execute the program examples. Replace
< YOUR_API_TOKEN>
in the program using the token of your scraper. Read about the live APIs with Real Data API docs for more explanation.
import{ RealdataAPIClient }from'RealdataAPI-Client';// Initialize the RealdataAPIClient with API tokenconst client =newRealdataAPIClient({token:'<YOUR_API_TOKEN>',});// Prepare Actor inputconst input ={"directUrls":["https://www.instagram.com/humansofny/"],"resultsType":"details","resultsLimit":200,"searchType":"hashtag","searchLimit":1,"extendOutputFunction":async({ data, item, helpers, page, customData, label })=>{return item;},"extendScraperFunction":async({ page, request, label, response, helpers, requestQueue, logins, addProfile, addPost, addLocation, addHashtag, doRequest, customData, RealdataAPI })=>{},"customData":{}};(async()=>{// Run the Actor and wait for it to finishconst run =await client.actor("RealdataAPI/instagram-scraper").call(input);// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');const{ items }=await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item)=>{
console.dir(item);});})();
from RealdataAPI_client import RealdataAPIClient
# Initialize the RealdataAPIClient with your API token
client = RealdataAPIClient("<YOUR_API_TOKEN>")# Prepare the Actor input
run_input ={"directUrls":["https://www.instagram.com/humansofny/"],"resultsType":"details","resultsLimit":200,"searchType":"hashtag","searchLimit":1,"extendOutputFunction":"""async ({ data, item, helpers, page, customData, label }) => {
return item;
}""","extendScraperFunction":"""async ({ page, request, label, response, helpers, requestQueue, logins, addProfile, addPost, addLocation, addHashtag, doRequest, customData, RealdataAPI }) => {
}""","customData":{},}# Run the Actor and wait for it to finish
run = client.actor("RealdataAPI/instagram-scraper").call(run_input=run_input)# Fetch and print Actor results from the run's dataset (if there are any)for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item)
What type of data do you need to scrape from every Instagram Page?
resultsTypeOptional String
Select the data point you want to extract for every Instagram search result or URL. Ensure to choose the correct parent page depending on the URL.
Options:
comments,posts,details
Maximum Items
resultsLimitOptional Integer
The number of comments or posts you want to extract from every discovered page or URL of Instagram. If you scrape 1, you will get the output with a single Instagram post from every page. There is a separate limit to places and hashtags. The scraper will ignore when you specify the details type.
Search
searchOptional String
Specify the search term so that the scraper will use it to search Instagram for places, hashtags, or profiles. It is an optional field, but you should provide URLs or use the field.
Type of Search
searchTypeOptional String
Type of Instagram pages to search like profiles, hashtags, or places.
Options:
hashtag,user,place
Limit of Search Results
searchLimitOptional Integer
The search result count for profiles, hashtags, or profiles you want the scraper to process with.
Scrape Posts Until Date
scrapePostsUntilDateOptional String
It scrapes posts older than the provided date from the current or recent date. You must feed the date in the YYYY-MM-DD form. For instance, today. It will scrape all the Instagram posts by default.
Older than
fromDateOptional String
It scrapes posts older than the provided date from the current or recent date. You must feed the date in the YYYY-MM-DD form. For instance, today. It will scrape all the Instagram posts by default.
Newer than
untilDateOptional String
It Scrapes the Instagram posts from the submitted date to the current date. You must feed the date in the YYYY-MM-DD form. For instance, today.
Proxy Server Configuration
proxyRequired Object
To run the Instagram Scraper, you should use the proxy server. As data center proxies don't work, you must provide your proxy or use a Real Data API residential proxy.
Maximum Request Retries
maxRequestRetriesOptional Integer
If the scraper gives errors or the source blocks it, choose the count of retries the scraper will attempt to scrape the page.
Extend Output Function
extendOutputFunctionOptional String
Insert or delete output object properties or remove the result returning blank.
Extend Scraper Function
extendScraperFunctionOptional String
It is an advanced function that permits you to expand the functionality of the default scraper. Further, it allows you to perform manual actions on the required page.
Custom Data
customDataOptional Object
Any customized data you need in the extend scraper or output function.
Disclaimer : RealData API functions solely as an independent data infrastructure and technology solutions provider. We build customized automation workflows designed to collect publicly accessible web data based exclusively on client instructions. RealData API neither owns proprietary datasets nor engages in the sale or redistribution of extracted information. Our operations are limited strictly to lawful public web data processing and never involve unauthorized access to restricted systems or private networks. Any company names, trademarks, logos, or brand references displayed on this website are used purely for demonstrative and illustrative purposes to showcase our technical capabilities and do not imply endorsement, partnership, or affiliation. Use of our platform and services remains subject to our Terms of Service.