All connectors

Documentation

YouTube

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.

ContentWhat is kept
TranscriptsThe spoken text of each video, in the language asked for, automatic captions included
Video metadataTitle, channel name, language and duration are kept as a header above the transcript
Video listThe 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.

1

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.

2

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.

3

Choose the languages

**Languages** lists the caption languages in order of preference. The default is `fr` then `en`.

4

Connect and sync

**Test** lists the videos without transcribing them, which costs nothing. **Sync** then transcribes the videos and indexes the text.

Where the credential goes
The Apify key is a **service key**, not a per-source credential: it is read from the server environment (`APIFY_API_KEY`, plus `APIFY_API_KEY_2` … `APIFY_API_KEY_N` for rotation) and is shared by every YouTube source of the deployment. The **Secret** field stays available and takes precedence: a source that sets it uses only that key.

Configuration options

FieldDescriptionRequired
ChannelChannel URL (`https://www.youtube.com/@handle`, `/channel/ID`, `/c/name`) or a bare `@handle`. Lists the most recent videosNo
VideosOne or more video URLs or 11-character ids. Indexes exactly those, without listing anythingNo
LanguagesCaption languages in order of preference, e.g. `fr, en`. Defaults to `fr` then `en`No
Max videosHow many videos to take from the channel. Defaults to 200, capped at 1000No
SecretApify API key for this source only. Overrides the server environmentNo

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

`config.channel … est requis`

Neither **Channel** nor **Videos** is filled. One of the two is mandatory: a source with neither has nothing to index.

`APIFY_API_KEY` missing

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.

No caption in any language

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.

`aucune parole detectee dans la video`

The transcript came back empty: the video is silent, or its captions are empty. The document is skipped rather than indexed as empty text.

Apify answers 402 or 403

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.

A channel returns no video

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.