# YouTube / YouTube Search

Search public YouTube videos by keyword.

```
GET /api/v1/youtube/search
```

Auth: `Authorization: Bearer <SOCIFY_KEY>`  
Credits: 1 credit per request

## Parameters

| Name | Required | Description | Example |
|------|----------|-------------|---------|
| `keyword` | yes | Search text. | `magic` |
| `depth` | no | Pages to fetch. Defaults to 1. | `1` |

## Example

```bash
curl -s 'https://trysocify.com/api/v1/youtube/search?keyword=magic&depth=1' \
  -H "Authorization: Bearer $SOCIFY_KEY"
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `videos` | array | Matching videos for this page. |
## Sample response

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

```json
{
  "ok": true,
  "platform": "youtube",
  "resource": "search",
  "params": {
    "keyword": "magic",
    "depth": "1"
  },
  "data": {
    "videos": [
      {
        "channel": "Example Channel",
        "title": "Magic tricks compilation",
        "videoId": "abc123"
      }
    ]
  },
  "meta": {
    "credits_charged": 1,
    "latency_ms": 420,
    "platform": "youtube",
    "resource": "search",
    "path": "/api/v1/youtube/search"
  }
}
```

## Links

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