Instagram Scraper avatar

Instagram Scraper

Try for free

Pay $2.30 for 1,000 results

View all Actors
Instagram Scraper

Instagram Scraper

apify/instagram-scraper
Try for free

Pay $2.30 for 1,000 results

Scrape and download Instagram posts, profiles, places, hashtags, photos, and comments. Get data from Instagram using one or more Instagram URLs or search queries. Export scraped data, run the scraper via API, schedule and monitor runs or integrate with other tools.

Do you want to learn more about this Actor?

Get a demo

What does Instagram Scraper do?

Instagram Scraper allows you to scrape posts from a user's profile page, hashtag page, or place. When a link to an Instagram post is provided, it can scrape Instagram comments.

This unofficial Instagram API is designed to give you back the functionality to access public data that was removed from the Instagram API in 2020. It also enables anyone to extract public data from Instagram without imposing limits on whether you are an Instagram Business or Creator, or whether you are accessing public consumer account data.

The Instagram data scraper supports the following features:

  • Scrape profiles - you can either scrape posts or get metadata from the profile.
  • Scrape hashtags - query hashtags matched by search keyword - you can either scrape posts or scrape metadata from each hashtag.
  • Scrape places/locations - query places matched by search keyword - you can either scrape posts or scrape metadata from each place.
  • Scrape comments - you can scrape comments from any post.

What are other Instagram scraping tools?

If you want to scrape specific Instagram data, you can use any of the dedicated scrapers with fewer settings to change and faster results. Just enter one or more Instagram usernames or URLs and click to scrape.

👤 Instagram Profile Scraper🎞️ Instagram Reel Scraper
#️⃣ Instagram Hashtag Scraper📷 Instagram Post Scraper
🏷️ Instagram Mentions ScraperQuick Instagram Posts Checker
👥 Instagram Followers Count Scraper💬 Instagram Comments Scraper
📊 Instagram Hashtag Stats

Why scrape Instagram?

Instagram has about 1 billion monthly active users and is especially popular with younger users, a demographic that can otherwise be difficult for brands to reach. With so many active users, you can imagine that there is a lot of useful data on the site.

So what can you do with that data? Here are some ideas:

  • Scrape hashtags and likes to see what's becoming popular. Maybe you can get involved early or create a niche product to take advantage of short-term trends.
  • Get data based on location to discover opportunities or risks that might affect your investment or business decisions.
  • Scrape comments to understand how real customers see your brand or business.
  • Find Instagram influencers who could help you promote your products, and track their engagement in real time.
  • Collect a constantly updated dataset on your industry, city, or interests and gain insights into ongoing change.
  • Carry out market or academic research that goes beyond surveys and polls.

If you want more ideas, check out our industries pages for ways web scraping is already being used in a wide range of companies.

How to use Instagram Scraper

If you want to know more about how Instagram Scraper works, here's a detailed explanation and step-by-step guide with screenshots and examples.

How many results can you scrape with Instagram scraper?

The number of results Instagram scraper can return varies heavily based on the content you want to scrape. To get an idea you can always open the required url in an incognito window in your browser (Chrome, for example) and check what Instagram shows users who are not logged in.

You have to keep in mind that scraping Instagram is dynamic and subject to change. There’s no one-size-fits-all-use-cases number. The maximum number of results may vary depending on the complexity of the input, location, and other factors.

Therefore, while we regularly run Actor tests to keep the benchmarks in check, the results may also fluctuate without our knowing. The best way to know for sure for your particular use case is to do a test run yourself.

How much will scraping Instagram cost you?

When it comes to scraping, it can be challenging to estimate the resources needed to extract data as use cases may vary significantly. That's why the best course of action is to run a test scrape with a small sample of input data and limited output. You’ll get your price per scrape, which you’ll then multiply by the number of scrapes you intend to do.

Watch this video for a few helpful tips. And don't forget that choosing a higher plan will save you money in the long run.

Our Instagram scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our scrapers, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the legality of web scraping.

Input parameters

The input of this scraper should be JSON containing the list of pages on Instagram that should be visited. Check the input tab for detailed list.

Instagram scraper input example

1{
2    "search": "Niagara Falls",
3    "searchType": "place",
4    "searchLimit": 10,
5    "resultsType": "posts",
6    "resultsLimit": 100,
7}

During the Actor run

During the run, the actor will output messages letting you know what's going on. Each message always contains a short label specifying which page from the provided list is currently being scraped. When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page, in most cases.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

Instagram output format

The actor stores its results in a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node.js/NPM). See our API reference to learn more about getting results from the Instagram Scraper.

Scraped Instagram posts

The structure of each item in Instagram posts when scrolling looks like this:

1{
2  "inputUrl": "https://www.instagram.com/humansofny",
3  "url": "https://www.instagram.com/p/C3TTthZLoQK/",
4  "type": "Image",
5  "shortCode": "C3TTthZLoQK",
6  "caption": "“Biology gives you a brain. Life turns it into a mind.” Jeffrey Eugenides\n\nCongolese Refugees\n\n#congolese #congo #drc #refugee #refugees #bw #bwphotography #sony #sonyalpha #humanity #mind",
7  "hashtags": [],
8  "mentions": [],
9  "commentsCount": 1,
10  "firstComment": "We love your posts blend ! Message us to be featured! 🔥",
11  "latestComments": [],
12  "dimensionsHeight": 720,
13  "dimensionsWidth": 1080,
14  "displayUrl": "https://scontent-lga3-2.cdninstagram.com/v/t51.2885-15/426457868_1775839306212473_2684687436495806019_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-lga3-2.cdninstagram.com&_nc_cat=105&_nc_ohc=UxY2B6TAloEAX9nHKi1&edm=AP_V10EBAAAA&ccb=7-5&oh=00_AfBSNWqMiaU24y8nOwL5sx-NC7TuvyXB6jzOXhs7oaNvHQ&oe=65D3DB7E&_nc_sid=2999b8",
15  "images": [],
16  "alt": "Photo shared by Brian René Bergeron on February 13, 2024 tagging @natgeo, @life, @people, @humansofny, @voiceofcongo, @sonyalpha, @congo_on_the_map, and @sony. May be a black-and-white image of 2 people, child and text.",
17  "likesCount": 40,
18  "timestamp": "2024-02-13T20:49:57.000Z",
19  "childPosts": [],
20  "ownerFullName": "Brian René Bergeron",
21  "ownerUsername": "blend603",
22  "ownerId": "5566937141",
23  "isSponsored": false,
24},

Scraped Instagram comments

The structure of each item in Instagram comments looks like this:

1{
2  "id": "17900515570488496",
3  "postId": "BwrsO1Bho2N",
4  "text": "When is Tesla going to make boats? It was so nice to see clear water in Venice during the covid lockdown!",
5  "position": 1,
6  "timestamp": "2020-06-07T12:54:20.000Z",
7  "ownerId": "5319127183",
8  "ownerIsVerified": false,
9  "ownerUsername": "mauricepaoletti",
10  "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"
11}

Scraped Instagram profile

The structure of each user profile looks like this:

1{
2  "id": "6622284809",
3  "username": "avengers",
4  "fullName": "Avengers: Endgame",
5  "biography": "Marvel Studios’ \"Avengers​: Endgame” is now playing in theaters.",
6  "externalUrl": "http://www.fandango.com/avengersendgame",
7  "externalUrlShimmed": "https://l.instagram.com/?u=http%3A%2F%2Fwww.fandango.com%2Favengersendgame&e=ATNWJ4avEN0vwSx1YQCqQqFJst7aAFzINa-BzGZLoTVrdC6sTRTmjM9QNgWKR3URJHMxwg9x",
8  "followersCount": 8212505,
9  "followsCount": 4,
10  "hasChannel": false,
11  "highlightReelCount": 3,
12  "isBusinessAccount": true,
13  "joinedRecently": false,
14  "businessCategoryName": "Content & Apps",
15  "private": false,
16  "verified": true,
17  "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",
18  "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",
19  "facebookPage": null,
20  "igtvVideoCount": 5,
21  "latestIgtvVideos": [
22    {
23      "type": "Video",
24      "shortCode": "Bwr3OkpnZZ5",
25      "title": "Marvel Studios’ Avengers: Endgame | “Don’t Do It”",
26      "caption": "Don’t do it. #DontSpoilTheEndgame",
27      "commentsCount": 115,
28      "commentsDisabled": false,
29      "dimensionsHeight": 1333,
30      "dimensionsWidth": 750,
31      "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",
32      "likesCount": 123,
33      "videoDuration": 21.688,
34      "videoViewCount": 77426
35    }
36  ],
37  "postsCount": 274,
38  "latestPosts": [
39    {
40      "type": "Video",
41      "shortCode": "Bw7jACTn3tC",
42      "caption": "“We need to take a stand.” Marvel Studios’ #AvengersEndgame is in theaters now. Get tickets: [link in bio]",
43      "commentsCount": 1045,
44      "dimensionsHeight": 750,
45      "dimensionsWidth": 750,
46      "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",
47      "likesCount": 142707,
48      "videoViewCount": 482810,
49      "timestamp": "2019-05-01T18:44:12.000Z",
50      "locationName": null
51    }
52  ],
53  "following": [],
54  "followedBy": [],
55}

Scraped Instagram hashtag

The structure of each hashtag detail looks like this:

1{
2  "id": "17843854051054595",
3  "name": "endgame",
4  "topPostsOnly": false,
5  "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",
6  "postsCount": 1510549,
7  "topPosts": [
8    {
9      "type": "Image",
10      "shortCode": "Bw9UYRrhxfl",
11      "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",
12      "hashtags": ["marvel", "mcu", "etc..."],
13      "mentions": ["marvel"],
14      "commentsCount": 9,
15      "dimensionsHeight": 1326,
16      "dimensionsWidth": 1080,
17      "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",
18      "likesCount": 2342,
19      "timestamp": "2019-05-02T11:14:55.000Z",
20      "locationName": null
21    }
22  ],
23  "latestPosts": [
24    {
25      "type": "Sidecar",
26      "shortCode": "Bw9flNKl56O",
27      "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",
28      "commentsCount": 0,
29      "dimensionsHeight": 936,
30      "dimensionsWidth": 1080,
31      "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",
32      "likesCount": 12312,
33      "timestamp": "2019-05-02T12:52:48.000Z",
34      "locationName": null
35    }
36  ]
37}

Scraped Instagram place

The structure of each place detail looks like this:

1{
2  "#debug": {
3    "url": "https://www.instagram.com/explore/locations/1017812091/namesti-miru/"
4  },
5  "id": "1017812091",
6  "name": "Náměstí Míru",
7  "public": true,
8  "lat": 50.0753325,
9  "lng": 14.43769,
10  "slug": "namesti-miru",
11  "description": "",
12  "website": "",
13  "phone": "",
14  "aliasOnFacebook": "",
15  "addressStreetAddress": "",
16  "addressZipCode": "",
17  "addressCityName": "Prague, Czech Republic",
18  "addressRegionName": "",
19  "addressCountryCode": "CZ",
20  "addressExactCityMatch": false,
21  "addressExactRegionMatch": false,
22  "addressExactCountryMatch": false,
23  "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",
24  "postsCount": 5310,
25  "topPosts": [
26    {
27      "type": "Image",
28      "shortCode": "Bw6lVVZhXXB",
29      "caption": "🦋🦋🦋",
30      "commentsCount": 3,
31      "dimensionsHeight": 750,
32      "dimensionsWidth": 750,
33      "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",
34      "likesCount": 345,
35      "timestamp": "2019-05-01T09:45:20.000Z",
36      "locationName": null
37    }
38  ],
39  "latestPosts": [
40    {
41      "type": "Image",
42      "shortCode": "Bw9KSlIhAc-",
43      "caption": "#vinohradskaprincezna #nekdotomusikontrolovat #jestezememaji #jmenujusebufinka 🐶",
44      "commentsCount": 0,
45      "dimensionsHeight": 1080,
46      "dimensionsWidth": 1080,
47      "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",
48      "likesCount": 4546,
49      "timestamp": "2019-05-02T09:46:45.000Z",
50      "locationName": null
51    }
52  ]
53}

Scraped Instagram post details

The structure of each post detail looks like this:

1{
2  "type": "Sidecar",
3  "shortCode": "BwrsO1Bho2N",
4  "caption": "Newly upgraded Model S and X drive units rolling down the production line at Gigafactory 1 #tesla #model3 @elonmusk",
5  "hashtags": ["tesla", "model3"],
6  "mentions": ["elonmusk"],
7  "position": 1,
8  "url": "https://www.instagram.com/p/BwrsO1Bho2N",
9  "commentsCount": 711,
10  "latestComments": [
11    {
12      "ownerUsername": "mauricepaoletti",
13      "text": "When is Tesla going to make boats? It was so nice to see clear water in Venice during the covid lockdown!"
14    }
15  ],
16  "dimensionsHeight": 1350,
17  "dimensionsWidth": 1080,
18  "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",
19  "id": "2029910590113615245",
20  "firstComment": "@miszdivastatuz",
21  "likesCount": 153786,
22  "timestamp": "2019-04-25T14:57:01.000Z",
23  "locationName": "Tesla Gigafactory 1",
24  "locationId": "2172837629656184",
25  "ownerFullName": "Tesla",
26  "ownerUsername": "teslamotors",
27  "ownerId": "297604134",
28  "captionIsEdited": false,
29  "hasRankedComments": false,
30  "commentsDisabled": false,
31  "displayResourceUrls": [
32    "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",
33    "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"
34  ],
35  "childPosts": [
36  ],
37  "locationSlug": "tesla-gigafactory-1",
38  "isAdvertisement": false,
39  "taggedUsers": [],
40  "likedBy": []
41}

FAQ

Can I scrape data from both Instagram and Threads at the same time?

Since Instagram and Threads share userbase, you can scrape both Threads and Instagram profiles since they share the same usernames. By using scraping techniques, you can extract data from both platforms simultaneously and get insights into user profiles and their activities on both Meta platforms. You may want to check out our Threads Profile Scraper as well.

Integrations and Instagram Scraper

Last but not least, Instagram Scraper can be connected with almost any cloud service or web app thanks to integrations on the Apify platform. You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, and more. Or you can use webhooks to carry out an action whenever an event occurs, e.g. get a notification whenever Instagram Scraper successfully finishes a run.

Using Instagram Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the apify-client NPM package. To access the API using Python, use the apify-client PyPI package.

Check out the Apify API reference docs for full details or click on the API tab for code examples.

Not your cup of tea? Build your own scraper

Instagram scraper doesn’t exactly do what you need? You can always build your own! We have various scraper templates in Python, JavaScript, and TypeScript to get you started. Alternatively, you can write it from scratch using our open-source library Crawlee. You can keep the scraper to yourself or make it public by adding it to Apify Store (and find users for it).

Your feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for Instagram scraper or simply found a bug, please create an issue on the Actor’s Issues tab in Apify Console.

Developer
Maintained by Apify

Actor Metrics

  • 5.5k monthly users

  • 494 stars

  • >99% runs succeeded

  • 2.5 days response time

  • Created in Apr 2019

  • Modified 8 hours ago