# Captapi (`xanthic_polygon/captapi`) Actor

Bring your own Captapi API key and pull structured social media data from YouTube, TikTok, Instagram & Facebook — transcripts, AI summaries, comments, stats, search and downloads. Wraps the Captapi REST API (no scraping); 62 operations, one key.

- **URL**: https://apify.com/xanthic\_polygon/captapi.md
- **Developed by:** [Fuat Sezer](https://apify.com/xanthic_polygon) (community)
- **Categories:** Social media, AI, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

## Captapi - Social Media Data (YouTube, TikTok, Instagram, Facebook)

Bring your own **Captapi** API key and pull structured social media data -
transcripts, AI summaries, comments, video/profile stats, search results and
download URLs - from **YouTube, TikTok, Instagram & Facebook**.

This Actor is a thin wrapper: it **calls the official Captapi REST API** and
returns the result. It does **not** scrape. Credits are billed to your own
Captapi account, cached results are free, and failed requests are never charged.

### Get a key

Create a free `capt_live_...` key at
<https://captapi.com/dashboard/api-keys> (100 free credits to start).

### Input

| Field | Required | Notes |
| --- | --- | --- |
| **Captapi API key** | yes | Your `capt_live_...` key (stored encrypted). |
| **Operation** | yes | Which endpoint to call (62 options, grouped by platform). |
| **URL** | most ops | Video / reel / post / channel / profile / playlist / music URL. |
| **Search query** | search ops | Keyword or hashtag (min 2 chars). |
| **Limit** | list ops | Max items to return (billed per result). |
| **Language** | transcripts | ISO code (e.g. `en`); defaults to auto-detect. |
| **Comment ID** | reply ops | Parent comment ID from the comments endpoint. |
| **Country** | trending feed | Two-letter ISO code (e.g. `US`). |
| **Topic** | popular hashtags | Topic/keyword for `tiktok_popular_hashtags`. |

Each operation only uses the fields it needs; the Actor validates required
fields and returns a clear message if one is missing.

### Output

One dataset item:

```json
{
  "operation": "youtube_transcript",
  "ok": true,
  "cached": false,
  "creditsUsed": 2,
  "data": { "...": "the same payload as the REST API" }
}
````

On error, `ok` is `false` with `status` and `error`, and the run fails with the
API's error message.

### Other ways to use Captapi

REST API, MCP server (`@captapi/mcp`), CLI (`@captapi/cli`), an n8n community
node (`n8n-nodes-captapi`), and a Make.com app. See
<https://captapi.com/docs/integrations>.

# Actor input Schema

## `apiKey` (type: `string`):

Your capt\_live\_... key from https://captapi.com/dashboard/api-keys. Stored encrypted. Credits are billed to your own Captapi account.

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

Which Captapi endpoint to call. Each operation needs specific fields below (url, search query, limit, ...).

## `url` (type: `string`):

Content/profile URL for the operation (video, reel, post, channel, profile, playlist, music...). Required by most operations.

## `q` (type: `string`):

Keyword/hashtag for search operations (\*\_search, \*\_hashtag\_search, \*\_user\_search, etc.). Min 2 chars.

## `limit` (type: `integer`):

Max items to return for list/search operations. Defaults and caps vary per operation; billed per result.

## `language` (type: `string`):

Preferred caption language ISO code (e.g. en) for transcript/summarize operations. Optional; defaults to auto-detect.

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

Parent comment ID for \*\_comment\_replies operations (from the comments endpoint).

## `country` (type: `string`):

Two-letter ISO country code (e.g. US, GB, TR) for tiktok\_trending\_feed. Optional.

## `query` (type: `string`):

Topic/keyword for tiktok\_popular\_hashtags. Optional; distinct from the search query field.

## `baseUrl` (type: `string`):

Advanced: override the Captapi API base URL. Leave as default unless self-hosting.

## Actor input object example

```json
{
  "operation": "youtube_transcript",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "baseUrl": "https://api.captapi.com"
}
```

# Actor output Schema

## `result` (type: `string`):

The default dataset containing the structured result of the operation.

# 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 = {
    "operation": "youtube_transcript",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
};

// Run the Actor and wait for it to finish
const run = await client.actor("xanthic_polygon/captapi").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 = {
    "operation": "youtube_transcript",
    "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
}

# Run the Actor and wait for it to finish
run = client.actor("xanthic_polygon/captapi").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 '{
  "operation": "youtube_transcript",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}' |
apify call xanthic_polygon/captapi --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Captapi",
        "description": "Bring your own Captapi API key and pull structured social media data from YouTube, TikTok, Instagram & Facebook — transcripts, AI summaries, comments, stats, search and downloads. Wraps the Captapi REST API (no scraping); 62 operations, one key.",
        "version": "0.1",
        "x-build-id": "eczgVk9ccSJwzla67"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/xanthic_polygon~captapi/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-xanthic_polygon-captapi",
                "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/xanthic_polygon~captapi/runs": {
            "post": {
                "operationId": "runs-sync-xanthic_polygon-captapi",
                "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/xanthic_polygon~captapi/run-sync": {
            "post": {
                "operationId": "run-sync-xanthic_polygon-captapi",
                "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": [
                    "apiKey",
                    "operation"
                ],
                "properties": {
                    "apiKey": {
                        "title": "Captapi API key",
                        "type": "string",
                        "description": "Your capt_live_... key from https://captapi.com/dashboard/api-keys. Stored encrypted. Credits are billed to your own Captapi account."
                    },
                    "operation": {
                        "title": "Operation",
                        "enum": [
                            "youtube_transcript",
                            "youtube_summarize",
                            "youtube_video_details",
                            "youtube_comments",
                            "youtube_channel_details",
                            "youtube_search",
                            "youtube_channel_videos",
                            "youtube_playlist_videos",
                            "youtube_video_download",
                            "youtube_shorts_transcript",
                            "youtube_shorts_summarize",
                            "youtube_shorts_details",
                            "youtube_shorts_comments",
                            "youtube_channel_shorts",
                            "youtube_channel_streams",
                            "youtube_hashtag_search",
                            "youtube_comment_replies",
                            "youtube_channel_playlists",
                            "youtube_community_posts",
                            "tiktok_transcript",
                            "tiktok_summarize",
                            "tiktok_video_details",
                            "tiktok_comments",
                            "tiktok_channel_details",
                            "tiktok_search",
                            "tiktok_video_download",
                            "tiktok_channel_posts",
                            "tiktok_comment_replies",
                            "tiktok_user_followers",
                            "tiktok_user_followings",
                            "tiktok_music_posts",
                            "tiktok_hashtag_search",
                            "tiktok_top_search",
                            "tiktok_user_search",
                            "tiktok_song_details",
                            "tiktok_trending_feed",
                            "tiktok_popular_hashtags",
                            "instagram_transcript",
                            "instagram_summarize",
                            "instagram_details",
                            "instagram_comments",
                            "instagram_channel_details",
                            "instagram_channel_posts",
                            "instagram_channel_reels",
                            "instagram_reels_search",
                            "instagram_video_download",
                            "instagram_tagged_posts",
                            "instagram_music_posts",
                            "instagram_hashtag_search",
                            "instagram_profile_search",
                            "instagram_story_highlights",
                            "instagram_highlights_details",
                            "instagram_embed",
                            "facebook_details",
                            "facebook_transcript",
                            "facebook_summarize",
                            "facebook_comments",
                            "facebook_page_details",
                            "facebook_profile_posts",
                            "facebook_profile_reels",
                            "facebook_group_posts",
                            "facebook_comment_replies"
                        ],
                        "type": "string",
                        "description": "Which Captapi endpoint to call. Each operation needs specific fields below (url, search query, limit, ...)."
                    },
                    "url": {
                        "title": "URL",
                        "type": "string",
                        "description": "Content/profile URL for the operation (video, reel, post, channel, profile, playlist, music...). Required by most operations."
                    },
                    "q": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Keyword/hashtag for search operations (*_search, *_hashtag_search, *_user_search, etc.). Min 2 chars."
                    },
                    "limit": {
                        "title": "Limit",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Max items to return for list/search operations. Defaults and caps vary per operation; billed per result."
                    },
                    "language": {
                        "title": "Language",
                        "type": "string",
                        "description": "Preferred caption language ISO code (e.g. en) for transcript/summarize operations. Optional; defaults to auto-detect."
                    },
                    "comment_id": {
                        "title": "Comment ID",
                        "type": "string",
                        "description": "Parent comment ID for *_comment_replies operations (from the comments endpoint)."
                    },
                    "country": {
                        "title": "Country",
                        "type": "string",
                        "description": "Two-letter ISO country code (e.g. US, GB, TR) for tiktok_trending_feed. Optional."
                    },
                    "query": {
                        "title": "Topic (popular hashtags)",
                        "type": "string",
                        "description": "Topic/keyword for tiktok_popular_hashtags. Optional; distinct from the search query field."
                    },
                    "baseUrl": {
                        "title": "API base URL",
                        "type": "string",
                        "description": "Advanced: override the Captapi API base URL. Leave as default unless self-hosting.",
                        "default": "https://api.captapi.com"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
