Get video by ID or URL

Fetch full video details by ID or URL.

GET
/api/video/{id}

Path Parameters

id*string

YouTube video ID or URL

Response Body

application/json

application/json

application/json

application/json

import { Router } from 'express'import { client } from '../lib.js'const router = Router()router.get('/video/:id', async (req, res) => {  const { id } = req.params  const video = await client!.video(id)  res.json(video)})export const routes = router
{
  "id": "string",
  "title": "string",
  "description": "string",
  "channel": "string",
  "channelId": "string",
  "views": 0,
  "viewsFmt": "string",
  "likes": 0,
  "likesFmt": "string",
  "comments": 0,
  "commentsFmt": "string",
  "duration": 0,
  "durationFmt": "string",
  "published": "string",
  "publishedAt": "string",
  "thumbnails": {
    "default": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "medium": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "high": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "standard": {
      "url": "string",
      "width": 0,
      "height": 0
    },
    "maxres": {
      "url": "string",
      "width": 0,
      "height": 0
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      "string"
    ]
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      "string"
    ]
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      "string"
    ]
  }
}