Disclaimer : Real Data API only extracts publicly available data while maintaining a strict policy against collecting any personal or identity-related information.
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 UAE, Canada, Australia, the UK, the USA, India, Germany, Spain, France, Italy, 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:
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.
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.
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.
Check out the Industry page section for more ideas and see how many brands already use web data scraping.
If you wish to learn about the process of Instagram Scraper working, check out the stepwise tutorial with examples.
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.
To execute the Instagram data scraper on the Real Data API platform, here are the two major factors to consider:
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.
Extracting data from one thousand profiles needs 0.24 GB proxy traffic and 10 compute units.
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.
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.
{ "search": "Niagara Falls", "searchType": "place", "searchLimit": 10, "resultsType": "posts", "resultsLimit": 100, "proxy": { "useRealdataAPIProxy": true, "RealdataAPIProxyGroups": ["RESIDENTIAL"] } }
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.
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.
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" }
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" }
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": [], }
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 }, // ... ] }
Below is the example structure of every Instagram place information.
{ "#debug": { "url": "https://www.instagram.com/explore/locations/1017812091/namesti-miru/" }, "id": "1017812091", "name": "Náměstí Míru", "public": true, "lat": 50.0753325, "lng": 14.43769, "slug": "namesti-miru", "description": "", "website": "", "phone": "", "aliasOnFacebook": "", "addressStreetAddress": "", "addressZipCode": "", "addressCityName": "Prague, Czech Republic", "addressRegionName": "", "addressCountryCode": "CZ", "addressExactCityMatch": false, "addressExactRegionMatch": false, "addressExactCountryMatch": false, "profilePicUrl": "https://scontent-ort2-2.cdninstagram.com/vp/aa8cc8c627cbddf3df270747223f5f23/5D68CDEA/t51.2885-15/e35/s150x150/57561454_2452560724777787_307886881124344332_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com", "postsCount": 5310, "topPosts": [ { "type": "Image", "shortCode": "Bw6lVVZhXXB", "caption": "🦋🦋🦋", "commentsCount": 3, "dimensionsHeight": 750, "dimensionsWidth": 750, "displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/03de7e9343f98fdf47513a0a944c427f/5D6656A8/t51.2885-15/e35/57561454_2452560724777787_307886881124344332_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com", "likesCount": 345, "timestamp": "2019-05-01T09:45:20.000Z", "locationName": null }, // ... ], "latestPosts": [ { "type": "Image", "shortCode": "Bw9KSlIhAc-", "caption": "#vinohradskaprincezna #nekdotomusikontrolovat #jestezememaji #jmenujusebufinka 🐶", "commentsCount": 0, "dimensionsHeight": 1080, "dimensionsWidth": 1080, "displayUrl": "https://scontent-ort2-2.cdninstagram.com/vp/0fa17a87dee94c0c63c8973c6c0677eb/5D59EE21/t51.2885-15/e35/57506136_399700847249384_6385808161520210872_n.jpg?_nc_ht=scontent-ort2-2.cdninstagram.com", "likesCount": 4546, "timestamp": "2019-05-02T09:46:45.000Z", "locationName": null }, // ... ] }
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": [] }
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.
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 token
const client = new RealdataAPIClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare Actor input
const 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 finish
const 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)
# Set API token
API_TOKEN=<YOUR_API_TOKEN>
# Prepare Actor input
cat > input.json <<'EOF'
{
"directUrls": [
"https://www.instagram.com/humansofny/"
],
"resultsType": "details",
"resultsLimit": 200,
"searchType": "hashtag",
"searchLimit": 1,
"extendOutputFunction": "async ({ data, item, helpers, page, customData, label }) => {/n return item;/n}",
"extendScraperFunction": "async ({ page, request, label, response, helpers, requestQueue, logins, addProfile, addPost, addLocation, addHashtag, doRequest, customData, RealdataAPI }) => {/n /n}",
"customData": {}
}
EOF
# Run the actor
curl "https://api.RealdataAPI.com/v2/acts/RealdataAPI~instagram-scraper/runs?token=$API_TOKEN" /
-X POST /
-d @input.json /
-H 'Content-Type: application/json'
directUrls
Optional Array
Enter multiple Instagram links to scrape data.
resultsType
Optional 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.
comments
,posts
,details
resultsLimit
Optional 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
Optional 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.
searchType
Optional String
Type of Instagram pages to search like profiles, hashtags, or places.
hashtag
,user
,place
searchLimit
Optional Integer
The search result count for profiles, hashtags, or profiles you want the scraper to process with.
scrapePostsUntilDate
Optional 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.
fromDate
Optional 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.
untilDate
Optional 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
Required 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.
maxRequestRetries
Optional Integer
If the scraper gives errors or the source blocks it, choose the count of retries the scraper will attempt to scrape the page.
extendOutputFunction
Optional String
Insert or delete output object properties or remove the result returning blank.
extendScraperFunction
Optional 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.
customData
Optional Object
Any customized data you need in the extend scraper or output function.
{
"directUrls": [
"https://www.instagram.com/humansofny/"
],
"resultsType": "details",
"resultsLimit": 200,
"searchType": "hashtag",
"searchLimit": 1,
"extendOutputFunction": "async ({ data, item, helpers, page, customData, label }) => {/n return item;/n}",
"extendScraperFunction": "async ({ page, request, label, response, helpers, requestQueue, logins, addProfile, addPost, addLocation, addHashtag, doRequest, customData, RealdataAPI }) => {/n /n}",
"customData": {}
}