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
  • Users159
  • Runs98,930
Actor picture
Instagram API Scraper

Free trial for 30 days

Then $39/month

Supported URLS

Profiles, hashtags, locations and posts.

Profiles

You can scrape profile details by URL (https://www.instagram.com/[PROFILE]) with top recent posts in case if max results in input is zero.

For getting post feed from profile you need to specify max results, if you want to get all posts just set big number as 999999.

Posts

Post details 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])

Other Instagram data

Tags (https://www.instagram.com/explore/tags/apify/), 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.

Optionally you can provide search term(s) to lookup profiles, locations and hashtags. Full results from search saved in KV Store as SEARCH-[term] meanwhile profiles, locations or hashtags from search crawled as direct URLs, means you can get details without additional run.

Why scrape Instagram?

Since this actor is very savvy on resources you can run it as often as you want to be able to collect all new posts or track stats over time in a same style as provided by i.e. SocialBlade. If you need more details or functionality like search you need to have access to residential proxies and use full Instagram Scraper

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

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.

Cost of usage

  • Compute units - 0.05CU per 100 profiles or 0.1CU per 1000 posts

Using proxies

3Mbytes (megabytes) of RESIDENTIAL proxy traffic per 1000 posts.

Input parameters

The input of this scraper should be JSON containing the list of pages on Instagram that should be visited. Required fields are:

Field Type Description
directUrls Array List of Instagram URLs (profile or post)
proxy Object (optional) Proxy configuration

Instagram scraper input example

{
  "directUrls": [
    "https://www.instagram.com/explore/tags/fashion",
    "https://www.instagram.com/jinling_sun",
    "https://www.instagram.com/onparledemode",
    "https://www.instagram.com/tv/CdlIFYkAI8S",
    "https://www.instagram.com/reel/CdL_iQwgMqs/",
    "https://www.instagram.com/p/Cdd5g8hLoUa/"
  ]
}

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 post

Please note that ownerFullName and ownerUsername available only for posts from profile feed (for hashtags and locations there will be only ownerId) and likewise locationName and locationId available only for posts from 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

Getting up to 3 replies, output format is different so its recommended to do separate runs for getting 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
}

Industries

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