Actor picture

Instagram API Scraper

alexey/quick-instagram-profile-check

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.

Free trial for 30 days

Then $39/month

No credit card required now

Author's avatarAlexey Udovydchenko
  • Modified
  • Users462
  • Runs318,647
Actor picture
Instagram API Scraper

Free trial for 30 days

Then $39/month

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 much does Instagram API Scraper cost?

Extracting data from 100 profiles requires about 0.05 compute units. Extracting data from 1,000 posts requires about 0.1 compute units and 3Mbytes (megabytes) of RESIDENTIAL proxy traffic. The usage costs differ depending on what type of page you are scraping. Some pages, such as details, just need to be opened, while other pages, such as comments, require a lot of scrolling. You should roughly compare how long it takes to do these operations manually to get an idea about how to transfer usage costs from one use case to another. For more details about the plans we offer, platform credits, and usage, see the platform pricing page or this video guide on how to choose the right subscription plan.

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.

Integrations and Instagram API Scraper

Instagram API Scraper can be connected with almost any cloud service or web app thanks to integrations on the Apify platform. 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.

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

{
  "id": "2872941012581150166",
  "type": "Sidecar",
  "shortCode": "CfevKEjjO3W",
  "caption": "Friday is just Party spelled backwards.",
  "hashtags": [],
  "mentions": [],
  "url": "https://www.instagram.com/p/CfevKEjjO3W/",
  "commentsCount": 1,
  "topComments": [
    {
      "id": "17965588192732482",
      "text": "Ytrap is that you?",
      "created_at": 1656701973,
      "owner": {
        "id": "53055140",
        "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",
        "username": "mr.bearightside"
      }
    }
  ],
  "dimensionsHeight": 719,
  "dimensionsWidth": 1080,
  "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",
  "images": [
    "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",
    "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",
    "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",
    "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"
  ],
  "likesCount": 16,
  "timestamp": "2022-07-01T18:47:58.000Z",
  "childPosts": [
    {
      "id": "2872941008219162995",
      "type": "Image",
      "caption": "",
      "hashtags": [],
      "mentions": [],
      "url": null,
      "commentsCount": 0,
      "topComments": [],
      "dimensionsHeight": 719,
      "dimensionsWidth": 1080,
      "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",
      "images": [],
      "likesCount": null,
      "timestamp": null,
      "childPosts": [],
      "ownerId": null
    },
    {
      "id": "2872941008504479156",
      "type": "Image",
      "caption": "",
      "hashtags": [],
      "mentions": [],
      "url": null,
      "commentsCount": 0,
      "topComments": [],
      "dimensionsHeight": 719,
      "dimensionsWidth": 1080,
      "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",
      "images": [],
      "likesCount": null,
      "timestamp": null,
      "childPosts": [],
      "ownerId": null
    },
    {
      "id": "2872941008210847168",
      "type": "Image",
      "caption": "",
      "hashtags": [],
      "mentions": [],
      "url": null,
      "commentsCount": 0,
      "topComments": [],
      "dimensionsHeight": 719,
      "dimensionsWidth": 1080,
      "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",
      "images": [],
      "likesCount": null,
      "timestamp": null,
      "childPosts": [],
      "ownerId": null
    },
    {
      "id": "2872941008412089063",
      "type": "Image",
      "caption": "",
      "hashtags": [],
      "mentions": [],
      "url": null,
      "commentsCount": 0,
      "topComments": [],
      "dimensionsHeight": 720,
      "dimensionsWidth": 1080,
      "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",
      "images": [],
      "likesCount": null,
      "timestamp": null,
      "childPosts": [],
      "ownerId": null
    }
  ],
  "ownerFullName": "Apify",
  "ownerUsername": "apifytech",
  "ownerId": "29230178602"
}

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.

{
  "url": "https://www.instagram.com/p/CgpwtwVJ66a/",
  "id": "17950726027923736",
  "text": "@romipv15 ❤️",
  "created_at": 1659461955,
  "owner": {
    "id": "4067198760",
    "is_verified": false,
    "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",
    "username": "devoid.wolf"
  },
  "repliesCount": 1,
  "replies": [
    {
      "id": "17967877732740996",
      "text": "@devoid.wolf loviu preciosooo❤️❤️",
      "created_at": 1659476569,
      "owner": {
        "id": "10177018382",
        "is_verified": false,
        "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",
        "username": "romipv15"
      },
      "likesCount": 0
    }
  ],
  "likesCount": 1
}

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 Post Scraper ➡️ Instagram Profile Scraper ➡️ Quick Instagram Posts Checker ➡️ Instagram Tagged Scraper ➡️ Instagram Reel Scraper ➡️ Instagram Comment Scraper ➡️ Instagram Hashtag Scraper

Need something more advanced?

Try our more advanced Instagram Scraper if you need even more options.

Let us know if you need a custom Instagram scraping solution.

Industries

See how Instagram API Scraper is used in industries around the world