Documentation
YouTube Connector
Index the transcripts of a YouTube channel or of hand-picked videos, so the assistant answers from what was actually said instead of from the video description.
Prerequisites
- A public YouTube channel, or the URLs of the videos to index
- The videos must carry captions: automatic captions are enough
- An Apify API key, configured once on the server
Data ingested
When you connect YouTube, the following content becomes searchable. Every answer that uses it cites it.
| Content | What is kept |
|---|---|
| Transcripts | The spoken text of each video, in the language asked for, automatic captions included |
| Video metadata | Title, channel name, language and duration are kept as a header above the transcript |
| Video list | The most recent videos of the channel, up to `max_videos` (200 by default, 1000 at most) |
Setup
Configuration happens in the dashboard, under Integrations. No API call is needed for a normal setup.
Configure the key on the server
Add `APIFY_API_KEY=apify_api_…` to the service environment, then restart the API. Several keys can be listed as `APIFY_API_KEY_2`, `APIFY_API_KEY_3` …: they are rotated and a key that runs out of credit is parked instead of stopping the sync.
Add the source
Integrations → Add source → YouTube, then either **Channel** with a channel URL (`https://www.youtube.com/@handle`) or a handle, or **Videos** with one or more video URLs.
Choose the languages
**Languages** lists the caption languages in order of preference. The default is `fr` then `en`.
Connect and sync
**Test** lists the videos without transcribing them, which costs nothing. **Sync** then transcribes the videos and indexes the text.
Configuration options
| Field | Description | Required |
|---|---|---|
| Channel | Channel URL (`https://www.youtube.com/@handle`, `/channel/ID`, `/c/name`) or a bare `@handle`. Lists the most recent videos | No |
| Videos | One or more video URLs or 11-character ids. Indexes exactly those, without listing anything | No |
| Languages | Caption languages in order of preference, e.g. `fr, en`. Defaults to `fr` then `en` | No |
| Max videos | How many videos to take from the channel. Defaults to 200, capped at 1000 | No |
| Secret | Apify API key for this source only. Overrides the server environment | No |
Best practices
- •Prefer a channel over a list of videos: the channel is re-listed on every sync, so a new video is picked up without editing the source.
- •Listing a channel is free; transcribing a video is not. Set **Max videos** to what you actually want to index rather than leaving it at the maximum.
- •A video whose publication date has not changed is skipped before any call: re-syncing a channel that did not publish costs nothing.
- •Captions are what gets indexed, never the audio. A video without captions is reported as skipped, not as a connector failure.
- •Do not index a channel you do not own wholesale if it publishes hours of content per day: one document per video, and each transcription is billed by the actor.
Troubleshooting
Neither **Channel** nor **Videos** is filled. One of the two is mandatory: a source with neither has nothing to index.
The server environment has no Apify key and the source sets no **Secret**. Add the key to the service environment file and restart the API: a running process does not see a variable added afterwards.
The video has captions disabled, or only in a language that was not asked for. Add that language to **Languages**; `timedtext` is tried as a free fallback before giving up.
The transcript came back empty: the video is silent, or its captions are empty. The document is skipped rather than indexed as empty text.
The key has run out of credit or was revoked. That key is parked for 30 minutes and the next one is tried; add another `APIFY_API_KEY_N` rather than waiting.
The URL points at a playlist or a video rather than a channel, or the channel has no public video. Use `/@handle` or `/channel/ID`.
Next steps
Once the source is connected and indexed, ask a question from the chat and check that the answer cites this source. A source that never appears in a citation is usually a source with nothing indexed: see Troubleshooting above.
