Instagram API Scraper avatar
Instagram API Scraper
Try for free

30 days trial then $39.00/month - No credit card required now

View all Actors
Instagram API Scraper

Instagram API Scraper

apify/instagram-api-scraper
Try for free

30 days trial then $39.00/month - No credit card required now

Scrape and download Instagram posts, profiles, places, hashtags, photos without login. Supports search keywords and URL lists. Download your data as HTML table, JSON, CSV, Excel, XML, and RSS feed.

What is Instagram API Scraper?

You can use Instagram API Scraper to set up a scraper to search Instagram for profiles, hashtags, or places. Alternatively, you can add the Instagram URLs you want to scrape directly and extract page details, profiles, posts, comments, hashtags, locations, and more.

With Instagram API Scraper you can extract valuable data from:

1. Profiles

  • by URL (https://www.instagram.com/[PROFILE]) with top recent posts if max results in input is zero.

2. Posts

  • with top comments available by direct URLs for regular posts (https://www.instagram.com/p/[SHORTCODE]),

  • IGTV (https://www.instagram.com/tv/[SHORTCODE])

  • or reels (https://www.instagram.com/reel/[SHORTCODE]) with top comments available by direct URLs for regular posts, profiles, hashtags, locations and posts.

3. Comments

  • You can get comments from posts by using the Instagram POST URL in the input.

4. Tags and locations

  • Tags (https://www.instagram.com/explore/tags/apify/),

  • a list of locations (https://www.instagram.com/explore/locations/c530281/prague-czech-republic/)

  • and exact locations (https://www.instagram.com/explore/locations/110589025635590/prague-czech-republic/) supported as direct URLs.

  • You can optionally provide search term(s) to look up profiles, locations and hashtags.

Why scrape Instagram?

Instagram data can give you valuable information about popular posts and users anywhere in the world, help you predict trends, track brand awareness, learn how to improve your Instagram performance, or keep an eye on competing influencers.

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 scrape Instagram with Instagram API Scraper

Instagram API Scraper is designed to be fast and easy to use so there aren't too many parameters or settings. Just follow the steps below:

  1. Create a free Apify account.
  2. Open Instagram API Scraper.
  3. Add one or more Instagram URLs or search queries to scrape.
  4. Click "Save & Start" and wait for the datasets to be extracted.
  5. Download your data in JSON, XML, CSV, Excel, or HTML.

How many results can you scrape with Instagram API scraper?

The number of results Instagram API 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 posts on the legality of web scraping and ethical scraping.

Input parameters

The input for Instagram API Scraper should be JSON containing the list of pages on Instagram that should be visited. Click on the input tab for an input example.

Output example

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 our Instagram scrapers.

Scraped Instagram post

Please note that ownerFullName and ownerUsername are available only for posts from the profile feed (for hashtags and locations there will only be ownerId) and likewise locationName and locationId are available only for posts from the location feed. In order to get topPosts you need to scrape profile-tag-location details (zero max items).

1{
2  "id": "2872941012581150166",
3  "type": "Sidecar",
4  "shortCode": "CfevKEjjO3W",
5  "caption": "Friday is just Party spelled backwards.",
6  "hashtags": [],
7  "mentions": [],
8  "url": "https://www.instagram.com/p/CfevKEjjO3W/",
9  "commentsCount": 1,
10  "topComments": [
11    {
12      "id": "17965588192732482",
13      "text": "Ytrap is that you?",
14      "created_at": 1656701973,
15      "owner": {
16        "id": "53055140",
17        "profile_pic_url": "https://scontent-gru2-2.cdninstagram.com/v/t51.2885-19/291172308_1433310463818654_3392274096989976793_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-gru2-2.cdninstagram.com&_nc_cat=106&_nc_ohc=Ku3tiqvt6Q0AX-9CimU&edm=APU89FABAAAA&ccb=7-5&oh=00_AT80-LQ4EuJGW-ZA4B-OfZx1RNAGDr75nZCA5s3J2_gBug&oe=630E6B2E&_nc_sid=86f79a",
18        "username": "mr.bearightside"
19      }
20    }
21  ],
22  "dimensionsHeight": 719,
23  "dimensionsWidth": 1080,
24  "displayUrl": "https://scontent-gru2-2.cdninstagram.com/v/t51.2885-15/290965101_448500773766930_1387067205275170103_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru2-2.cdninstagram.com&_nc_cat=106&_nc_ohc=QA0j3KG7tpoAX_jXgft&edm=APU89FABAAAA&ccb=7-5&oh=00_AT-KY48VGPY4FOqpuXTbO0wxzyXEOLYUGBThMvEeSAcVXA&oe=630D6B35&_nc_sid=86f79a",
25  "images": [
26    "https://scontent-gru2-2.cdninstagram.com/v/t51.2885-15/290965101_448500773766930_1387067205275170103_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru2-2.cdninstagram.com&_nc_cat=106&_nc_ohc=QA0j3KG7tpoAX_jXgft&edm=APU89FABAAAA&ccb=7-5&oh=00_AT-KY48VGPY4FOqpuXTbO0wxzyXEOLYUGBThMvEeSAcVXA&oe=630D6B35&_nc_sid=86f79a",
27    "https://scontent-gru1-1.cdninstagram.com/v/t51.2885-15/290949279_336605095307254_1099428386212862812_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_cat=110&_nc_ohc=rhe0mCQ9jGAAX9ihMxN&edm=APU89FABAAAA&ccb=7-5&oh=00_AT9dDwnTllwCJ_aalZK_RXZlKpVS96wej4NBSusGt2-AWA&oe=630EC3D9&_nc_sid=86f79a",
28    "https://scontent-gru2-1.cdninstagram.com/v/t51.2885-15/291215314_889731762429619_8092846469479361036_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru2-1.cdninstagram.com&_nc_cat=107&_nc_ohc=wdlfzclgugwAX-nCggP&edm=APU89FABAAAA&ccb=7-5&oh=00_AT-ZlpRQ1SOSG5ccS7IK86I1RP7qMo3RipOPxvDbm8Lhxg&oe=630E5BA3&_nc_sid=86f79a",
29    "https://scontent-gru1-1.cdninstagram.com/v/t51.2885-15/291347144_576365830557226_4854168139335161027_n.jpg?stp=dst-jpg_e15_fr_s1080x1080&_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_cat=110&_nc_ohc=jSOCbbR1KVMAX8ogn6h&edm=APU89FABAAAA&ccb=7-5&oh=00_AT_7IGpfxGGI4-AIUOo39LZPRvff_8VN3RaKGr2NuBDjmQ&oe=630D2001&_nc_sid=86f79a"
30  ],
31  "likesCount": 16,
32  "timestamp": "2022-07-01T18:47:58.000Z",
33  "childPosts": [
34    {
35      "id": "2872941008219162995",
36      "type": "Image",
37      "caption": "",
38      "hashtags": [],
39      "mentions": [],
40      "url": null,
41      "commentsCount": 0,
42      "topComments": [],
43      "dimensionsHeight": 719,
44      "dimensionsWidth": 1080,
45      "displayUrl": "https://scontent-gru2-2.cdninstagram.com/v/t51.2885-15/290965101_448500773766930_1387067205275170103_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru2-2.cdninstagram.com&_nc_cat=106&_nc_ohc=QA0j3KG7tpoAX_jXgft&edm=APU89FABAAAA&ccb=7-5&oh=00_AT-KY48VGPY4FOqpuXTbO0wxzyXEOLYUGBThMvEeSAcVXA&oe=630D6B35&_nc_sid=86f79a",
46      "images": [],
47      "likesCount": null,
48      "timestamp": null,
49      "childPosts": [],
50      "ownerId": null
51    },
52    {
53      "id": "2872941008504479156",
54      "type": "Image",
55      "caption": "",
56      "hashtags": [],
57      "mentions": [],
58      "url": null,
59      "commentsCount": 0,
60      "topComments": [],
61      "dimensionsHeight": 719,
62      "dimensionsWidth": 1080,
63      "displayUrl": "https://scontent-gru1-1.cdninstagram.com/v/t51.2885-15/290949279_336605095307254_1099428386212862812_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_cat=110&_nc_ohc=rhe0mCQ9jGAAX9ihMxN&edm=APU89FABAAAA&ccb=7-5&oh=00_AT9dDwnTllwCJ_aalZK_RXZlKpVS96wej4NBSusGt2-AWA&oe=630EC3D9&_nc_sid=86f79a",
64      "images": [],
65      "likesCount": null,
66      "timestamp": null,
67      "childPosts": [],
68      "ownerId": null
69    },
70    {
71      "id": "2872941008210847168",
72      "type": "Image",
73      "caption": "",
74      "hashtags": [],
75      "mentions": [],
76      "url": null,
77      "commentsCount": 0,
78      "topComments": [],
79      "dimensionsHeight": 719,
80      "dimensionsWidth": 1080,
81      "displayUrl": "https://scontent-gru2-1.cdninstagram.com/v/t51.2885-15/291215314_889731762429619_8092846469479361036_n.jpg?stp=dst-jpg_e35_s1080x1080&_nc_ht=scontent-gru2-1.cdninstagram.com&_nc_cat=107&_nc_ohc=wdlfzclgugwAX-nCggP&edm=APU89FABAAAA&ccb=7-5&oh=00_AT-ZlpRQ1SOSG5ccS7IK86I1RP7qMo3RipOPxvDbm8Lhxg&oe=630E5BA3&_nc_sid=86f79a",
82      "images": [],
83      "likesCount": null,
84      "timestamp": null,
85      "childPosts": [],
86      "ownerId": null
87    },
88    {
89      "id": "2872941008412089063",
90      "type": "Image",
91      "caption": "",
92      "hashtags": [],
93      "mentions": [],
94      "url": null,
95      "commentsCount": 0,
96      "topComments": [],
97      "dimensionsHeight": 720,
98      "dimensionsWidth": 1080,
99      "displayUrl": "https://scontent-gru1-1.cdninstagram.com/v/t51.2885-15/291347144_576365830557226_4854168139335161027_n.jpg?stp=dst-jpg_e15_fr_s1080x1080&_nc_ht=scontent-gru1-1.cdninstagram.com&_nc_cat=110&_nc_ohc=jSOCbbR1KVMAX8ogn6h&edm=APU89FABAAAA&ccb=7-5&oh=00_AT_7IGpfxGGI4-AIUOo39LZPRvff_8VN3RaKGr2NuBDjmQ&oe=630D2001&_nc_sid=86f79a",
100      "images": [],
101      "likesCount": null,
102      "timestamp": null,
103      "childPosts": [],
104      "ownerId": null
105    }
106  ],
107  "ownerFullName": "Apify",
108  "ownerUsername": "apifytech",
109  "ownerId": "29230178602"
110}

Scraped Instagram comment

Gets up to three replies. The output format is different, so it's recommended to do separate runs to get posts with comments and runs for all other types of data.

1{
2  "url": "https://www.instagram.com/p/CgpwtwVJ66a/",
3  "id": "17950726027923736",
4  "text": "@romipv15 ❤️",
5  "created_at": 1659461955,
6  "owner": {
7    "id": "4067198760",
8    "is_verified": false,
9    "profile_pic_url": "https://instagram.fala2-1.fna.fbcdn.net/v/t51.2885-19/143927761_455013982320583_4616411511060627850_n.jpg?stp=dst-jpg_s150x150&_nc_ht=instagram.fala2-1.fna.fbcdn.net&_nc_cat=107&_nc_ohc=EIIEWfCExZEAX85uHFk&edm=AP_V10EBAAAA&ccb=7-5&oh=00_AT-RbIPc2nJllSN-motZ18UV8Ti1bAvZXk8VorW9c9D34w&oe=630F5D10&_nc_sid=4f375e",
10    "username": "devoid.wolf"
11  },
12  "repliesCount": 1,
13  "replies": [
14    {
15      "id": "17967877732740996",
16      "text": "@devoid.wolf loviu preciosooo❤️❤️",
17      "created_at": 1659476569,
18      "owner": {
19        "id": "10177018382",
20        "is_verified": false,
21        "profile_pic_url": "https://instagram.fala2-1.fna.fbcdn.net/v/t51.2885-19/298163874_1379094759167553_1722689499543189016_n.jpg?stp=dst-jpg_s150x150&_nc_ht=instagram.fala2-1.fna.fbcdn.net&_nc_cat=109&_nc_ohc=EEqIFcyUo9UAX99b-UQ&edm=AP_V10EBAAAA&ccb=7-5&oh=00_AT8_Pw_OsX_49w0IE8cJlfKDJYBh6Kl_tSWFVgcLcS-82A&oe=630EACF1&_nc_sid=4f375e",
22        "username": "romipv15"
23      },
24      "likesCount": 0
25    }
26  ],
27  "likesCount": 1
28}

Integrations and Instagram API Scraper

Last but not least, Instagram API 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 API Scraper successfully finishes a run.

Using Instagram API 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.

Want to scrape Instagram hashtags, posts, or comments?

You can use the other dedicated scrapers below if you want to scrape specific Instagram data. You'll have fewer settings to change and faster results. Just enter one or more Instagram usernames or URLs and click to scrape.

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

Not your cup of tea? Build your own scraper

Instagram API 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).

Or let us know if you need a custom scraping solution.

Your feedback

We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for Instagram API 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
  • 97 monthly users
  • 99.8% runs succeeded
  • 0.6 days response time
  • Created in May 2022
  • Modified 4 days ago