{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Keyword, Trends and Reels Scraper",
    "description": "Scrape Instagram keyword search volume, related keywords, trending topics, reels with likes and comments, profile stats and location data. No login required.",
    "version": "0.1",
    "x-build-id": "KmC9SrzFCb70zLYQu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s-r~instagram-keyword-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s-r-instagram-keyword-trends",
        "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/s-r~instagram-keyword-trends/runs": {
      "post": {
        "operationId": "runs-sync-s-r-instagram-keyword-trends",
        "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/s-r~instagram-keyword-trends/run-sync": {
      "post": {
        "operationId": "run-sync-s-r-instagram-keyword-trends",
        "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": [
          "search"
        ],
        "properties": {
          "searchType": {
            "title": "What are you searching for?",
            "enum": [
              "keyword",
              "profile",
              "url",
              "location",
              "trending"
            ],
            "type": "string",
            "description": "Pick the kind of input you have. Keyword searches Instagram's public search terms. Profile takes usernames and returns the account plus its recent posts. URL accepts any Instagram post, reel or profile link. Location takes location IDs. Trending ignores your input and reads Instagram's trending page.",
            "default": "keyword"
          },
          "search": {
            "title": "Search input",
            "type": "array",
            "description": "What to look up, matching the type above. Terms like 'laptop', usernames like 'natgeo' or '@natgeo', full Instagram URLs, or numeric location IDs. Instagram URLs are always detected automatically, whatever type is selected.",
            "items": {
              "type": "string"
            }
          },
          "maxPostsPerProfile": {
            "title": "Max posts per profile",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many of each profile's posts to return. Instagram publishes the 6 most recent without a login, so higher values return whatever is available.",
            "default": 12
          },
          "queries": {
            "title": "Search terms (advanced)",
            "type": "array",
            "description": "Legacy field, still supported. Prefer the Search input above. Accepts terms, usernames, URLs or location IDs and detects each automatically.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "both",
              "keywords",
              "reels"
            ],
            "type": "string",
            "description": "Return keyword rows (search volume plus related keywords), reel rows (individual reels with engagement), or both.",
            "default": "both"
          },
          "expandRelated": {
            "title": "Expand related keywords (depth)",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "How many levels to follow Instagram's own related-keyword links outward from each seed. 0 returns only the seeds. 1 typically yields around 30 keywords per seed. Higher depths grow quickly, so pair with Max keywords.",
            "default": 1
          },
          "maxKeywords": {
            "title": "Max keywords",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on how many keyword pages the run fetches, including expanded ones.",
            "default": 25
          },
          "maxReels": {
            "title": "Max reels",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Hard cap on reel rows. Each keyword page lists up to 12 reels.",
            "default": 50
          },
          "enrichReels": {
            "title": "Enrich reels with exact counts and comments",
            "type": "boolean",
            "description": "Fetch each reel's own page to add its exact like count, total comment count and the comments themselves. Views, captions, owner details and download URLs are returned either way. Turn off for a much faster run.",
            "default": true
          },
          "includeComments": {
            "title": "Include comments",
            "type": "boolean",
            "description": "Attach comments to each reel row, with author, text, like count, timestamp and reply linkage. Requires Enrich reels. Comments are nested in the reel row, so they cost no extra results.",
            "default": true
          },
          "maxComments": {
            "title": "Max comments per reel",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound on comments attached to each reel. Instagram serves roughly 12 to 15 per reel without logging in, so higher values simply return whatever is available.",
            "default": 30
          },
          "expandRelatedTopics": {
            "title": "Expand related topics too",
            "type": "boolean",
            "description": "Also follow the related-topic links attached to individual reels, not just the related keywords listed on the term page. Widens keyword discovery considerably.",
            "default": true
          },
          "includeTrending": {
            "title": "Include global trending topics",
            "type": "boolean",
            "description": "Also return what Instagram is currently surfacing on its public trending page, independent of your search terms.",
            "default": false
          },
          "profiles": {
            "title": "Profiles (advanced)",
            "type": "array",
            "description": "Legacy field, still supported. Usernames to fetch as profile rows with their recent posts.",
            "items": {
              "type": "string"
            }
          },
          "locationIds": {
            "title": "Location IDs (advanced)",
            "type": "array",
            "description": "Optional Instagram location IDs. Returns name, latitude, longitude and total post count. The ID is the number in an instagram.com/explore/locations/<id>/ URL.",
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "title": "Concurrent requests",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Parallel requests against Instagram. Raise carefully; too high increases the rate of throttled responses.",
            "default": 8
          },
          "includeCreatorStats": {
            "title": "Include creator follower counts and audio",
            "type": "boolean",
            "description": "Fetch each reel's lightweight embed page to add the creator's follower count, engagement rate, audio track title and artist, and video duration. Roughly seven times smaller than the full reel page.",
            "default": true
          },
          "seedFromTrending": {
            "title": "Seed from Instagram's trending terms",
            "type": "boolean",
            "description": "Also crawl the terms Instagram is currently promoting, on top of your own. Most of them have pages, so they are far better seeds than guessed terms, though a few very fresh news terms do not render yet. Useful for discovery when you do not know what to search for.",
            "default": false
          },
          "maxSeedTerms": {
            "title": "Max trending seed terms",
            "minimum": 1,
            "maximum": 72,
            "type": "integer",
            "description": "How many trending terms to use as crawl seeds when seeding from trending is on.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}