{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Scraper - Posts, Reels, Hashtags & Profiles",
    "description": "Scrape Instagram posts and reels by profile, hashtag or URL: caption, likes, comments, plays and views on every reel, engagement rate, date, media URLs, music, tagged users, location, latest comments. Reels tab mode, date and type filters, monitor mode with play-count deltas. No login.",
    "version": "0.1",
    "x-build-id": "Oej2zOSiTDC0tdm2i"
  },
  "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, e.g. \"nasa\", \"@natgeo\", \"https://www.instagram.com/instagram/\". Newest posts first (pinned first). With Content = Reels, every reel from the profile's Reels tab.",
            "items": {
              "type": "string"
            }
          },
          "hashtags": {
            "title": "#️⃣ Hashtags or keywords",
            "type": "array",
            "description": "Hashtags, keywords or tag URLs, e.g. \"travel\", \"#foodie\", \"instagram.com/explore/tags/travel/\". Read from Instagram's signed-out keyword page (mostly reels, 12 per page); rows carry searchTerm.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postUrls": {
            "title": "🔗 Post or reel URLs",
            "type": "array",
            "description": "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.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "postType": {
            "title": "🎞️ Content",
            "enum": [
              "all",
              "reel",
              "video",
              "image",
              "carousel"
            ],
            "type": "string",
            "description": "Reels reads a profile's Reels tab (also reels not shown in the grid) with plays, likes and comments on every row; on hashtags and URLs it keeps reels only. Carousels come back as type \"Sidecar\".",
            "default": "all"
          },
          "dataDetailLevel": {
            "title": "🧾 Reel detail",
            "enum": [
              "detailedData",
              "basicData"
            ],
            "type": "string",
            "description": "For reels from a profile's Reels tab and for hashtags. Basic skips the per-reel detail request: no caption, date or media URLs, about 30x less data. Profile timelines always come detailed.",
            "default": "detailedData"
          },
          "onlyPostsNewerThan": {
            "title": "📅 Only posts published after",
            "type": "string",
            "description": "Absolute date (2026-09-01, 2026-09-01T12:00:00Z), relative (7 days, 3 weeks, 2 months) or a day count (1 = today's posts). Empty = 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 \"2026-01-01\" to \"2026-06-30\"."
          },
          "skipPinnedPosts": {
            "title": "📌 Skip pinned posts",
            "type": "boolean",
            "description": "Leave out the posts and reels a profile pinned to the top of its grid or Reels tab (often old). They are counted in the run summary.",
            "default": false
          },
          "minLikes": {
            "title": "❤️ Minimum likes",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Keep only posts with at least this many likes, e.g. 10000 for hits only. 0 = no minimum. Posts whose owner hides like counts have likesCount null and are kept.",
            "default": 0
          },
          "minPlays": {
            "title": "▶️ Minimum plays",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Keep only reels with at least this many plays, e.g. 100000 for viral reels. 0 = no minimum. Rows without a play count (photos, carousels) are dropped when this is set.",
            "default": 0
          },
          "keywordFilter": {
            "title": "🔤 Keyword filter",
            "type": "string",
            "description": "Keep only posts whose caption, hashtags, tagged users, location, owner or song contain this word, case-insensitive, e.g. \"giveaway\" or \"recipe, meal prep\" (comma = any). Needs detailed data.",
            "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
          },
          "includeVideoViewCount": {
            "title": "👁️ Video view counts",
            "type": "boolean",
            "description": "Adds videoViewCount to every video and reel row: Instagram's view counter, separate from plays (views were a median 30% of plays on 100 test reels). Free. Skipped in Basic reel detail.",
            "default": true
          },
          "includeLatestComments": {
            "title": "💬 Latest comments",
            "type": "boolean",
            "description": "Adds latestComments (the newest 12-15 comments with author, time and likes) and firstComment to every row that has comments. Free; one extra request per row. Skipped in Basic reel detail.",
            "default": false
          },
          "includeProfileSummary": {
            "title": "👤 Include a profile summary row",
            "type": "boolean",
            "description": "Adds one row of type \"Profile\" per scraped profile: followers, following, bio, links, verified / private / business flags, category, business address, HD avatar. Charged as profile-summary.",
            "default": false
          },
          "monitorMode": {
            "title": "🔁 Only new posts since the last run",
            "type": "boolean",
            "description": "Remembers per profile / hashtag which posts were delivered (in the key-value store below). On a profile the run stops at the last run's newest post, so a daily check costs one page.",
            "default": false
          },
          "monitorDelivery": {
            "title": "📈 What a monitor run delivers",
            "enum": [
              "new",
              "changes"
            ],
            "type": "string",
            "description": "Changes re-reads the newest posts / reels of each profile (up to your per-target cap) and delivers those whose counts moved, with playCountDelta, likesDelta, commentsDelta. Profiles and URLs.",
            "default": "new"
          },
          "monitorStoreName": {
            "title": "🗄️ Monitor memory name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Key-value store that keeps the monitor memory. Give each separate feed (a client, a Slack channel) its own name so they do not hide posts from each other. Letters, digits, 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 (10 posts per timeline page, 12 per reels or 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, views, media URL, duration, pinned, location, music, owner): sized for AI agents and MCP.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "🌍 Proxy",
            "type": "object",
            "description": "Apify datacenter proxies serve every request this actor makes (measured on profiles, reels tabs, keyword pages and single posts). A fresh proxy session is used when Instagram asks a session to wait.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "⚡ Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many per-post requests run at once (reel and keyword details, view counts, comments, 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}