# Threads / Search

Search public posts by query (Threads returns a small batch per call).

```
GET /api/v1/threads/search
```

Auth: `Authorization: Bearer <SOCIFY_KEY>`  
Credits: 3 credits per request

## Parameters

| Name | Required | Description | Example |
|------|----------|-------------|---------|
| `query` | yes | Search text. | `ferrari` |
| `sorting` | no | 0 = top, 1 = recent. Defaults to 0. | `0` |

## Example

```bash
curl -s 'https://trysocify.com/api/v1/threads/search?query=ferrari&sorting=0' \
  -H "Authorization: Bearer $SOCIFY_KEY"
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `[].node.thread.thread_items[].post.pk` | string | Post id. |
| `[].node.thread.thread_items[].post.user.username` | string | Author. |
| `[].node.thread.thread_items[].post.like_count` | number | Like count. |
## Sample response

Successful lookups wrap the payload in `{ ok, platform, resource, params, data, meta }`. `data` is shown below.

```json
{
  "ok": true,
  "platform": "threads",
  "resource": "search",
  "params": {
    "query": "ferrari",
    "sorting": "0"
  },
  "data": [
    {
      "node": {
        "thread": {
          "thread_items": [
            {
              "post": {
                "caption": {
                  "text": "Example post about ferrari."
                },
                "like_count": 158,
                "pk": "3455813358522634884",
                "user": {
                  "username": "amahnke"
                }
              }
            }
          ]
        }
      }
    }
  ],
  "meta": {
    "credits_charged": 3,
    "latency_ms": 420,
    "platform": "threads",
    "resource": "search",
    "path": "/api/v1/threads/search"
  }
}
```

## Links

- HTML docs: https://trysocify.com/docs/api/threads/search
- SEO page: https://trysocify.com/threads/search
- OpenAPI: https://trysocify.com/openapi.json
- Catalog: https://trysocify.com/catalog.json
