Get channel videos

Fetch recent uploads for a channel.

GET
/api/channel/{id}/videos

Path Parameters

id*string

Channel ID, @username, or URL

Query Parameters

limit?integer

Max videos to return (1-50, default 5)

Default5
Range1 <= value <= 50

Response Body

application/json

application/json

import { Router } from 'express'import { client } from '../lib.js'const router = Router()router.get('/channel/:id/videos', async (req, res) => {  const { id } = req.params  const limit = req.query.limit ? Number(req.query.limit) : 5  const videos = await client!.channelVideos(id, { limit })  res.json(videos)})export const routes = router
[
  {
    "id": "string",
    "title": "string",
    "views": 0,
    "viewsFmt": "string",
    "likes": 0,
    "likesFmt": "string",
    "duration": 0,
    "durationFmt": "string",
    "thumbnail": "string",
    "uploadAge": "string",
    "publishedAt": "string"
  }
]
{
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      "string"
    ]
  }
}