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

- **URL**: https://apify.com/scrapelabsapi/instagram-location-scraper.md
- **Developed by:** [ScrapeLabs](https://apify.com/scrapelabsapi) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

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/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

A powerful Apify actor that scrapes Instagram posts from specific locations, extracting comprehensive post data including images, videos, captions, engagement metrics, and user information. Perfect for location-based social media analysis, competitor research, and content discovery.

Enter Instagram location URLs, usernames, or keywords to scrape posts. The actor will automatically detect the input type and convert usernames/keywords to location URLs. Configure proxy settings if needed.

💬 For custom solutions or feature requests, contact us at dev.scraperengine@gmail.com

### Why Choose Us?

- **Intelligent Proxy Management**: Automatic proxy fallback system ensures reliable data collection even when Instagram blocks requests
- **Comprehensive Data Extraction**: Captures all post details including media URLs, engagement metrics, user profiles, and location data
- **Bulk Processing**: Process multiple locations simultaneously with efficient pagination
- **Production-Ready**: Built with robust error handling, retry logic, and detailed logging
- **Flexible Configuration**: Customize sort order, item limits, and proxy settings to fit your needs
- **Smart Input Detection**: Automatically detects and converts URLs, usernames, or keywords to location URLs

### Key Features

- ✅ **Location-Based Scraping**: Extract posts from any Instagram location page
- ✅ **Multiple Input Types**: Accepts location URLs, usernames, or keywords - automatically converts to location URLs
- ✅ **Smart Proxy Fallback**: Automatically switches from no proxy → datacenter → residential proxy if blocked
- ✅ **Pagination Support**: Automatically handles pagination to extract all available posts
- ✅ **Rich Data Extraction**: 
  - Post metadata (ID, code, URL, creation date)
  - Engagement metrics (likes, comments)
  - Media content (images, videos with quality info)
  - Audio/music information
  - User profile data
  - Location coordinates and details
- ✅ **Sort Options**: Choose between "ranked" (default) or "recent" post sorting
- ✅ **Bulk Input Support**: Process multiple location URLs, usernames, or keywords in a single run
- ✅ **Session Authentication**: Optional session ID support for authenticated requests
- ✅ **Detailed Logging**: Real-time progress updates and error reporting
- ✅ **Structured Output**: Clean JSON format ready for analysis

### Input

The actor accepts the following input parameters:

#### Input Schema

```json
{
  "startUrls": [
    "https://www.instagram.com/explore/locations/213131048/berlin-germany/",
    "mrbeast",
    "berlin"
  ],
  "sortOrder": "ranked",
  "maxComments": 0,
  "maxItems": 100,
  "sessionId": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
````

#### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `startUrls` | Array of Strings | Yes | - | List of Instagram location URLs, usernames, or keywords. Examples: `'https://www.instagram.com/explore/locations/213131048/berlin-germany/'` (URL), `'mrbeast'` (username), `'berlin'` (keyword). The actor automatically detects the input type and converts usernames/keywords to location URLs. |
| `sortOrder` | String | No | `"ranked"` | How to sort posts. Options: `"ranked"` (most popular) or `"recent"` (newest first). |
| `maxComments` | Integer | No | `0` | Maximum number of comments to extract per post. Set to `0` to disable comment extraction. |
| `maxItems` | Integer | No | `100` | Maximum number of posts to extract per location. Set to `0` for unlimited (extracts all available posts). |
| `sessionId` | String | No | `""` | Instagram session ID cookie value (required for authentication). Get this from your browser cookies when logged into Instagram. Leave empty for unauthenticated requests (may have limited access). |
| `proxyConfiguration` | Object | No | `{"useApifyProxy": false}` | Proxy configuration. If `useApifyProxy` is `false`, the actor starts with direct requests. If blocked, it automatically falls back to datacenter and then residential proxies. |

#### Example Input

```json
{
  "startUrls": [
    "https://www.instagram.com/explore/locations/213131048/berlin-germany/",
    "https://www.instagram.com/explore/locations/212988663/new-york-new-york/",
    "mrbeast",
    "paris"
  ],
  "sortOrder": "recent",
  "maxItems": 500,
  "maxComments": 0,
  "sessionId": "your_session_id_here",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

#### Input Types

The actor supports three types of input in the `startUrls` array:

1. **Location URLs**: Full Instagram location page URLs
   - Example: `"https://www.instagram.com/explore/locations/213131048/berlin-germany/"`
   - Used directly without conversion

2. **Usernames**: Instagram usernames (with or without @)
   - Example: `"mrbeast"` or `"@mrbeast"`
   - The actor searches for locations in the user's posts

3. **Keywords**: Location keywords for searching
   - Example: `"berlin"` or `"new york"`
   - The actor searches Instagram for locations matching the keyword

### Output

The actor outputs structured JSON data for each scraped post. All results are saved to the Apify dataset and can be exported in JSON, CSV, or Excel formats.

#### Output Schema

Each post in the output contains the following structure:

```json
{
  "type": "post",
  "id": "3761820491792436654",
  "code": "DQ0q85qEs2u",
  "url": "https://www.instagram.com/p/DQ0q85qEs2u/",
  "createdAt": "2025-11-09T10:52:49Z",
  "likeCount": 1,
  "commentCount": 0,
  "caption": "#esmocongress2025 #berlin #dataize",
  "isAvailable": true,
  "isLikeAndViewCountsDisabled": false,
  "isPinned": false,
  "isPaidPartnership": false,
  "isCarousel": true,
  "isVideo": false,
  "owner": {
    "id": "222741818",
    "username": "sihyun_sung_photography",
    "fullName": "",
    "profilePicUrl": "https://instagram.fdac142-1.fna.fbcdn.net/...",
    "isPrivate": false,
    "isVerified": false
  },
  "location": {
    "id": "1681866845218607",
    "name": "Messe Berlin",
    "city": "",
    "lat": 52.503101530657,
    "lng": 13.272066565882
  },
  "video": null,
  "image": {
    "url": "https://scontent.cdninstagram.com/v/t51.82787-15/...",
    "width": 1440,
    "height": 1440
  },
  "audio": null
}
```

#### Output Fields

| Field | Type | Description |
|-------|------|-------------|
| `type` | String | Always `"post"` for post items |
| `id` | String | Unique Instagram post ID |
| `code` | String | Short code used in post URLs |
| `url` | String | Full URL to the Instagram post |
| `createdAt` | String | ISO 8601 timestamp of when the post was created |
| `likeCount` | Integer | Number of likes on the post |
| `commentCount` | Integer | Number of comments on the post |
| `caption` | String | Post caption text (empty string if no caption) |
| `isAvailable` | Boolean | Whether the post is currently available |
| `isLikeAndViewCountsDisabled` | Boolean | Whether like/view counts are hidden |
| `isPinned` | Boolean | Whether the post is pinned by the user |
| `isPaidPartnership` | Boolean | Whether the post is a paid partnership |
| `isCarousel` | Boolean | Whether the post is a carousel (multiple images/videos) |
| `isVideo` | Boolean | Whether the post contains video content |
| `owner` | Object | User who created the post (see Owner Object below) |
| `location` | Object | Location information (see Location Object below) |
| `video` | Object/null | Video details if post contains video (see Video Object below) |
| `image` | Object/null | Image details if post contains image (see Image Object below) |
| `audio` | Object/null | Audio/music information if available (see Audio Object below) |

##### Owner Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | User's Instagram ID |
| `username` | String | User's Instagram username |
| `fullName` | String | User's full name |
| `profilePicUrl` | String | URL to user's profile picture |
| `isPrivate` | Boolean | Whether the account is private |
| `isVerified` | Boolean | Whether the account is verified |

##### Location Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Location ID |
| `name` | String | Location name |
| `city` | String | City name (if available) |
| `lat` | Float | Latitude coordinate |
| `lng` | Float | Longitude coordinate |

##### Video Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Video ID |
| `url` | String | URL to the video file |
| `width` | Integer | Video width in pixels |
| `height` | Integer | Video height in pixels |
| `duration` | Float | Video duration in seconds |

##### Image Object

| Field | Type | Description |
|-------|------|-------------|
| `url` | String | URL to the image file |
| `width` | Integer | Image width in pixels |
| `height` | Integer | Image height in pixels |

##### Audio Object

| Field | Type | Description |
|-------|------|-------------|
| `id` | String | Audio ID |
| `title` | String | Audio/music title |
| `artist` | String | Artist name |
| `coverArt` | String | URL to cover art image |
| `duration` | Integer | Duration in milliseconds |
| `audioUrl` | String | URL to audio file |

### 🚀 How to Use the Actor (via Apify Console)

1. **Log in to Apify**: Go to <https://console.apify.com> and sign in to your account.

2. **Find the Actor**: Navigate to the **Actors** section and search for "Instagram Location Scraper" or find it in your actor list.

3. **Configure Input**:
   - Click on the actor to open it
   - In the **INPUT** tab, configure your settings:
     - Add one or more Instagram location URLs, usernames, or keywords in the `startUrls` field (as strings, not objects)
     - Choose your preferred `sortOrder` (ranked or recent)
     - Set `maxItems` to limit the number of posts (or 0 for unlimited)
     - Optionally provide a `sessionId` for authenticated requests
     - Configure proxy settings if needed (default: no proxy)

4. **Run the Actor**: Click the **Start** button to begin the scraping process.

5. **Monitor Progress**:
   - Watch real-time logs in the **LOG** tab
   - Monitor proxy fallback events and extraction progress
   - Track the number of posts extracted

6. **Access Results**:
   - Once complete, go to the **OUTPUT** tab
   - View results in the table format
   - Export data as JSON, CSV, or Excel

7. **Export Data**:
   - Click **Export** button
   - Choose your preferred format (JSON, CSV, or Excel)
   - Download the file to your computer

### Best Use Cases

- **Location-Based Marketing Research**: Analyze what content performs well at specific locations
- **Competitor Analysis**: Monitor competitor posts at key business locations
- **Event Monitoring**: Track posts from event venues and locations
- **Tourism Insights**: Understand what visitors post about specific destinations
- **Brand Monitoring**: Track mentions and posts at your business locations
- **Content Discovery**: Find trending content and influencers at specific locations
- **Geographic Analytics**: Analyze posting patterns and engagement by location
- **Social Media Intelligence**: Gather location-based social media data for research
- **User Location Analysis**: Extract locations from specific user profiles

### Frequently Asked Questions

#### How do I find a location URL?

Navigate to the location page on Instagram (either through search or by clicking a location tag on a post), then copy the URL from your browser. The URL format is: `https://www.instagram.com/explore/locations/[LOCATION_ID]/[location-name]/`

Alternatively, you can use a location keyword (e.g., "berlin") and the actor will search for matching locations automatically.

#### Can I use usernames or keywords instead of URLs?

Yes! The actor accepts three types of input:

- **URLs**: Full Instagram location page URLs
- **Usernames**: Instagram usernames (e.g., "mrbeast") - the actor will extract locations from the user's posts
- **Keywords**: Location keywords (e.g., "berlin", "new york") - the actor will search Instagram for matching locations

#### How do I get a session ID?

1. Log in to Instagram in your browser
2. Open Developer Tools (F12)
3. Go to the Application/Storage tab
4. Navigate to Cookies → https://www.instagram.com
5. Find the `sessionid` cookie
6. Copy its value and paste it into the `sessionId` field

**Note**: Session IDs expire after some time. You may need to refresh it periodically.

#### What happens if Instagram blocks my requests?

The actor has intelligent proxy fallback:

1. Starts with direct requests (no proxy) by default
2. If blocked, automatically switches to datacenter proxy
3. If datacenter fails, switches to residential proxy with 3 retries
4. Once residential proxy works, it sticks with it for all remaining requests
5. All proxy transitions are logged for transparency

#### Can I scrape multiple locations at once?

Yes! Simply add multiple URLs, usernames, or keywords to the `startUrls` array. The actor will process each input sequentially.

#### What's the difference between "ranked" and "recent" sort order?

- **ranked**: Shows posts sorted by Instagram's algorithm (most popular/relevant first)
- **recent**: Shows posts sorted by creation date (newest first)

#### How many posts can I extract?

You can set `maxItems` to any number, or `0` for unlimited. The actor will extract all available posts up to your limit. Note that Instagram may have limits on how many posts are available for a location.

#### Do I need to configure proxies?

Not necessarily. The actor starts with no proxy by default. If Instagram blocks your requests, the actor automatically falls back to proxies. However, if you expect high-volume scraping, you may want to enable Apify proxy from the start.

#### How long does scraping take?

Scraping time depends on:

- Number of locations/usernames/keywords
- Number of posts per location
- Instagram's response time
- Whether proxy fallback is needed
- Whether session ID is provided (authenticated requests may be faster)

Typically, 100 posts take 2-5 minutes, but this can vary.

#### Can I extract comments?

The `maxComments` parameter is available in the input schema, but comment extraction requires additional API calls that may not be fully implemented in the current version. Set it to `0` to disable.

#### What data format is the output?

All output is in JSON format, which can be exported as JSON, CSV, or Excel files from the Apify console.

#### Is the actor free to use?

Apify actors consume compute units. Check your Apify plan for pricing details. The actor is optimized to minimize compute usage through efficient pagination and request handling.

#### Do I need a session ID?

A session ID is optional but recommended for:

- Better access to posts (some posts may require authentication)
- More reliable keyword and username searches
- Higher rate limits

Without a session ID, the actor will still work but may have limited access to some content.

### Support and Feedback

If you encounter any issues or have questions:

1. Check the actor logs for detailed error messages
2. Review the proxy fallback logs to understand connection issues
3. Ensure your location URLs are valid and accessible
4. Verify your Apify account has sufficient compute units
5. Try providing a valid session ID if you're having authentication issues

💬 **For custom solutions or feature requests, contact us at dev.scraperengine@gmail.com**

### Cautions

- **Public Data Only**: This actor collects data only from publicly available Instagram location pages. It does not access private accounts or password-protected content.

- **Rate Limiting**: Instagram may implement rate limiting. The actor includes retry logic and proxy fallback to handle this, but very high-volume scraping may still encounter limits.

- **Session ID Security**: Never share your session ID publicly. Treat it like a password. If compromised, log out of Instagram and generate a new session ID.

- **Legal Compliance**: Users are responsible for ensuring their use of this actor complies with:
  - Instagram's Terms of Service
  - Local data protection and privacy laws (GDPR, CCPA, etc.)
  - Copyright and intellectual property laws
  - Any applicable regulations in your jurisdiction

- **Data Usage**: Be mindful of how you use the scraped data. Respect user privacy and do not use data for spam, harassment, or other malicious purposes.

- **API Changes**: Instagram may change their API structure, which could temporarily affect the actor's functionality. The actor is maintained to adapt to such changes.

***

**Note**: This actor is designed for legitimate research, analysis, and business intelligence purposes. Always use scraped data responsibly and in compliance with applicable laws and platform terms of service.

# Actor input Schema

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

List of Instagram location URLs, usernames, or keywords. Examples: 'https://www.instagram.com/explore/locations/213131048/berlin-germany/' (URL), 'mrbeast' (username), 'berlin' (keyword)

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

Maximum number of posts to extract (0 for unlimited)

## `sessionId` (type: `string`):

Instagram session ID cookie value (required for authentication). Get this from your browser cookies when logged into Instagram.

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

Choose which proxies to use. If Instagram rejects the proxy, a residential proxy will be used as a fallback.

## `dateFilterType` (type: `string`):

Select whether to use absolute date or relative time

## `absoluteStartDate` (type: `string`):

Start date in YYYY-MM-DD format. Use this when 'Posts newer than' is set to 'absolute'.

## `absoluteEndDate` (type: `string`):

End date in YYYY-MM-DD format. Use this when 'Posts newer than' is set to 'absolute'. Leave empty for current date.

## `relativeValue` (type: `integer`):

Number of time units. Use this when 'Posts newer than' is set to 'relative'.

## `relativeUnit` (type: `string`):

Unit of time for relative date

## `includeEngagement` (type: `boolean`):

Whether to include engagement metrics like likes, shares, comments count

## `includeVideoMetadata` (type: `boolean`):

Whether to include detailed video metadata like duration, quality, etc.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.instagram.com/explore/locations/213131048/berlin-germany/"
  ],
  "maxItems": 20,
  "sessionId": "",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "dateFilterType": "relative",
  "absoluteStartDate": "",
  "absoluteEndDate": "",
  "relativeValue": 0,
  "relativeUnit": "days",
  "includeEngagement": true,
  "includeVideoMetadata": true
}
```

# 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 = {
    "startUrls": [
        "https://www.instagram.com/explore/locations/213131048/berlin-germany/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "relativeValue": 0,
    "includeEngagement": true,
    "includeVideoMetadata": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapelabsapi/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 = {
    "startUrls": ["https://www.instagram.com/explore/locations/213131048/berlin-germany/"],
    "proxyConfiguration": { "useApifyProxy": False },
    "relativeValue": 0,
    "includeEngagement": True,
    "includeVideoMetadata": True,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapelabsapi/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 '{
  "startUrls": [
    "https://www.instagram.com/explore/locations/213131048/berlin-germany/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "relativeValue": 0,
  "includeEngagement": true,
  "includeVideoMetadata": true
}' |
apify call scrapelabsapi/instagram-location-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Location Posts Scraper",
        "version": "0.1",
        "x-build-id": "XsFXmyJctuPzuYqXB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapelabsapi~instagram-location-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapelabsapi-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/scrapelabsapi~instagram-location-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapelabsapi-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/scrapelabsapi~instagram-location-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapelabsapi-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": "List of Instagram location URLs, usernames, or keywords. Examples: 'https://www.instagram.com/explore/locations/213131048/berlin-germany/' (URL), 'mrbeast' (username), 'berlin' (keyword)",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxItems": {
                        "title": "📦 Maximum Items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of posts to extract (0 for unlimited)",
                        "default": 20
                    },
                    "sessionId": {
                        "title": "🔐 Instagram Session ID",
                        "type": "string",
                        "description": "Instagram session ID cookie value (required for authentication). Get this from your browser cookies when logged into Instagram.",
                        "default": ""
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy Configuration",
                        "type": "object",
                        "description": "Choose which proxies to use. If Instagram rejects the proxy, a residential proxy will be used as a fallback."
                    },
                    "dateFilterType": {
                        "title": "⏳ Posts Newer Than",
                        "enum": [
                            "absolute",
                            "relative"
                        ],
                        "type": "string",
                        "description": "Select whether to use absolute date or relative time",
                        "default": "relative"
                    },
                    "absoluteStartDate": {
                        "title": "📅 Start Date",
                        "pattern": "^(|\\d{4}-\\d{2}-\\d{2})$",
                        "type": "string",
                        "description": "Start date in YYYY-MM-DD format. Use this when 'Posts newer than' is set to 'absolute'.",
                        "default": ""
                    },
                    "absoluteEndDate": {
                        "title": "📅 End Date",
                        "pattern": "^(|\\d{4}-\\d{2}-\\d{2})$",
                        "type": "string",
                        "description": "End date in YYYY-MM-DD format. Use this when 'Posts newer than' is set to 'absolute'. Leave empty for current date.",
                        "default": ""
                    },
                    "relativeValue": {
                        "title": "🔢 Relative Value",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Number of time units. Use this when 'Posts newer than' is set to 'relative'.",
                        "default": 0
                    },
                    "relativeUnit": {
                        "title": "🕒 Time Unit",
                        "enum": [
                            "days",
                            "weeks",
                            "months",
                            "years"
                        ],
                        "type": "string",
                        "description": "Unit of time for relative date",
                        "default": "days"
                    },
                    "includeEngagement": {
                        "title": "💬 Include Engagement Metrics",
                        "type": "boolean",
                        "description": "Whether to include engagement metrics like likes, shares, comments count",
                        "default": true
                    },
                    "includeVideoMetadata": {
                        "title": "🎥 Include Video Metadata",
                        "type": "boolean",
                        "description": "Whether to include detailed video metadata like duration, quality, etc.",
                        "default": true
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
