> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> Unified asynchronous social data collection API.

# API

The API provides a consistent request flow for social data collection:

```text theme={"system"}
submit -> task_id -> task status/results/files
```

## Authentication

```http theme={"system"}
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## Submit Endpoints

Each product API has its own resource path:

| Platform | API | Endpoint |
| - | - | - |
| Instagram | Posts | `POST /v1/instagram/posts` |
| Instagram | Comments | `POST /v1/instagram/comments` |
| Instagram | Reels | `POST /v1/instagram/reels` |
| Instagram | Search | `POST /v1/instagram/search` |
| Instagram | Followers Count | `POST /v1/instagram/followers-count` |
| Facebook | Pages | `POST /v1/facebook/pages` |
| Facebook | Posts | `POST /v1/facebook/posts` |
| Facebook | Comments | `POST /v1/facebook/comments` |
| Facebook Marketplace | Location Search | `POST /v1/facebook-marketplace/location-search` |
| Facebook Marketplace | Search | `POST /v1/facebook-marketplace/search` |
| Facebook Marketplace | Item | `POST /v1/facebook-marketplace/item` |
| Facebook Ad Library | Search | `POST /v1/facebook-ad-library/search` |
| Facebook Ad Library | Company Search | `POST /v1/facebook-ad-library/company-search` |
| Facebook Ad Library | Company Ads | `POST /v1/facebook-ad-library/company-ads` |
| Facebook Ad Library | Ad | `POST /v1/facebook-ad-library/ad` |
| YouTube | Channels | `POST /v1/youtube/channels` |
| YouTube | Videos | `POST /v1/youtube/videos` |
| YouTube | Channel Videos | `POST /v1/youtube/channel-videos` |
| YouTube | Comments | `POST /v1/youtube/comments` |
| YouTube | Shorts | `POST /v1/youtube/shorts` |
| YouTube | Search | `POST /v1/youtube/search` |
| YouTube | Transcripts | `POST /v1/youtube/transcripts` |
| TikTok | Profiles | `POST /v1/tiktok/profiles` |
| TikTok | Videos | `POST /v1/tiktok/videos` |
| TikTok | Comments | `POST /v1/tiktok/comments` |
| TikTok | Search | `POST /v1/tiktok/search` |
| TikTok | Hashtags | `POST /v1/tiktok/hashtags` |
| TikTok Shop | Search | `POST /v1/tiktok-shop/search` |
| TikTok Shop | Products | `POST /v1/tiktok-shop/products` |
| TikTok Shop | Product | `POST /v1/tiktok-shop/product` |
| TikTok Shop | Product Reviews | `POST /v1/tiktok-shop/product-reviews` |
| TikTok Shop | User Showcase | `POST /v1/tiktok-shop/user-showcase` |
| X | Profiles | `POST /v1/x/profiles` |
| X | Posts | `POST /v1/x/posts` |
| X | User Posts | `POST /v1/x/user-posts` |
| X | Search | `POST /v1/x/search` |
| LinkedIn | Profiles | `POST /v1/linkedin/profiles` |
| LinkedIn | Companies | `POST /v1/linkedin/companies` |
| LinkedIn | Posts | `POST /v1/linkedin/posts` |
| LinkedIn | Jobs | `POST /v1/linkedin/jobs` |
| Reddit | Posts | `POST /v1/reddit/posts` |
| Reddit | Comments | `POST /v1/reddit/comments` |
| Reddit | Subreddit Posts | `POST /v1/reddit/subreddit-posts` |
| Reddit | Search | `POST /v1/reddit/search` |
| Pinterest | Profiles | `POST /v1/pinterest/profiles` |
| Pinterest | Pins | `POST /v1/pinterest/pins` |
| Pinterest | User Pins | `POST /v1/pinterest/user-pins` |
| Pinterest | Search | `POST /v1/pinterest/search` |
| Threads | Profiles | `POST /v1/threads/profiles` |
| Threads | Posts | `POST /v1/threads/posts` |
| Threads | User Posts | `POST /v1/threads/user-posts` |
| Instagram | Reels Search | `POST /v1/instagram/reels-search` |
| Instagram | Audio Reels | `POST /v1/instagram/audio-reels` |
| Instagram | Post Info | `POST /v1/instagram/post-info` |
| Instagram | Trending Reels | `POST /v1/instagram/trending-reels` |
| Instagram | Story Highlights | `POST /v1/instagram/story-highlights` |
| Instagram | Highlight Items | `POST /v1/instagram/highlight-items` |
| Facebook | Profiles | `POST /v1/facebook/profiles` |
| Facebook | Profile Photos | `POST /v1/facebook/profile-photos` |
| Facebook | Reels | `POST /v1/facebook/reels` |
| Facebook | Comment Replies | `POST /v1/facebook/comment-replies` |
| Facebook | Profile Events | `POST /v1/facebook/profile-events` |
| Facebook | Event Details | `POST /v1/facebook/event-details` |
| Facebook | Ad Transcript | `POST /v1/facebook/ad-transcript` |
| Facebook | Company Reviews | `POST /v1/facebook/company-reviews` |
| YouTube | Comment Replies | `POST /v1/youtube/comment-replies` |
| YouTube | Community Posts | `POST /v1/youtube/community-posts` |
| YouTube | Hashtag Search | `POST /v1/youtube/hashtag-search` |
| YouTube | Channel Live Videos | `POST /v1/youtube/channel-live-videos` |
| TikTok | Followers List | `POST /v1/tiktok/followers-list` |
| TikTok | Following List | `POST /v1/tiktok/following-list` |
| TikTok | Comment Replies | `POST /v1/tiktok/comment-replies` |
| TikTok | User Videos | `POST /v1/tiktok/user-videos` |
| X | Followers List | `POST /v1/x/followers-list` |
| X | Following List | `POST /v1/x/following-list` |
| X | Post Replies | `POST /v1/x/post-replies` |
| X | Post Quotes | `POST /v1/x/post-quotes` |
| X | Post Retweeters | `POST /v1/x/post-retweeters` |
| X | Trends | `POST /v1/x/trends` |

## Common Submit Body

Input fields are sent directly in the JSON body.

```json theme={"system"}
{
  "urls": ["https://www.instagram.com/p/POST_CODE/"],
  "results_limit": 10,
  "callback_url": "https://your-domain.com/webhook"
}
```

`callback_url` is optional. If provided, SocQ sends a POST request after the task reaches a terminal state. See [Callbacks](https://docs.socq.ai/api-manual/agent-api/callbacks.md) for the payload shape.

Direct REST submissions default to `request_source="rest"`. Agent Skills using REST as a fallback send `X-Socq-Source: skill-rest`; the value is returned by the task detail endpoint for attribution.

## Use the same endpoint through MCP or CLI

Every REST collection endpoint has a stable endpoint ID, typed MCP tool, and CLI command. The JSON request fields remain the same:

| Interface | YouTube comments example | Where the JSON body goes |
| - | - | - |
| REST | `POST /v1/youtube/comments` | HTTP request body |
| Compact MCP | `socq_execute`, endpoint `youtube/comments` | Nested `input` object |
| Typed MCP | `socq_youtube_comments` | Top-level tool arguments |
| CLI | `socq youtube comments` | Command flags or `--input-file` |

```text theme={"system"}
POST /v1/youtube/comments
          -> endpoint: youtube/comments
          -> tool: socq_youtube_comments
          -> CLI: socq youtube comments
```

Each endpoint page shows its exact mapping. See [MCP quickstart](https://docs.socq.ai/integrations/mcp.md) for a complete submit, poll, paginate, and result example.

## Result Storage

SocQ stores two forms of results:

| Storage | Purpose |
| - | - |
| Normalized records | Returned by `/v1/tasks/{task_id}` after the task succeeds |
| Raw JSONL file | Download from `/v1/tasks/{task_id}/files` |

Raw files use this path format:

```text theme={"system"}
agent-results/{task_id}/raw_jsonl.jsonl.gz
```

## Billing

Agent APIs are billed by returned result record. The submit request may reserve credits from `results_limit` or the number of submitted URLs/usernames; after the task finishes, SocQ settles the final charge from the actual `result_count` and returns any unused reserved credits. Comments endpoints do not accept `results_limit` and are billed from the actual number of comments returned.

Each capability entry exposes its current billing unit and credit price. Before a large collection, check the capability entry and use the account tool for your interface:

* MCP: `socq_account`
* CLI: `socq account`

A `402` response means the account has insufficient credits. API-key credit and request limits are independent of the account balance; see [Authentication](https://docs.socq.ai/api-manual/agent-api/authentication.md) and [Errors](https://docs.socq.ai/api-manual/agent-api/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.