Home / Docs / YouTube

YouTube

Endpoints for YouTube channel metrics.

YouTube

Create YouTube Metrics

POST /api/youtube-metrics/

Auth: full_access

Record a new metrics snapshot for a company's YouTube channel.

Request body:

{
  "company_slug": "example",
  "subscriber_count": 15000,
  "videos_count": 120,
  "views_count": 500000,
  "channel_id": "UCxxxxxxxx",
  "date_parsed": "2025-01-15"
}

Required fields: company_slug, subscriber_count

Optional fields: channel_id, date_parsed (defaults to today), videos_count, views_count


List YouTube Metrics

GET /api/youtube-metrics/<company_slug>/

Auth: read_only or full_access

Returns metrics history for a company.

Query parameters:

Parameter Type Description
date string Filter by specific date (YYYY-MM-DD)

Get Latest YouTube Metrics

GET /api/youtube-metrics/<company_slug>/latest/

Auth: read_only or full_access

Returns the most recent metrics snapshot for the company.


Update YouTube Metrics

PUT / PATCH /api/youtube-metrics/<company_slug>/<year>/<month>/

Auth: full_access

Update metrics for a specific company, year, and month. If multiple records exist for the month, the latest is updated.


Update YouTube Metrics by Channel

PUT / PATCH /api/youtube-metrics/<company_slug>/<channel_id>/<year>/<month>/

Auth: full_access

Update metrics for a specific channel, year, and month.


List YouTube Channels

GET /api/company/<company_slug>/youtube-channels/

Auth: read_only or full_access

Returns YouTube channels associated with the company, including current subscriber, video, and view counts.

Query parameters:

Parameter Type Description
is_active string Filter by active status (true/false)
is_primary string Filter by primary status (true/false)