# Instagram Location Scraper - Posts by Place (`dami_studio/instagram-location-scraper`) Actor

Scrape Instagram posts by location/place at $0.40 per 1k - cheaper than apidojo. Get captions, likes, comments, media URLs, owner & timestamp. Top & recent posts, multi-cookie rotation, export JSON/CSV/Excel or to Notion. Failed runs cost nothing.

- **URL**: https://apify.com/dami\_studio/instagram-location-scraper.md
- **Developed by:** [Dami's Studio](https://apify.com/dami_studio) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.40 / 1,000 result returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## ⚡ Instagram Location Scraper — Posts by Place

**Scrape Instagram posts by location/place — without the per-call price of the big providers.** Give it **location IDs** or `/explore/locations/<id>/` **URLs** and get back the **top & recent posts** for each place: caption, likes, comments, media URLs, owner, hashtags, mentions and timestamp. Export to **JSON, CSV or Excel**, call it from the **API**, or have every run delivered straight to **Notion**. **Just $0.40 per 1,000 posts** — built for local lead gen, event coverage, geo-trend tracking and competitor research.

> Instagram location data is login-gated. The paid services scrape it with pools of logged-in accounts. This actor does the same with **your** throwaway `sessionid` cookies, rotated through residential proxy — and bills a fraction of what they charge. **Run it with no cookie and it returns one clearly-labeled SAMPLE post (free) so you can preview the exact output shape** before adding a session.

### Why this scraper wins

- 💸 **Cheaper** — $0.40 / 1,000 posts, billed **per post actually returned**. Empty/failed runs cost nothing.
- 🔁 **Account + IP rotation built in** — paste a few throwaway `sessionid` cookies and the actor rotates accounts *and* fresh residential IPs on every block, the same way the expensive providers stay alive.
- 🧹 **Clean, flat records** — one tidy object per post, ready for sheets, dashboards or LLM pipelines.
- 📬 **Built-in Notion delivery** — push every run into Notion via Apify connectors, zero extra code.
- 🚦 **Honest errors** — a clear diagnostic row (`BLOCKED`, `RATE_LIMITED`, `NO_RESULTS`) instead of silent emptiness.

### ⚠️ Requires a logged-in `sessionid` cookie

Instagram gates location feeds behind a login. **Get the cookie (1 min):** log in to instagram.com on a **throwaway account** → `F12` → Application → Cookies → copy the `sessionid` value → paste it into `sessionCookies` (one per line). Add a few accounts for more throughput; the actor rotates between them automatically.

### What you can scrape

| Mode | Input | Returns |
|---|---|---|
| **Location ID** | `locationIds` (e.g. `212988663`) | Top & recent posts at that place |
| **Location URL** | `startUrls` — `/explore/locations/<id>/` | Same, ID parsed from the URL |

### Input

- **`locationIds`** — Instagram location/place IDs (the number in `/explore/locations/<id>/`).
- **`startUrls`** — or paste full `/explore/locations/<id>/` URLs instead.
- **`sessionCookies`** *(required for real data)* — one or more throwaway-account `sessionid` cookies, one per line. Leave empty for a free, labeled **sample** post that shows the output shape.
- **`resultsLimit`** — max posts to return (default `50`, up to `2000`). You pay per post.
- **`proxyConfiguration`** — Residential proxy (required; preconfigured).
- **`notionConnector`** / **`notionParentId`** — optional Notion delivery.

### Output (one record per post)

```json
{
  "type": "image",
  "shortCode": "Cabc123XyZ",
  "url": "https://www.instagram.com/p/Cabc123XyZ/",
  "caption": "Sunset over the bay 🌅 #travel",
  "hashtags": ["travel"],
  "mentions": [],
  "likesCount": 12840,
  "commentsCount": 213,
  "videoViewCount": null,
  "displayUrl": "https://...jpg",
  "videoUrl": null,
  "images": ["https://...jpg"],
  "isVideo": false,
  "dimensions": { "height": 1080, "width": 1080 },
  "ownerUsername": "someaccount",
  "ownerId": "123456789",
  "timestamp": "2024-06-12T14:00:00.000Z",
  "locationId": "212988663"
}
````

`type` is `image`, `video` or `carousel`. Video posts include `videoUrl` and `videoViewCount`; carousels list every frame in `images`.

### Pricing

**$0.40 per 1,000 posts** (`$0.0004` per post, pay-per-result). You are only charged for posts actually returned — empty and failed runs are free.

### FAQ

**Why do I need a cookie?** Instagram location feeds require a logged-in session — there is no keyless endpoint. This is exactly how the paid Instagram scrapers work; the difference is you supply your own throwaway accounts and pay far less.

**Is my main account at risk?** Use a **throwaway** account, never your personal one. The actor rotates accounts and residential IPs to spread requests.

**How do I find a location ID?** Open the place on Instagram — the URL is `/explore/locations/<id>/`. That `<id>` is what goes in `locationIds`.

**Do I need a proxy?** Residential proxy is required and already preconfigured — just run.

**I got a `NO_RESULTS` / `BLOCKED` row — why?** That's the actor telling you exactly what happened instead of failing silently. Add more `sessionCookies` and re-run.

# Actor input Schema

## `locationIds` (type: `array`):

Instagram location/place ids (number in /explore/locations/<id>/).

## `startUrls` (type: `array`):

Or /explore/locations/<id>/ URLs.

## `resultsLimit` (type: `integer`):

Charged per post.

## `sessionCookies` (type: `array`):

IG location data is login-gated. Without a cookie the actor returns ONE labeled SAMPLE post so you can preview the output shape (no charge). To scrape real posts, add one or more throwaway-account sessionid cookies; the actor rotates them. From a logged-in instagram.com: F12 → Application → Cookies → copy the sessionid value. Paste one per line.

## `proxyConfiguration` (type: `object`):

Residential proxy required (preconfigured).

## `notionConnector` (type: `string`):

Optional Notion delivery.

## `notionParentId` (type: `string`):

Optional Notion data-source id.

## Actor input object example

```json
{
  "locationIds": [
    "212988663"
  ],
  "startUrls": [
    "https://www.instagram.com/explore/locations/212988663/"
  ],
  "resultsLimit": 50,
  "sessionCookies": [
    "sessionid=12345%3AAbCd...%3A12%3A..."
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Results in the default dataset.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locationIds": [
        "212988663"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("dami_studio/instagram-location-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "locationIds": ["212988663"] }

# Run the Actor and wait for it to finish
run = client.actor("dami_studio/instagram-location-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locationIds": [
    "212988663"
  ]
}' |
apify call dami_studio/instagram-location-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dami_studio/instagram-location-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Location Scraper - Posts by Place",
        "description": "Scrape Instagram posts by location/place at $0.40 per 1k - cheaper than apidojo. Get captions, likes, comments, media URLs, owner & timestamp. Top & recent posts, multi-cookie rotation, export JSON/CSV/Excel or to Notion. Failed runs cost nothing.",
        "version": "0.1",
        "x-build-id": "dVNocbvg8DpCuxM2S"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dami_studio~instagram-location-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dami_studio-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/dami_studio~instagram-location-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dami_studio-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/dami_studio~instagram-location-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dami_studio-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",
                "properties": {
                    "locationIds": {
                        "title": "Location IDs",
                        "type": "array",
                        "description": "Instagram location/place ids (number in /explore/locations/<id>/).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "startUrls": {
                        "title": "Location URLs",
                        "type": "array",
                        "description": "Or /explore/locations/<id>/ URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "resultsLimit": {
                        "title": "Max posts",
                        "minimum": 1,
                        "maximum": 2000,
                        "type": "integer",
                        "description": "Charged per post.",
                        "default": 50
                    },
                    "sessionCookies": {
                        "title": "Instagram session cookies (required for real data)",
                        "type": "array",
                        "description": "IG location data is login-gated. Without a cookie the actor returns ONE labeled SAMPLE post so you can preview the output shape (no charge). To scrape real posts, add one or more throwaway-account sessionid cookies; the actor rotates them. From a logged-in instagram.com: F12 → Application → Cookies → copy the sessionid value. Paste one per line.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Residential proxy required (preconfigured).",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "notionConnector": {
                        "title": "Notion connector ID (optional)",
                        "type": "string",
                        "description": "Optional Notion delivery."
                    },
                    "notionParentId": {
                        "title": "Notion data-source ID (optional)",
                        "type": "string",
                        "description": "Optional Notion data-source id."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
