# YouTube API setup

1. Create or select a Google Cloud project.
2. Enable YouTube Data API v3.
3. Create an API key for server-side read-only public-data requests.
4. Restrict the key to YouTube Data API v3 and server restrictions available for your hosting arrangement.
5. Enter it only in the browser installer. It is stored in protected `private/config.php` and never sent to visitors.

The synchronizer uses:

- `channels.list` for channel metadata, statistics and uploads playlist ID.
- `playlistItems.list` with 50 results per page until no `nextPageToken` remains.
- `videos.list` in batches of up to 50 IDs for descriptions, duration, statistics, status and embeddability.

At exactly 141 uploads, a normal full sync requires three playlist pages and three video-detail batches, plus the channel request. Actual counts change and are determined dynamically.
