{
  "openapi": "3.0.1",
  "info": {
    "title": "Instagram Location Scraper By Keyword & Hashtag Filter",
    "description": "Scrape Instagram posts by location using this Apify actor. It extracts post captions, image URLs, hashtags, usernames, geotags, and engagement data from any location page. Ideal for local marketing, trend tracking, or research with exportable results in JSON, CSV, or Excel formats.",
    "version": "0.1",
    "x-build-id": "hjKYViHrad7Z4swZZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scraper-engine~instagram-location-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scraper-engine-instagram-location-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/scraper-engine~instagram-location-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scraper-engine-instagram-location-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/scraper-engine~instagram-location-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scraper-engine-instagram-location-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "🎯 Location URLs, Usernames or Keywords",
            "type": "array",
            "description": "Instagram location URLs, @usernames, or place keywords — input type is auto-detected. Example: 'https://www.instagram.com/explore/locations/213131048/berlin-germany/', 'mrbeast', or 'berlin'.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "🔢 Post Limit",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum posts to scrape per run before filtering (0 = unlimited).",
            "default": 20
          },
          "sessionId": {
            "title": "🔑 Instagram sessionid Cookie",
            "type": "string",
            "description": "Your Instagram 'sessionid' cookie value. Required in practice — logged-out location feeds are login-walled and return no posts. Copy it from your browser cookies while logged into instagram.com. Stored encrypted."
          },
          "filterKeywords": {
            "title": "🧲 Keyword Filter",
            "type": "array",
            "description": "Keep only posts whose caption, hashtags, @mentions or tagged-user names contain any of these terms (case-insensitive). Leave empty to keep every post. Matches are listed per post in 'matchedKeywords' and drive the 'passedFilter' flag.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "mediaType": {
            "title": "🖼️ Media Type",
            "enum": [
              "all",
              "image",
              "video",
              "carousel"
            ],
            "type": "string",
            "description": "Which media types count as a match for 'passedFilter': all, image only, video/reel only, or carousel (multi-item) only.",
            "default": "all"
          },
          "extractEntities": {
            "title": "#️⃣ Parse Hashtags & Mentions",
            "type": "boolean",
            "description": "Parse #hashtags and @mentions out of each caption into 'hashtags[]' and 'mentions[]'. Turn off to leave those arrays empty.",
            "default": true
          },
          "includeTaggedUsers": {
            "title": "🏷️ Extract Tagged Users",
            "type": "boolean",
            "description": "Collect people tagged in the media (username, full name, verified, tag position) into 'taggedUsers[]' from the feed node. Best-effort: empty when Instagram omits tags from the feed response.",
            "default": true
          },
          "includeEngagement": {
            "title": "❤️ Include Engagement Counts",
            "type": "boolean",
            "description": "Include likeCount and commentCount on each post. Turn off to withhold them (set to null).",
            "default": true
          },
          "includeVideoMetadata": {
            "title": "🎬 Include Video Metadata",
            "type": "boolean",
            "description": "Include detailed video metadata (width, height, duration). Turn off to keep only the video id and url.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "🌐 Proxy Configuration",
            "type": "object",
            "description": "Proxy to route requests through. If Instagram rejects it, a residential proxy is used as fallback."
          },
          "dateFilterType": {
            "title": "⏱️ Date Filter Mode",
            "enum": [
              "absolute",
              "relative"
            ],
            "type": "string",
            "description": "Filter posts by absolute date range or a relative window.",
            "default": "relative"
          },
          "absoluteStartDate": {
            "title": "📅 Start Date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}-\\d{2}-\\d{2})$",
            "type": "string",
            "description": "Only keep posts on/after this date. Used when Date Filter Mode = absolute.",
            "default": ""
          },
          "absoluteEndDate": {
            "title": "📅 End Date (YYYY-MM-DD)",
            "pattern": "^(|\\d{4}-\\d{2}-\\d{2})$",
            "type": "string",
            "description": "Only keep posts on/before this date. Used when Date Filter Mode = absolute. Empty = now.",
            "default": ""
          },
          "relativeValue": {
            "title": "🔟 Relative Amount",
            "minimum": 0,
            "type": "integer",
            "description": "How many time units back to keep posts from. Used when Date Filter Mode = relative. 0 = no date filtering.",
            "default": 0
          },
          "relativeUnit": {
            "title": "🗓️ Relative Unit",
            "enum": [
              "days",
              "weeks",
              "months",
              "years"
            ],
            "type": "string",
            "description": "Unit for the relative window.",
            "default": "days"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}