# Instagram API | Instagram comments post search creator posts (`socialdatax/socialdatax-instagram-data-api`) Actor

SocialDataX read-only Instagram API for Instagram comments, post search, post details, comment replies, creator profiles, and Instagram creator posts. Results export to Apify Dataset, CSV, Excel, JSON, or API workflows.

- **URL**: https://apify.com/socialdatax/socialdatax-instagram-data-api.md
- **Developed by:** [SocialDataX](https://apify.com/socialdatax) (community)
- **Categories:** Social media, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 9 total users, 1 monthly users, 80.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 dataset items

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram API | Instagram comments post search creator posts

SocialDataX read-only Instagram API for Instagram comments, post search, post details, comment replies, creator profiles, and Instagram creator posts.

Apify users do not need to configure a SocialDataX API Key. The Actor owner configures `SOCIALDATAX_API_KEY` as an Apify secret.

Use this Actor when you need Instagram comments, Instagram comment replies, Instagram post search, Instagram creator posts, creator profile data, or structured results exported to Apify Dataset, CSV, Excel, JSON, or API workflows.

User-post rows expose `is_pinned` (`true` / `false`) in Overview and User posts. An omitted field means the API did not provide it. The Actor preserves the returned order and pagination.

### Support

If a run fails, you need higher limits, or you want to discuss a bulk data workflow, contact SocialDataX support:

- Website: <https://socialdatax.com/ai?from=apify>

### Operations

- `search_tags`: Instagram tag search using `keyword`, with optional `max_items`; one request, no pagination.
- `search_users`: Instagram user search using `keyword`, with optional `page_token`, `max_items`, and `auto_paginate`.
- `search_posts`: Instagram post search using `keyword`.
- `get_post_detail`: Instagram post details using `post_id` or `post_url`.
- `get_post_comments`: Instagram comments using `post_url`.
- `get_post_comment_replies`: Instagram comment replies using `post_id` / `comment_id`.
- `get_user_info`: Instagram creator profile using `username` or `profile_url`.
- `list_user_posts`: Instagram creator posts using `username` or `profile_url`.

### Input tips

- For Instagram comments, paste a public Instagram post URL into `post_url`.
- For Instagram comment replies, first run `get_post_comments`, then copy `post_id` and top-level `comment_id` from the same Dataset row.
- For Instagram creator posts, paste a creator profile URL or provide the `username`.
- For user and post search, use `keyword`, `page_token`, `max_items`, and `auto_paginate`.
- For tag search, use `keyword` and `max_items`; `page_token` and `auto_paginate` do not apply.

### Pagination

Paginated operations use `page_token`, `max_items`, and `auto_paginate`. Each requested page counts as one SocialDataX API request. Results are written to the default Apify Dataset and can be exported as JSON, CSV, Excel / XLSX, or JSONL.

### Example input

```json
{
  "operation": "search_posts",
  "keyword": "camping",
  "page_token": "",
  "max_items": 50,
  "auto_paginate": true
}
```

### Billing

Ongoing use requires an Apify paid plan. Free-plan users get a limited SocialDataX API request trial.

Recommended Apify Pay per event setup:

- `apify-default-dataset-item`: `$0.001 / Dataset item`
- `apify-actor-start`: keep Apify default `$0.00005`
- `Pay per event + usage`: off

### 标签搜索 / Tag search

`operation: "search_tags"`；必填字段：keyword。按关键词查找标签，单次请求，不翻页。

使用 `max_items` 限制输出条数，沿用现有 Dataset 条目计费规则。不使用 `page_token` 或自动翻页。

# Actor input Schema

## `operation` (type: `string`):

Choose the Instagram API operation to run.

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

Search keyword for Instagram content, users, or tags.

## `page_token` (type: `string`):

Opaque pagination token returned by the previous page. Leave empty for the first page.

## `post_id` (type: `string`):

Instagram post ID copied from a Dataset row.

## `post_url` (type: `string`):

Instagram post URL copied from a Dataset row or user input.

## `comment_id` (type: `string`):

Top-level Instagram comment ID.

## `username` (type: `string`):

Instagram username.

## `profile_url` (type: `string`):

Instagram creator profile URL.

## `max_items` (type: `integer`):

Maximum number of Dataset rows for list operations. Larger values may make multiple SocialDataX API requests.

## `auto_paginate` (type: `boolean`):

When enabled, the Actor keeps requesting next pages until max_items is reached or no next page exists.

## Actor input object example

```json
{
  "operation": "search_posts",
  "keyword": "camping",
  "username": "",
  "profile_url": "",
  "max_items": 50,
  "auto_paginate": true
}
```

# Actor output Schema

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

Open flat result rows written to the default Apify Dataset. Export as JSON, CSV, Excel / XLSX, or JSONL.

## `keyValueStore` (type: `string`):

Open the default key-value store. The OUTPUT record contains operation, item count, request count, page-level response summaries, non-fatal warnings, and lightweight failure details when a run fails.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("socialdatax/socialdatax-instagram-data-api").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("socialdatax/socialdatax-instagram-data-api").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 '{}' |
apify call socialdatax/socialdatax-instagram-data-api --silent --output-dataset

```

## MCP server setup

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

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/b5yjYF9YyfZp6VI2q/builds/qd09NPsErjGDXVt78/openapi.json
