# search

POST /v1/search is the search action: find posts or accounts by keyword. It is offered on 16 platforms (TikTok, Instagram, X, Reddit, YouTube, LinkedIn and 10 more), and the platform is a parameter of the request. One call costs 2 to 12 credits, depending on the platform; a call that fails costs nothing.

- Page: https://socialtoai.com/docs/api/search/
- Last updated: 2026-10-17

- POST: `https://api.socialtoai.com/v1/search`

## Request

A JSON body. These are the same for every action; the rest depends on the platform, below.

| Name | Type | Where | Required | What it is |
| --- | --- | --- | --- | --- |
| `platform` | string | body | Yes | The platform to read. One of the platforms this action is offered on. |
| `max_cost_credits` | integer | body | No | The most this call may cost. Over it, the call is refused for free and the answer carries the quote. |
| `Idempotency-Key` | string | header | No | 1 to 255 visible ASCII characters. The same key with the same parameters returns the first result again and is not charged twice. |

## Platforms and credits

Each platform takes its own parameters. Its own page has the full parameter and field tables and a request you can change.

| Platform | Price key | Credits | Required | Optional | Per page |
| --- | --- | --- | --- | --- | --- |
| [TikTok](https://socialtoai.com/tiktok-search-api.md) | `tiktok.search` | 2 | `query` | `sort`, `published_within` | 30 |
| [Instagram](https://socialtoai.com/instagram-search-api.md) | `instagram.search:user` | 3 | `query`, `type=user` | – | 50 |
| [X](https://socialtoai.com/x-search-api.md) | `x.search` | 2 | `query` | `sort` | 20 |
| [Reddit](https://socialtoai.com/reddit-search-api.md) | `reddit.search` | 2 | `query` | `sort`, `published_within` | 25 |
| [YouTube](https://socialtoai.com/youtube-search-api.md) | `youtube.search` | 2 | `query` | `sort`, `published_within` | 100 |
| [LinkedIn](https://socialtoai.com/linkedin-search-api.md) | `linkedin.search` | 2 | `query` | `published_within` | 10 |
| [Threads](https://socialtoai.com/threads-search-api.md) | `threads.search` | 2 | `query` | `since`, `until` | 20 |
| [Pinterest](https://socialtoai.com/pinterest-search-api.md) | `pinterest.search` | 2 | `query` | – | 50 |
| [Xiaohongshu](https://socialtoai.com/xiaohongshu-search-api.md) | `xiaohongshu.search` | 12 | `query` | `sort` | 20 |
| [Douyin](https://socialtoai.com/douyin-search-api.md) | `douyin.search` | 12 | `query` | `sort`, `published_within` | 20 |
| [Weibo](https://socialtoai.com/weibo-search-api.md) | `weibo.search` | 2 | `query` | – | 20 |
| [WeChat Articles](https://socialtoai.com/wechat-search-api.md) | `wechat.search` | 12 | `query` | `sort`, `published_within` | 30 |
| [Bilibili](https://socialtoai.com/bilibili-search-api.md) | `bilibili.search` | 2 | `query` | `sort` | 20 |
| [Zhihu](https://socialtoai.com/zhihu-search-api.md) | `zhihu.search` | 2 | `query` | `type`, `sort` | 20 |
| [Kuaishou](https://socialtoai.com/kuaishou-search-api.md) | `kuaishou.search` | 12 | `query` | – | 20 |
| [WeChat Channels](https://socialtoai.com/wechat-channels-search-api.md) | `wechat_channels.search` | 12 | `query` | `sort`, `published_within` | 20 |

Some platforms have another form of this action, selected by a parameter and priced on its own:

| Platform | Price key | Credits | Selected by |
| --- | --- | --- | --- |
| TikTok | `tiktok.search:user` | 2 | `type=user` |
| X | `x.search:latest` | 2 | `sort=latest` |
| X | `x.search:user` | 5 | `type=user` |
| Xiaohongshu | `xiaohongshu.search:user` | 12 | `type=user` |
| Xiaohongshu | `xiaohongshu.search:image` | 12 | `type=image` |
| Douyin | `douyin.search:user` | 2 | `type=user` |
| Weibo | `weibo.search:user` | 2 | `type=user` |
| Zhihu | `zhihu.search:user` | 2 | `type=user` |

## Parameters

| Name | Type | What it is | Taken by |
| --- | --- | --- | --- |
| `query` | string | Search terms | All |
| `sort` | string | By relevance, by likes, or newest first Values vary by platform: `relevance`, `popular`, `latest` | TikTok, X, Reddit, YouTube, Xiaohongshu, Douyin, WeChat Articles, Bilibili, Zhihu and WeChat Channels |
| `published_within` | string | Only videos posted within this period Values vary by platform: `day`, `week`, `month`, `half_year`, `year` | TikTok, Reddit, YouTube, LinkedIn, Douyin, WeChat Articles and WeChat Channels |
| `since` | datetime | Published on or after this day (filtered by UTC date; the time of day is ignored) | Threads |
| `until` | datetime | Published on or before this day (filtered by UTC date; the time of day is ignored) | Threads |
| `type` | string | Answers only, or articles only; both when left out Values vary by platform: `answer`, `article` | Zhihu |

## Example

TikTok: Find videos by keyword: text, author, likes, comment count, views and publish time.

**cURL**

```
curl https://api.socialtoai.com/v1/search \
  -H "Authorization: Bearer $SOCIALTOAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "query": "space station"
  }'
```

**Python**

```
import os
import requests

response = requests.post(
    "https://api.socialtoai.com/v1/search",
    headers={"Authorization": f"Bearer {os.environ['SOCIALTOAI_KEY']}"},
    json={
        "platform": "tiktok",
        "query": "space station",
    },
)
print(response.json())
```

**Response** (200 OK, 2 credits)

```
{
  "request_id": "req_00000000-0000-4000-8000-000000000001",
  "schema_version": "v1",
  "fetched_at": "2026-10-12T19:17:24.000Z",
  "action": "search",
  "platform": "tiktok",
  "status": "ok",
  "items": [
    {
      "platform": "tiktok",
      "id": "…",
      "ref": "…",
      "approx": [],
      "type": "content",
      "url": "https://example.com/…",
      "format": "video",
      "title": null,
      "text": "…",
      "published_at": "2026-10-11T23:17:34.000Z",
      "author": {
        "id": "…",
        "username": "…",
        "name": "…",
        "verified": null,
        "followers": 92601
      },
      "metrics": {
        "likes": 353,
        "comments": 11,
        "shares": 19,
        "collects": 40,
        "views": 7561,
        "reposts": null
      },
      "images": null,
      "hashtags": ["…", "…"],
      "is_pinned": null
    }
  ],
  "unavailable": ["title", "author.verified", "metrics.reposts", "images", "is_pinned"],
  "page": {
    "has_more": true,
    "cursor": "cur_…",
    "cursor_expires_at": "2026-10-12T19:47:24.000Z"
  },
  "warnings": [],
  "applied_params": {
    "query": "space station"
  },
  "cost_credits": 2,
  "billing": {
    "cost_credits": 2,
    "balance_credits": 98,
    "today_spend_credits": 2,
    "daily_limit_credits": null,
    "daily_remaining_credits": null,
    "display": "This call: 2 credits. Balance: 98 credits."
  },
  "replayed": false
}
```

_Sample data: names, links and text are replaced by placeholders._

## What comes back

The [envelope](https://socialtoai.com/docs/api/response.md) with [`content`](https://socialtoai.com/docs/api/response.md) and [`account`](https://socialtoai.com/docs/api/response.md) items. One call returns one page of up to 30 items; each page is its own call. A cursor works for up to 30 minutes.

A failed call costs 0 credits and says why: see [Errors](https://socialtoai.com/docs/api/errors.md).
