# Instagram Location Posts Scraper (`khadinakbar/instagram-location-posts-scraper`) Actor

Scrape public Instagram posts tagged to a location or place. Use for local-market research, venue UGC, and geo-influencer discovery. Returns one row per post with URL, caption, likes, owner, and source location. $0.003 per saved post.

- **URL**: https://apify.com/khadinakbar/instagram-location-posts-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, MCP servers
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 location post scrapeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Posts Scraper

Scrape **public Instagram posts tagged to a location or place**. Give the actor a location URL, numeric location ID, or a place name, and it returns structured post rows with URLs, captions, engagement, owner, and the source location. Built for local-market research, venue UGC, geo-influencer discovery, and MCP / AI-agent calls.

Designed for operators who already know the venue and want the public place feed as JSON. After you collect venue posts, continue with [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper) to enrich owner bios, then pair it with [Google Maps Leads Scraper](https://apify.com/khadinakbar/google-maps-leads-scraper) when you also need the business listing and emails for that same place.

### What data can Instagram Location Posts Scraper extract?

| Field | Type | Description |
|-------|------|-------------|
| `id` / `shortcode` / `url` | string | Post identity and canonical Instagram URL |
| `post_type` | string | `IMAGE`, `VIDEO`, `CAROUSEL_ALBUM`, `REEL`, or `UNKNOWN` |
| `caption` | string | Caption text when Instagram exposes it |
| `hashtags` / `mentions` | array | Parsed from the caption |
| `like_count` / `comment_count` | integer | Engagement counts when present |
| `thumbnail_url` / `display_url` / `media_urls` | string | Public media URLs |
| `owner_username` / `owner_full_name` / `owner_is_verified` | mixed | Author identity |
| `location_name` / `location_id` | string | Location tag on the post |
| `source_location_id` / `source_location_slug` | string | Location you asked the actor to scrape |
| `source_lookup_type` | string | `url`, `id`, or `query` |
| `timestamp` | string | Publish time, ISO 8601 when available |
| `scraped_at` | string | Collection time, ISO 8601 |

You can download the dataset as JSON, CSV, Excel, or HTML from the Output tab. `OUTPUT` and `RUN_SUMMARY` record the run outcome (`COMPLETE`, `PARTIAL`, `VALID_EMPTY`, `INVALID_INPUT`, `UPSTREAM_FAILED`, `CONFIG_ERROR`) plus `itemsPushed`.

### Best fit

Use this Actor when the job is **posts on a public Instagram place page**. It works well for venue UGC audits, neighborhood content calendars, and geo-influencer shortlists.

- For profile timelines, start with [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper) when you already have usernames.
- For hashtag feeds, then use [Instagram Hashtag Scraper](https://apify.com/khadinakbar/instagram-hashtag-scraper) when the brief is a tag rather than a place.
- For Reels by profile, continue with [Instagram Reels Scraper](https://apify.com/khadinakbar/instagram-reels-scraper) after you have creator handles from this place feed.

### How to scrape Instagram posts by location

1. Open the actor Input tab.
2. Paste one or more Instagram location URLs such as `https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/`. You can also pass numeric location IDs or free-text place names.
3. Set **Max Posts Per Target** (quality sample uses `3`; default is `50`).
4. Keep residential proxies on (default).
5. Click **Start**. Results appear in the dataset as soon as posts are saved.

#### Example input

```json
{
  "locationUrls": [
    "https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"
  ],
  "maxPostsPerTarget": 3,
  "includeRecentComments": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Sample output

```json
{
  "id": "CxABCde1234",
  "shortcode": "CxABCde1234",
  "url": "https://www.instagram.com/p/CxABCde1234/",
  "post_type": "IMAGE",
  "caption": "Sunset in Times Square",
  "like_count": 1284,
  "owner_username": "exampleuser",
  "source_location_id": "212988663",
  "source_lookup_type": "url",
  "scraped_at": "2026-08-18T09:37:50.000Z"
}
```

Public location pages sometimes serve post shortcodes and URLs from HTML while withholding GraphQL captions and like counts. Those rows still include `url`, `shortcode`, and `source_location_id` so you can open or enrich the post next.

### Workflow: from a venue URL to a UGC shortlist

A local-marketing lead starts with one Times Square location URL, sets `maxPostsPerTarget` to 20, and runs this Actor. They then export the dataset, compare `owner_username` values, and pass the strongest creators into [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper) for bios and follower counts. Schedule the same saved input weekly to watch new venue tags. Next, feed place names that also need emails into [Google Maps Leads Scraper](https://apify.com/khadinakbar/google-maps-leads-scraper).

### Pricing — Pay per event + platform usage

| Event | Price | Charged when |
|-------|-------|-------------|
| Actor start (`apify-actor-start`) | $0.00005 | Once per run, scaled by RAM (one event per GB) |
| Location post scraped (`scraped-post`) | **$0.003** | Each saved dataset row |

Example: 100 saved posts on the default 2048 MB run is about $0.30 in `scraped-post` events plus two start events, then platform usage (compute and residential proxy). Only saved rows are billed. Empty matches finish `VALID_EMPTY` with zero `scraped-post` charges.

After a test run, then check the live [Pricing tab](https://apify.com/khadinakbar/instagram-location-posts-scraper/pricing) for current Pay per event plus platform usage on your plan.

### API example

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~instagram-location-posts-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locationUrls": ["https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"],
    "maxPostsPerTarget": 20,
    "includeRecentComments": false
  }'
```

Results land in the run's default dataset. Paginate with `offset` / `limit` on `https://api.apify.com/v2/datasets/{datasetId}/items?clean=true`. The same actor is exposed through Apify MCP as `apify--instagram-location-posts-scraper`.

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('khadinakbar/instagram-location-posts-scraper').call({
    locationUrls: ['https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/'],
    maxPostsPerTarget: 20,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Use with AI agents through Apify MCP

> Scrape public Instagram posts tagged to Times Square. Use khadinakbar/instagram-location-posts-scraper with locationUrls set to the Times Square explore URL, maxPostsPerTarget 20, and includeRecentComments false. Return post URL, caption, likes, owner username, source location id, dataset rows, OUTPUT outcome, provenance (source URL + scraped\_at), and confirm the $0.003 per-post cost. Read back the default dataset when the Actor completes.

Agents should keep `maxPostsPerTarget` bounded, treat `OUTPUT.outcome` as the machine contract, and paginate large result sets with `offset`/`limit` on the dataset items endpoint. Scope is public location/place feeds.

### Best results

- Provide a **location URL or numeric ID** when you already have it; place-name queries resolve through Instagram search and work best with a distinctive venue plus city.
- Start with `maxPostsPerTarget: 3` to confirm the place, then raise the cap.
- Keep residential proxies on. Public location pages are the source of truth for this actor.
- Confirm `source_location_id` on the first rows before a large run so the resolved venue matches the brief.

### Builder's note

I built this after watching Instagram withhold GraphQL location-feed payloads on public place pages while still embedding post `"code"` shortcodes in the HTML. I found that intercepting `/api/v1/locations/`, `/api/v1/feed/location/`, and GraphQL first, then recovering shortcodes of length 8+ from the page, is what turns a hollow `VALID_EMPTY` into a usable UGC shortlist. In my testing, charging `scraped-post` before `pushData` kept billing aligned with saved rows once Pay per event was enabled.

### Related actors

- [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper) — use when the job is profile timelines or direct post URLs rather than a place page
- [Instagram Hashtag Scraper](https://apify.com/khadinakbar/instagram-hashtag-scraper) — use when the brief is a hashtag feed
- [Instagram Reels Scraper](https://apify.com/khadinakbar/instagram-reels-scraper) — then collect Reels after you have creator handles from this place feed
- [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper) — enrich owner bios and follower counts after you shortlist venue posters
- [Google Maps Leads Scraper](https://apify.com/khadinakbar/google-maps-leads-scraper) — pair it with this actor when you also need B2B place emails for the same venue

### Legal disclaimer

This actor collects publicly available Instagram data. You are responsible for complying with Instagram's Terms of Service, applicable privacy laws (including GDPR and CCPA), and any other regulations. Use the data only with a lawful basis and in line with responsible-use rules for outreach.

# Actor input Schema

## `locationUrls` (type: `array`):

Instagram location/place page URLs, one per line. Example: https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/

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

Instagram numeric location IDs. Useful when you already know the place ID.

## `locationQueries` (type: `array`):

Free-text place queries (e.g. "Times Square", "Eiffel Tower Paris"). The actor resolves these to Instagram location IDs before scraping.

## `maxPostsPerTarget` (type: `integer`):

Maximum number of posts to scrape per resolved location.

## `onlyPostsNewerThan` (type: `string`):

Skip posts older than this date. Accepts absolute dates (YYYY-MM-DD) or relative dates (e.g. '7 days', '2 months', '1 year').

## `includeRecentComments` (type: `boolean`):

When enabled, includes up to 5 recent comments per post in the output. Slightly increases scraping time.

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

Proxy settings. Residential proxies are recommended for Instagram — datacenter IPs are often blocked. Leave as default to use Apify's residential proxy pool.

## Actor input object example

```json
{
  "locationUrls": [
    "https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"
  ],
  "locationIds": [],
  "locationQueries": [],
  "maxPostsPerTarget": 3,
  "includeRecentComments": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `scrapedPosts` (type: `string`):

All scraped Instagram location posts with post metadata and source location fields.

# 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 = {
    "locationUrls": [
        "https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"
    ],
    "locationIds": [],
    "locationQueries": [],
    "maxPostsPerTarget": 3,
    "includeRecentComments": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/instagram-location-posts-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 = {
    "locationUrls": ["https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"],
    "locationIds": [],
    "locationQueries": [],
    "maxPostsPerTarget": 3,
    "includeRecentComments": False,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/instagram-location-posts-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 '{
  "locationUrls": [
    "https://www.instagram.com/explore/locations/212988663/times-square-new-york-city/"
  ],
  "locationIds": [],
  "locationQueries": [],
  "maxPostsPerTarget": 3,
  "includeRecentComments": false
}' |
apify call khadinakbar/instagram-location-posts-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/instagram-location-posts-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/p0TTLh3Hxz17I404J/builds/rtK0839AuVzIU3zeY/openapi.json
