Nobru Member Count

Fetches YouTube channel membership count/list and subscriber count/list via the YouTube Data API v3.

Setup

  1. Add an Upstash Redis store from the Vercel Storage tab
  2. Set CLIENT_ID, CLIENT_SECRET, and API_KEY in your Vercel environment variables
  3. Authorize with YouTube — this grants both memberships + readonly scopes
  4. Done! The refresh token is saved automatically — no redeploy needed

Endpoints

REDIRECT /api/auth

Starts OAuth2 flow. Requests both youtube.channel-memberships.creator and youtube.readonly scopes.

GET /api/callback

OAuth2 callback. Displays the refresh token and granted scopes.

GET /api/members?key=YOUR_KEY

Returns channel membership list and total count. Requires the youtube.channel-memberships.creator scope.

{
  "totalMembers": 42,
  "fetchedCount": 42,
  "members": [...],
  "lastUpdated": "..."
}

GET /api/subscribers?key=YOUR_KEY

Returns subscriber count, video count, view count, and recent subscribers list.

{
  "channel": { "id": "...", "title": "..." },
  "subscriberCount": 1234,
  "videoCount": 50,
  "viewCount": 100000,
  "recentSubscribers": [...],
  "lastUpdated": "..."
}

GET /api/debug?key=YOUR_KEY

Checks token validity and granted scopes. Use this to diagnose 403 errors.

Troubleshooting the 403 Error

If /api/members returns 403, the most common causes are:

Links