{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Posts Scraper With Tagged Accounts [🔥Cheapest🔥]",
    "description": "Instagram Post Scraper lets you extract captions, images, likes, comments, and URLs from Instagram posts by hashtag, user, or location. This Instagram Post Scraper exports data to JSON, CSV, or Excel, making it perfect for research, insights, and social media trend tracking.",
    "version": "0.4",
    "x-build-id": "PMhleCR7Matx37Gr0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~instagram-posts-scraper-cheapest/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-instagram-posts-scraper-cheapest",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/scraper-engine~instagram-posts-scraper-cheapest/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-instagram-posts-scraper-cheapest",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/scraper-engine~instagram-posts-scraper-cheapest/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-instagram-posts-scraper-cheapest",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "username"
        ],
        "properties": {
          "username": {
            "title": "👤 Profiles or post links to scrape",
            "type": "array",
            "description": "One target per row. Mix freely: handle (nike), profile URL (https://www.instagram.com/nike/), post URL (https://www.instagram.com/p/SHORTCODE/), reel or tv URL. Duplicates are collapsed. Story / explore / share links are rejected instead of becoming a fake profile named @stories.",
            "default": [
              "https://www.instagram.com/nike/"
            ],
            "items": {
              "type": "string"
            }
          },
          "resultsLimit": {
            "title": "🔢 Posts to save per profile",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "How many post rows to keep per profile. Ignored for single post URLs. Anonymous mode (default, no session cookie) can only reach a profile's ~12 most recent posts per run - values above that only matter once you also raise Scan ceiling and use a filter. Supplying a Session cookie below lifts that cap: the actor pages through the full post history until this many rows are saved or the profile runs out of posts. Default is 10.",
            "default": 10
          },
          "onlyPostsNewerThan": {
            "title": "🗓️ Only posts published after",
            "type": "string",
            "description": "UTC cutoff. Absolute tab: YYYY-MM-DD. Relative tab: '6 hours', '3 days', '1 week', '2 months'. Unreadable values stop the run instead of silently disabling the filter. Leave empty for no cutoff.",
            "default": null
          },
          "skipPinnedPosts": {
            "title": "📌 Drop posts pinned to this grid",
            "type": "boolean",
            "description": "Skip posts pinned on the profile you are scraping. A collab pinned on someone else's grid is kept.",
            "default": false
          },
          "dataDetailLevel": {
            "title": "🔬 How much post data per row",
            "enum": [
              "detailedData",
              "basicData"
            ],
            "type": "string",
            "description": "Every post is read from its own post page either way (Instagram no longer serves a lighter feed listing anonymously). Detailed also parses that same page for alt text, latest comments and music info. Basic skips only that extra parsing, so it saves a little CPU rather than a request. Both bill one result row. People/tag columns are filled on both levels.",
            "default": "detailedData"
          },
          "peopleFilter": {
            "title": "👥 Which posts to keep",
            "enum": [
              "all",
              "photoTagged",
              "collabs",
              "captionMention"
            ],
            "type": "string",
            "description": "all = every post (default, identical to a plain post scrape). photoTagged = only posts with in-photo usertags. collabs = only posts with official coauthor_producers. captionMention = only posts whose caption @mentions someone. Default stays all so a first run never returns zero rows on a low-tag account.",
            "default": "all"
          },
          "taggedUsernames": {
            "title": "🎯 Only posts that include these handles",
            "type": "array",
            "description": "Allow-list. A post is kept if the handle is a photo tag, a coauthor, or a caption @mention. Case-insensitive, @ optional. Empty = no allow-list. Example: ['jbalvin', 'travisscott'].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxPostsToScan": {
            "title": "🔭 Scan ceiling per profile",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper bound on posts read while hunting for rows that pass a people filter. Ignored when the filter is 'all' and the allow-list is empty (then the scan equals Posts to save). In anonymous mode (no session cookie) this is effectively capped at a profile's ~12 most recent posts regardless of the value entered, since that is all an anonymous request can see. Providing a Session cookie below lifts that ceiling to full authenticated pagination. Default 300.",
            "default": 300
          },
          "emitPeopleDataset": {
            "title": "📊 Also write a one-row-per-person table",
            "type": "boolean",
            "description": "Writes an extra dataset named ig-people-<runId> with one uncharged row per photo tag, coauthor and caption mention (type / isChild / parentId). The main post dataset is unchanged. Default on.",
            "default": true
          },
          "enableExtraDiscovery": {
            "title": "🔍 Try to find extra older posts (optional, opportunistic)",
            "type": "boolean",
            "description": "OFF by default - leave unchecked and this actor behaves EXACTLY as documented above, with no change at all. When turned ON, AFTER the normal ~12-post anonymous preload (or the authenticated session's results, if one was supplied), the actor also makes a best-effort, zero-extra-login attempt to find additional older/scattered posts: (1) a 'site:instagram.com/p/ <username>' and 'site:instagram.com/reel/ <username>' search-engine lookup on Google/Bing to surface individually-indexed post URLs, and (2) a bounded number of historical Wayback Machine (web.archive.org) snapshots of the profile page, each parsed with the exact same logic used for the live page. This is opportunistic: coverage depends entirely on what happened to get indexed or archived for that specific profile, it can legitimately turn up zero extra posts (a normal, honest outcome, not a bug), and it NEVER reduces, replaces or reorders the primary ~12-post/authenticated results - only distinct extra rows are added on top, still bounded by 'Posts to save' and 'Scan ceiling' and still passed through every filter above. It is automatically skipped when the primary path (especially a working Session cookie) already returned enough posts to satisfy 'Posts to save' on its own, since there is nothing left to look for. Every extra row carries a 'discoverySource' field ('preload' / 'authenticated' / 'search_engine' / 'wayback') so it is transparent exactly where each row came from. If the search engines or archive.org are unreachable or block the request, the run still completes normally with just the primary results.",
            "default": false
          },
          "sessionCookie": {
            "title": "🔐 Instagram session cookie (optional, unlocks full post history)",
            "type": "string",
            "description": "Optional Instagram session cookie for AUTHENTICATED scraping. Paste either the raw `sessionid` cookie value, or the full cookie string copied from your browser's dev tools (e.g. 'sessionid=...; csrftoken=...; ds_user_id=...'). When provided, the actor pages through a profile's FULL post history using that logged-in session instead of being capped at Instagram's ~12-post anonymous limit - it keeps going until 'Posts to save' is reached or the profile runs out of posts. Leave empty for anonymous mode (default, capped at ~12 most recent posts per profile, no login of any kind). IMPORTANT: supplying this means every request for that profile is made AS the Instagram account this session belongs to - this is not something Instagram's Terms of Service sanction, and that account can be rate-limited, checkpointed or disabled as a result, same as with any authenticated Instagram scraping tool. Use a secondary/throwaway account's session, never your primary one, and never share this value - treat it like a password. If the session is invalid, expired, or Instagram rejects it, the actor automatically falls back to anonymous mode with a warning in the log rather than failing the run."
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy",
            "type": "object",
            "description": "The Instagram feed was reachable on residential, datacenter and direct exits in 2026-07-25 measurements. Residential is the default reliability choice.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}