# Instagram Location Scraper - Places, Posts & Directory (`toolzerhub/instagram-places-scraper`) Actor

Six ways to read Instagram's location data: one location's details, posts tagged at it, the country-to-city directory, the city-to-place directory, a name search, and a coordinates search. No other actor in this family reads the location directory.

- **URL**: https://apify.com/toolzerhub/instagram-places-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.40 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 - Places, Posts & Directory

Read Instagram's location data six ways — one place's details, the posts tagged at it, a name or coordinate search, and the country-to-city-to-place directory that nothing else in this family exposes. No login, no cookies.

### Pick a mode

| Mode | Give it | Returns |
|---|---|---|
| Location details | **locationId** | The place record |
| Posts at a location | **locationId** + **tab** | Posts tagged there |
| List cities in a country | **countryCode** | Cities, each with a city ID |
| List places in a city | **cityId** | Places in that city |
| Search locations | **keyword** | Places matching a name |
| Places near a point | **latitude** + **longitude** | Places near those coordinates |

**locationId** accepts the full `instagram.com/explore/locations/…` link, or the number in it on its own.

### Input

| Field | Notes |
|---|---|
| **tab** | `ranked` or `recent` — which ordering of a place's posts to read |
| **countryCode** | Two-letter ISO code — `US`, `GB`, `DE` |
| **cityId** | Looks like `c2753900`, and comes from List cities in a country |
| **Max results** | Per identifier or search term. `0` removes the bound. |
| **Resume from** | Continuation value from an earlier run's log |

### Output

`source_identifier` · `location_name` · `city_name`

### Questions

**How do I get a city ID?**
Only from List cities in a country. Instagram does not show city IDs anywhere in its interface, and they are not guessable — run that mode for your country code, keep the list, and feed the IDs into List places in a city. The two modes are designed to chain.

**ranked or recent?**
`ranked` is Instagram's own ordering — roughly, what it thinks is worth showing. `recent` is chronological. If you are monitoring a venue, use `recent`; if you are sampling what represents a place, use `ranked`.

**Search locations found nothing for a business I can see on Instagram.**
Location search matches Instagram's place names, which are often not the business's trading name — franchises, malls and airports are the usual mismatches. Try Places near a point with the venue's coordinates instead; that ignores names entirely.

**Why is there both a location search and a directory?**
Search answers "what is this place called". The directory answers "what places exist here", which no amount of searching gives you, because you would have to already know the names. Country → cities → places walks it without guessing.

**A location ID returned no row.**
Instagram merges and retires places. A retired ID produces no row rather than an error, and the run ends successfully. Re-find the place with Search locations to get its current ID.

### The rest of the family

[Instagram Hashtag Scraper](https://apify.com/toolzerhub/instagram-hashtag-posts-scraper) — the other way to collect posts about a place.
[Instagram Post, Comments & Likes Scraper](https://apify.com/toolzerhub/instagram-post-comments-likes-scraper) — take any post from a location feed further.
[Instagram Scraper - All In One](https://apify.com/toolzerhub/instagram-all-in-one-scraper) — every mode in this family.

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

## `locationId` (type: `string`):

Paste the location's instagram.com/explore/locations/... link, or just the number in it. You can also get this from the Location actor's "Search locations by name" mode.

## `tab` (type: `string`):

Which ranking of a location's posts to read.

## `countryCode` (type: `string`):

Two-letter ISO country code.

## `cityId` (type: `string`):

A city id from this domain's "List cities in a country" mode (looks like c2753900) — Instagram doesn't show this id anywhere else.

## `keyword` (type: `string`):

The word or phrase to search for.

## `latitude` (type: `number`):

Latitude of the point to search near.

## `longitude` (type: `number`):

Longitude of the point to search near.

## `maxItems` (type: `integer`):

The maximum number of records to save per identifier or search term. A value of 0 removes the bound and the run continues until the source has no more to give.

## `cursor` (type: `string`):

A continuation value from an earlier run — the value the run log prints when it stops. The run continues from there instead of the top. Leave it empty to start at the top. Applies only to a single identifier or search term; a multi-account run uses it for the first one only.

## Actor input object example

```json
{
  "scraperType": "locationInfo",
  "locationId": "212988663",
  "tab": "ranked",
  "countryCode": "US",
  "cityId": "c2753900",
  "keyword": "nasa",
  "latitude": 40.7128,
  "longitude": -74.006,
  "maxItems": 25
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "scraperType": "locationInfo",
    "locationId": "212988663",
    "countryCode": "US",
    "cityId": "c2753900",
    "keyword": "nasa",
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/instagram-places-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 = {
    "scraperType": "locationInfo",
    "locationId": "212988663",
    "countryCode": "US",
    "cityId": "c2753900",
    "keyword": "nasa",
    "maxItems": 25,
}

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

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

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

```

## CLI example

```bash
echo '{
  "scraperType": "locationInfo",
  "locationId": "212988663",
  "countryCode": "US",
  "cityId": "c2753900",
  "keyword": "nasa",
  "maxItems": 25
}' |
apify call toolzerhub/instagram-places-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toolzerhub/instagram-places-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Vxcv4fn9fEKLKzIss/builds/m5zFLWpfJ7PGZ8Fkv/openapi.json
