# YouTube Shorts API (youtube.shorts)

- Canonical page: https://everyinfra.com/en/youtube-api/shorts
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "youtube", "action": "shorts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- 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=shorts

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | The channel handle (optional leading @) required by the followers and shorts actions. The followers action returns aggregate subscriber counts rather than user lists. The shorts action prioritizes handles and does not treat UC... channel IDs as identical identifiers. |
| channel | not declared | no | not declared | A compatibility alias for specifying a channel handle. Full /channel/UC... URLs may fail to parse across helper utilities, so prefer passing a handle or using the URL parameter explicitly provided by the action. |
| since | not declared | no | not declared | The lower date bound for filtering channel videos, Shorts, or comments. It applies to those lists only. |
| sort | enum: newest / oldest / popular | no | not declared | The sort order applied across YouTube actions. For search, accepted values are relevance, newest, most_viewed, and top_rated. For channel videos and Shorts, accepted values are newest, oldest, and popular. For comments, accepted values are newest and popular. Specifying this parameter on a single-video query does not filter that video's content. |
| limit | integer (1–100) | no | 20 | The most rows to return in this call, an integer from 1 to 100. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| url | Link to the record on the platform. |
| title | Title. null when the platform has no titles (for example text-only posts). |
| thumbnail_url | Thumbnail link, lower resolution than image_url. |
| view_count | Views or plays. null means not disclosed, not 0. |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| duration | platform-native meaning |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| author_name | Author's display name. |
| author_id | Author's unique ID on the platform. |
| author_url | Link to the author's profile on the platform. |
| 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": "shorts",
  "params": {
    "username": "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": "shorts",
        "params": {
            "username": "NASA",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "youtube",
  "action": "shorts",
  "results": [
    {
      "id": "QP5Fs3AYuWE",
      "url": "https://www.youtube.com/shorts/QP5Fs3AYuWE",
      "title": "2026 Total Solar Eclipse Over Spain",
      "thumbnail_url": "https://i.ytimg.com/vi/QP5Fs3AYuWE/maxresdefault.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYZSBlKGUwDw==&rs=AOn4CLAT9U1JJD_l2_VOJY3iTy0h7-Tq1w",
      "view_count": 180984,
      "like_count": 5500,
      "duration": "00:00:35",
      "posted_at": "2026-08-12T19:08:21+00:00",
      "author_name": "NASA",
      "author_id": "•••",
      "author_url": "https://www.youtube.com/•••",
      "platform": "youtube"
    },
    {
      "id": "VV_JW4iCni0",
      "url": "https://www.youtube.com/shorts/VV_JW4iCni0",
      "title": "NASA Moon Base Update (Aug. 4, 2026)",
      "thumbnail_url": "https://i.ytimg.com/vi/VV_JW4iCni0/maxres2.jpg?sqp=-oaymwEoCIAKENAF8quKqQMcGADwAQH4AbYIgAKAD4oCDAgAEAEYZSBlKFIwDw==&rs=AOn4CLAcXNzw0zOj2WxgVF5ZilzIObMHRg",
      "view_count": 183127,
      "like_count": 5700,
      "duration": "00:00:32",
      "posted_at": "2026-08-04T16:18:07+00:00",
      "author_name": "NASA",
      "author_id": "•••",
      "author_url": "https://www.youtube.com/•••",
      "platform": "youtube"
    }
  ],
  "count": 20,
  "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
