Instagram Scraper avatar

Instagram Scraper

Try for free

Pay $2.30 for 1,000 results

Go to Store
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.

You can access the Instagram Scraper programmatically from your own applications by using the Apify API. You can choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.

1{
2  "openapi": "3.0.1",
3  "info": {
4    "version": "0.0",
5    "x-build-id": "GiNVz56FS4dk1USB5"
6  },
7  "servers": [
8    {
9      "url": "https://api.apify.com/v2"
10    }
11  ],
12  "paths": {
13    "/acts/apify~instagram-scraper/run-sync-get-dataset-items": {
14      "post": {
15        "operationId": "run-sync-get-dataset-items-apify-instagram-scraper",
16        "x-openai-isConsequential": false,
17        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
18        "tags": [
19          "Run Actor"
20        ],
21        "requestBody": {
22          "required": true,
23          "content": {
24            "application/json": {
25              "schema": {
26                "$ref": "#/components/schemas/inputSchema"
27              }
28            }
29          }
30        },
31        "parameters": [
32          {
33            "name": "token",
34            "in": "query",
35            "required": true,
36            "schema": {
37              "type": "string"
38            },
39            "description": "Enter your Apify token here"
40          }
41        ],
42        "responses": {
43          "200": {
44            "description": "OK"
45          }
46        }
47      }
48    },
49    "/acts/apify~instagram-scraper/runs": {
50      "post": {
51        "operationId": "runs-sync-apify-instagram-scraper",
52        "x-openai-isConsequential": false,
53        "summary": "Executes an Actor and returns information about the initiated run in response.",
54        "tags": [
55          "Run Actor"
56        ],
57        "requestBody": {
58          "required": true,
59          "content": {
60            "application/json": {
61              "schema": {
62                "$ref": "#/components/schemas/inputSchema"
63              }
64            }
65          }
66        },
67        "parameters": [
68          {
69            "name": "token",
70            "in": "query",
71            "required": true,
72            "schema": {
73              "type": "string"
74            },
75            "description": "Enter your Apify token here"
76          }
77        ],
78        "responses": {
79          "200": {
80            "description": "OK",
81            "content": {
82              "application/json": {
83                "schema": {
84                  "$ref": "#/components/schemas/runsResponseSchema"
85                }
86              }
87            }
88          }
89        }
90      }
91    },
92    "/acts/apify~instagram-scraper/run-sync": {
93      "post": {
94        "operationId": "run-sync-apify-instagram-scraper",
95        "x-openai-isConsequential": false,
96        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
97        "tags": [
98          "Run Actor"
99        ],
100        "requestBody": {
101          "required": true,
102          "content": {
103            "application/json": {
104              "schema": {
105                "$ref": "#/components/schemas/inputSchema"
106              }
107            }
108          }
109        },
110        "parameters": [
111          {
112            "name": "token",
113            "in": "query",
114            "required": true,
115            "schema": {
116              "type": "string"
117            },
118            "description": "Enter your Apify token here"
119          }
120        ],
121        "responses": {
122          "200": {
123            "description": "OK"
124          }
125        }
126      }
127    }
128  },
129  "components": {
130    "schemas": {
131      "inputSchema": {
132        "type": "object",
133        "properties": {
134          "directUrls": {
135            "title": "Instagram URLs you want to scrape",
136            "uniqueItems": true,
137            "type": "array",
138            "description": "Add one or more Instagram URLs to scrape. The field is optional, but you need to either use this field or search query below.",
139            "items": {
140              "type": "string"
141            }
142          },
143          "resultsType": {
144            "title": "What do you want to scrape from each page?",
145            "enum": [
146              "posts",
147              "comments",
148              "details",
149              "mentions",
150              "stories"
151            ],
152            "type": "string",
153            "description": "You can choose to get posts, comments or details from Instagram URLs. Comments can only be scraped from post URLs.",
154            "default": "posts"
155          },
156          "resultsLimit": {
157            "title": "Max results per URL",
158            "minimum": 1,
159            "type": "integer",
160            "description": "How many posts or comments (max 50 comments per post) you want to scrape from each Instagram URL. If you set this to 1, you will get a single post from each page."
161          },
162          "onlyPostsNewerThan": {
163            "title": "Newer than",
164            "pattern": "^(\\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])(T[0-2]\\d:[0-5]\\d(:[0-5]\\d)?(\\.\\d+)?Z?)?$|^(\\d+)\\s*(minute|hour|day|week|month|year)s?$",
165            "type": "string",
166            "description": "Limit how far back to the history the scraper should go. The date should be in YYYY-MM-DD or full ISO absolute format or in relative format e.g. 1 days, 2 months, 3 years. All time values are taken in UTC timezone"
167          },
168          "isUserTaggedFeedURL": {
169            "title": "Tagged posts",
170            "type": "boolean",
171            "description": "Get the tagged posts for each profile"
172          },
173          "isUserReelFeedURL": {
174            "title": "Reels posts",
175            "type": "boolean",
176            "description": "Get the reels posts for each profile"
177          },
178          "search": {
179            "title": "Search query",
180            "type": "string",
181            "description": "Provide a search query which will be used to search Instagram for profiles, hashtags or places."
182          },
183          "searchType": {
184            "title": "Search type",
185            "enum": [
186              "user",
187              "hashtag",
188              "place"
189            ],
190            "type": "string",
191            "description": "What type of pages to search for (you can look for hashtags, profiles or places).",
192            "default": "hashtag"
193          },
194          "searchLimit": {
195            "title": "Search results limit",
196            "minimum": 1,
197            "maximum": 250,
198            "type": "integer",
199            "description": "How many search results (hashtags, users or places) should be returned."
200          },
201          "enhanceUserSearchWithFacebookPage": {
202            "title": "Enhance user search (top 10) with Facebook page & email if available (higher credit usage)",
203            "type": "boolean",
204            "description": "For each user from the top 10, the scraper extracts their Facebook page that sometimes contains their business email. Please keep in mind that you are forbidden to collect personal data in certain jurisdictions. Please see <a href=\"https://blog.apify.com/is-web-scraping-legal/#think-twice-before-scraping-personal-data\">this article</a> for more details."
205          },
206          "addParentData": {
207            "title": "Add metadata",
208            "type": "boolean",
209            "description": "Only for feed items - add data source to results, i.e. for profile posts metadata is profile, for tag posts metadata is hashtag",
210            "default": false
211          }
212        }
213      },
214      "runsResponseSchema": {
215        "type": "object",
216        "properties": {
217          "data": {
218            "type": "object",
219            "properties": {
220              "id": {
221                "type": "string"
222              },
223              "actId": {
224                "type": "string"
225              },
226              "userId": {
227                "type": "string"
228              },
229              "startedAt": {
230                "type": "string",
231                "format": "date-time",
232                "example": "2025-01-08T00:00:00.000Z"
233              },
234              "finishedAt": {
235                "type": "string",
236                "format": "date-time",
237                "example": "2025-01-08T00:00:00.000Z"
238              },
239              "status": {
240                "type": "string",
241                "example": "READY"
242              },
243              "meta": {
244                "type": "object",
245                "properties": {
246                  "origin": {
247                    "type": "string",
248                    "example": "API"
249                  },
250                  "userAgent": {
251                    "type": "string"
252                  }
253                }
254              },
255              "stats": {
256                "type": "object",
257                "properties": {
258                  "inputBodyLen": {
259                    "type": "integer",
260                    "example": 2000
261                  },
262                  "rebootCount": {
263                    "type": "integer",
264                    "example": 0
265                  },
266                  "restartCount": {
267                    "type": "integer",
268                    "example": 0
269                  },
270                  "resurrectCount": {
271                    "type": "integer",
272                    "example": 0
273                  },
274                  "computeUnits": {
275                    "type": "integer",
276                    "example": 0
277                  }
278                }
279              },
280              "options": {
281                "type": "object",
282                "properties": {
283                  "build": {
284                    "type": "string",
285                    "example": "latest"
286                  },
287                  "timeoutSecs": {
288                    "type": "integer",
289                    "example": 300
290                  },
291                  "memoryMbytes": {
292                    "type": "integer",
293                    "example": 1024
294                  },
295                  "diskMbytes": {
296                    "type": "integer",
297                    "example": 2048
298                  }
299                }
300              },
301              "buildId": {
302                "type": "string"
303              },
304              "defaultKeyValueStoreId": {
305                "type": "string"
306              },
307              "defaultDatasetId": {
308                "type": "string"
309              },
310              "defaultRequestQueueId": {
311                "type": "string"
312              },
313              "buildNumber": {
314                "type": "string",
315                "example": "1.0.0"
316              },
317              "containerUrl": {
318                "type": "string"
319              },
320              "usage": {
321                "type": "object",
322                "properties": {
323                  "ACTOR_COMPUTE_UNITS": {
324                    "type": "integer",
325                    "example": 0
326                  },
327                  "DATASET_READS": {
328                    "type": "integer",
329                    "example": 0
330                  },
331                  "DATASET_WRITES": {
332                    "type": "integer",
333                    "example": 0
334                  },
335                  "KEY_VALUE_STORE_READS": {
336                    "type": "integer",
337                    "example": 0
338                  },
339                  "KEY_VALUE_STORE_WRITES": {
340                    "type": "integer",
341                    "example": 1
342                  },
343                  "KEY_VALUE_STORE_LISTS": {
344                    "type": "integer",
345                    "example": 0
346                  },
347                  "REQUEST_QUEUE_READS": {
348                    "type": "integer",
349                    "example": 0
350                  },
351                  "REQUEST_QUEUE_WRITES": {
352                    "type": "integer",
353                    "example": 0
354                  },
355                  "DATA_TRANSFER_INTERNAL_GBYTES": {
356                    "type": "integer",
357                    "example": 0
358                  },
359                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
360                    "type": "integer",
361                    "example": 0
362                  },
363                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
364                    "type": "integer",
365                    "example": 0
366                  },
367                  "PROXY_SERPS": {
368                    "type": "integer",
369                    "example": 0
370                  }
371                }
372              },
373              "usageTotalUsd": {
374                "type": "number",
375                "example": 0.00005
376              },
377              "usageUsd": {
378                "type": "object",
379                "properties": {
380                  "ACTOR_COMPUTE_UNITS": {
381                    "type": "integer",
382                    "example": 0
383                  },
384                  "DATASET_READS": {
385                    "type": "integer",
386                    "example": 0
387                  },
388                  "DATASET_WRITES": {
389                    "type": "integer",
390                    "example": 0
391                  },
392                  "KEY_VALUE_STORE_READS": {
393                    "type": "integer",
394                    "example": 0
395                  },
396                  "KEY_VALUE_STORE_WRITES": {
397                    "type": "number",
398                    "example": 0.00005
399                  },
400                  "KEY_VALUE_STORE_LISTS": {
401                    "type": "integer",
402                    "example": 0
403                  },
404                  "REQUEST_QUEUE_READS": {
405                    "type": "integer",
406                    "example": 0
407                  },
408                  "REQUEST_QUEUE_WRITES": {
409                    "type": "integer",
410                    "example": 0
411                  },
412                  "DATA_TRANSFER_INTERNAL_GBYTES": {
413                    "type": "integer",
414                    "example": 0
415                  },
416                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
417                    "type": "integer",
418                    "example": 0
419                  },
420                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
421                    "type": "integer",
422                    "example": 0
423                  },
424                  "PROXY_SERPS": {
425                    "type": "integer",
426                    "example": 0
427                  }
428                }
429              }
430            }
431          }
432        }
433      }
434    }
435  }
436}

👁 Instagram Scraper OpenAPI definition

OpenAPI is a standard for designing and describing RESTful APIs, allowing developers to define API structure, endpoints, and data formats in a machine-readable way. It simplifies API development, integration, and documentation.

OpenAPI is effective when used with AI agents and GPTs by standardizing how these systems interact with various APIs, for reliable integrations and efficient communication.

By defining machine-readable API specifications, OpenAPI allows AI models like GPTs to understand and use varied data sources, improving accuracy. This accelerates development, reduces errors, and provides context-aware responses, making OpenAPI a core component for AI applications.

You can download the OpenAPI definitions for Instagram Scraper from the options below:

If you’d like to learn more about how OpenAPI powers GPTs, read our blog post.

You can also check out our other API clients:

Developer
Maintained by Apify

Actor Metrics

  • 8.4k monthly users

  • 1k bookmarks

  • >99% runs succeeded

  • 1.5 days response time

  • Created in Apr 2019

  • Modified a day ago