> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nephia.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Youtube

> What a keyword captures on Youtube, and what arrives in each event.

## Coverage

A search on Youtube polls **either** a text search **or** a channel's uploads: provide `query` **or** `channel` (handle or id), not both. Both at once returns **400**. `channel` is this Source's own criterion: on the keyword it goes in the search's `overrides.filters` (see [Keywords](/keywords#create)).

Interval: **60 to 86400** seconds. At most **20** active Youtube searches per Account. Each tick costs **5 credits**, see [Credits](/credits#polling).

## What an event carries

The first tick establishes a silent baseline and emits nothing. Later ticks emit `video.created` with the full video object. `webhookUrl` is optional: without it the keyword still records every match, readable through `GET /v1/keywords/{id}/events` in the same shape. See [Webhooks](/webhooks#replay).

```bash theme={null}
curl -X POST https://api.nephia.cc/v1/keywords \
  -H "x-api-key: $NEPHIA_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Acme on Youtube",
    "refreshIntervalSeconds": 300,
    "globalCriteria": { "market": "global", "query": "acme review" },
    "sources": [{ "source": "youtube", "enabled": true }],
    "webhookUrl": "https://example.com/hooks/nephia"
  }'
```

Following one channel's uploads instead:

```bash theme={null}
curl -X POST https://api.nephia.cc/v1/keywords \
  -H "x-api-key: $NEPHIA_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "MKBHD uploads",
    "refreshIntervalSeconds": 900,
    "globalCriteria": { "market": "global" },
    "sources": [
      {
        "source": "youtube",
        "enabled": true,
        "searches": [
          {
            "overridesEnabled": true,
            "overrides": {
              "filters": {
                "channel": "@mkbhd"
              }
            }
          }
        ]
      }
    ]
  }'
```

## Limits

Comments, captions and transcripts are not search criteria: a keyword tracks what is *published*, on a search or a channel. A video that is deleted or made private after capture keeps its recorded event.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.