Products/YouTube/YouTube Channel Scraper/Integration

YouTube Channel Scraper Integration

Sync a YouTube channel's videos to a database

A sync job that re-reads a channel's whole history on every run wastes both time and money. oldestPostDate lets a scheduled job pull only what changed since the last run, so each sync call returns new uploads, not the full back catalogue.

0.80 USD / 1,000 per video returned, so a daily sync only pays for new uploads, not the whole channel.

Copy-paste example

Copy-paste example
curl "https://api.vakitek.co.uk/v1/youtube/channel-videos?channel=@mkbhd&oldest_post_date=1%20day" \
  -H "X-API-Key: $VAKITEK_API_KEY"

Step by step

  1. Get a Vakitek API key from the dashboard.
  2. Call GET /v1/youtube/channel-videos?channel=@handle on a schedule, for example once a day with a cron job or your task scheduler.
  3. Set oldest_post_date to your sync interval, for example 1 day, so the call stops at the first video older than that.
  4. Upsert each returned row on its id, since id and publishedAt are stable across runs, so an upsert is enough to avoid duplicate rows.
  5. Handle a NOT_FOUND row (legacyError CHANNEL_NOT_FOUND) by flagging the channel for review instead of letting the sync job stop.

Your options compared

OptionTrade-offs
Scheduled API call with oldest_post_date (this guide)Each run only costs for new uploads at 0.80 USD / 1,000 per video, with no dedicated sync feature beyond the date filter itself.
Full re-pull every runSimpler to reason about, since there is no state to track between runs, but it re-pays for every video on every run instead of only new ones.
The Apify actor on a schedule, exporting to the datasetWorks the same way through Apify's own scheduler and dataset export, at the cost of a second system, Apify plus your database, instead of a direct API call into your sync job.

Troubleshooting

SymptomCauseFix
The scheduled call returns 401.The X-API-Key header is missing, wrong, or the key was revoked.Confirm the key against the one shown once in the Vakitek dashboard. Missing, unknown and revoked keys all return the same 401 UNAUTHORIZED body.
The sync job pulls the same videos every run.oldest_post_date was not set, or was set to a window wider than the sync interval.Set oldest_post_date to match how often the job runs, for example 1 day for a daily sync.
A channel disappears from the sync without an error.The channel moved or was deleted.Check for a NOT_FOUND row (legacyError CHANNEL_NOT_FOUND) and flag it, rather than assuming an empty result means no new videos.
The job starts failing with 429.The per-key rate limit, 120 requests a minute by default, was exceeded.Space out the schedule or add a short delay between channels in a multi-channel sync.

Questions

Will a sync job get charged again for videos it already pulled?

Only if you ask for them again. Set oldest_post_date to your last sync time and the run returns new videos only.

What does a deleted or renamed channel return?

A typed NOT_FOUND row (legacyError CHANNEL_NOT_FOUND for a pipeline still matching the old name), so the sync job can flag it instead of crashing.

Does this need a webhook or push notification setup?

No. The pattern here is a scheduled pull, not a push; your own scheduler, a cron job, a task queue, or the Apify actor's own schedule, decides how often to call it.