# YouTube Channel ID lookup API (youtube.resolve_channel)

- Canonical page: [https://everyinfra.com/en/youtube-api/resolve_channel](https://everyinfra.com/en/youtube-api/resolve_channel?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "youtube", "action": "resolve_channel", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=youtube&action=resolve_channel

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| channel | not declared | yes | not declared | The channel to look up, in any of four forms: a channel link (`https://www.youtube.com/@NASA` or `https://www.youtube.com/channel/UC…`), an @handle, a channel ID that starts with UC, or a channel name. A name is tried as an @handle first, then searched; `matched_by` tells you which. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| channel_id | platform-native meaning |
| username | Username (@handle). |
| name | Name of the object itself, for account, product and business capabilities. |
| url | Link to the record on the platform. |
| channel_url | Channel link built on the channel ID (`youtube.com/channel/UC…`). |
| matched_by | How the channel was matched. Present only when `channel` is a channel name: `handle` (the name matched as an @handle) or `search` (the first channel found by name search; check that it is the channel you wanted). Absent when `channel` is a link, an @handle or a UC channel ID. |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "youtube",
  "action": "resolve_channel",
  "params": {
    "channel": "@NASA"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "youtube",
        "action": "resolve_channel",
        "params": {
            "channel": "@NASA",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:24:23Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "youtube",
  "action": "resolve_channel",
  "results": {
    "channel_id": "UCLA_DiR1FfKNvjuUpBHmylQ",
    "username": "NASA",
    "url": "https://www.youtube.com/@NASA",
    "channel_url": "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ",
    "platform": "youtube"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=youtube
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
