{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Scraper - Posts, Reels, Hashtags & Profiles",
    "description": "Scrape Instagram posts, reels and carousels by profile, hashtag or post URL: caption, likes, comments, plays, engagement rate, date, image/video URLs, music, tagged users, co-authors, location, pinned and paid-partnership flags. Date, type and keyword filters, monitor mode. No login.",
    "version": "0.1",
    "x-build-id": "1VoC5qHpuFnEODzev"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/topapi~instagram-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-topapi-instagram-scraper",
        "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/topapi~instagram-scraper/runs": {
      "post": {
        "operationId": "runs-sync-topapi-instagram-scraper",
        "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/topapi~instagram-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-topapi-instagram-scraper",
        "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",
        "properties": {
          "usernames": {
            "title": "😎 Profiles",
            "type": "array",
            "description": "Instagram usernames or profile URLs whose posts you want, e.g. \"nasa\", \"@natgeo\", \"https://www.instagram.com/instagram/\". Newest posts first (pinned posts first), 10 per page, posts, reels and carousels alike.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "#️⃣ Hashtags or keywords",
            "type": "array",
            "description": "Hashtags, keywords or tag URLs, e.g. \"travel\", \"#foodie\", \"https://www.instagram.com/explore/tags/travel/\". Instagram shows signed-out visitors a public keyword page (mostly reels, 12 per page, Instagram's ranking); that is what is read. Every row carries searchTerm.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "🔗 Post or reel URLs",
            "type": "array",
            "description": "Direct post / reel URLs or bare shortcodes, e.g. \"https://www.instagram.com/p/Dd9RyBWBVih/\", \"https://www.instagram.com/reel/Dd9RyBWBVih/\", \"Dd9RyBWBVih\". One row per URL, one request each.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyPostsNewerThan": {
            "title": "📅 Only posts published after",
            "type": "string",
            "description": "Absolute date (2026-09-01, 2026-09-01T12:00:00Z), relative to now (7 days, 3 weeks, 2 months, 1 year) or a day count (1 = today's posts, 2 = yesterday and today). Leave empty for no lower bound. Pinned posts are judged by their own date."
          },
          "onlyPostsOlderThan": {
            "title": "📅 Only posts published before",
            "type": "string",
            "description": "Absolute date or relative (e.g. 30 days). Combine with the field above for a window such as onlyPostsNewerThan \"2026-01-01\" + onlyPostsOlderThan \"2026-06-30\"."
          },
          "skipPinnedPosts": {
            "title": "📌 Skip pinned posts",
            "type": "boolean",
            "description": "Leave out the posts a profile pinned to the top of its grid (often old). They are counted in the run summary.",
            "default": false
          },
          "postType": {
            "title": "🎞️ Post type",
            "enum": [
              "all",
              "image",
              "video",
              "carousel",
              "reel"
            ],
            "type": "string",
            "description": "Keep only one kind of post. Reels are videos with productType \"clips\"; carousels come back with type \"Sidecar\" and their items in childPosts.",
            "default": "all"
          },
          "minLikes": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Keep only posts with at least this many likes, e.g. 10000 to keep hits only. 0 = no minimum. Posts whose owner hides like counts have likesCount null and are kept.",
            "default": 0
          },
          "keywordFilter": {
            "title": "🔤 Keyword filter",
            "type": "string",
            "description": "Keep only posts whose caption, hashtags, tagged users, location or owner name contain this word or phrase, case-insensitive, e.g. \"giveaway\" or \"recipe, meal prep\" (comma = any of them).",
            "default": ""
          },
          "withLocationOnly": {
            "title": "📍 Only posts tagged with a place",
            "type": "boolean",
            "description": "Keep only posts that carry a location tag (locationName, locationId, city). Useful for local lead lists and venue research. On a 30-post test sample 7% of posts had one.",
            "default": false
          },
          "includeProfileSummary": {
            "title": "👤 Include a profile summary row",
            "type": "boolean",
            "description": "Adds one row of type \"Profile\" per scraped profile: followers, following, bio, bio links, verified / private / business flags, category, business address, HD avatar, highlight count. Charged as the profile-summary event, once per profile that gets one.",
            "default": false
          },
          "monitorMode": {
            "title": "🔁 Only new posts since the last run",
            "type": "boolean",
            "description": "Remembers, per profile / hashtag, which posts were already delivered (in the named key-value store below) and returns only new ones. On a profile the run stops at the last run's newest post, so a daily check of a 5,000-post account costs one page; on a keyword page it skips delivered posts and returns the next ones up to the cap. A run that finds nothing new delivers nothing.",
            "default": false
          },
          "monitorStoreName": {
            "title": "🗄️ Monitor memory name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Name of the key-value store that keeps the per-target memory for monitor mode. Give each separate feed (a client, a Slack channel) its own name so they do not hide posts from each other. Letters, digits and hyphens.",
            "default": "instagram-posts-monitor"
          },
          "resultsLimit": {
            "title": "💯 Max posts per profile or hashtag",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Cap per target after filters (your main cost control; you pay per delivered post). 0 = everything Instagram serves (a profile with 3,000 posts is about 300 pages). Instagram serves 10 posts per profile page and 12 per keyword page.",
            "default": 50
          },
          "maxItems": {
            "title": "🔢 Max posts in total",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap for the whole run across all targets. 0 = no total cap (each target is still capped above).",
            "default": 0
          },
          "compact": {
            "title": "🤖 Compact output",
            "type": "boolean",
            "description": "Core fields only (id, type, shortCode, url, caption, hashtags, timestamp, likes, comments, engagement, plays, display/video URL, duration, productType, pinned, paid partnership, location, music title, owner): about a fifth of the bytes, sized for AI agents and MCP clients.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌍 Proxy",
            "type": "object",
            "description": "Apify datacenter proxies serve every request this actor makes (measured on profiles, keyword pages and single posts). The actor rotates to a fresh proxy session when Instagram asks a session to wait, and keeps one session per batch of requests.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many single-post requests run at once (keyword pages and post URLs). 4 is a safe default; raise to 8 for big URL lists.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}