---
title: "Search YouTube videos"
method: POST
path: "/v1/youtube/search"
tags: ["YouTube"]
---

# Search YouTube videos

`POST /v1/youtube/search`

Searches YouTube for videos matching a query. Returns video titles, links, channel information, view counts, and durations.

<span>⚡ <strong>Rate limit:</strong> 60 requests per 1 minute</span>

<span>💰 <strong>Cost:</strong> 2 credits per page of results&nbsp;<span title="Pricing shown is default pricing. Actual pricing may vary.">ⓘ</span></span>

## Request body

- object
  - `apiKey` string, required — Your Fiber API key
  - `query` string, required — The search query string to find YouTube videos (e.g. 'React Hooks tutorial').
  - `nextPageToken` string, nullable — Pagination token from a previous response to retrieve the next page of search results. Omit for the first page.

## Response `200`

Default Response

- object
  - `output` object, required
    - `videos` object[], required — List of video search results.
      - `id` string, required — YouTube video ID — the unique identifier found in the URL. For example, in 'https://www.youtube.com/watch?v=094y1Z2wpJg', the video ID is '094y1Z2wpJg'.
      - `title` string, required — Video title.
      - `url` string, nullable — URL to the video.
      - `viewCount` number, nullable — Number of views.
      - `durationSeconds` number, nullable — Video duration in seconds.
      - `publishedAt` object, nullable — Publication date. When YouTube only provides approximate time (e.g. '2 years ago'), we estimate the date and set `estimated: true`.
        - `date` string, required — ISO 8601 date string (e.g. '2024-03-15T00:00:00.000Z').
        - `estimated` boolean, required — True when the date was estimated from an approximate time string (e.g. '2 years ago'). False when an exact date was available.
      - `channel` object, nullable — Channel information.
        - `id` string, nullable — YouTube channel ID.
        - `name` string, nullable — Channel display name.
        - `url` string, nullable — URL to the channel page.
        - `verified` boolean, nullable — Whether the channel is verified.
      - `thumbnailUrl` string, nullable — URL of the video thumbnail.
    - `shorts` object[], required — List of YouTube Shorts matching the query.
      - `id` string, required — YouTube video ID for this short — the unique identifier found in the URL. For example, in 'https://www.youtube.com/shorts/gGtuw7Rejtk', the video ID is 'gGtuw7Rejtk'.
      - `title` string, required — Short title.
      - `url` string, nullable — URL to the short.
      - `viewCount` number, nullable — Number of views.
      - `thumbnailUrl` string, nullable — URL of the short thumbnail.
    - `channels` object[], required — List of channel results matching the query.
      - `id` string, nullable — YouTube channel ID.
      - `name` string, required — Channel display name.
      - `url` string, nullable — URL to the channel page.
      - `handle` string, nullable — Channel handle (e.g. '@veritasium').
      - `subscriberCount` number, nullable — Number of subscribers.
      - `description` string, nullable — Channel description snippet.
      - `verified` boolean, nullable — Whether the channel is verified.
      - `thumbnailUrl` string, nullable — URL of the channel thumbnail.
    - `nextPageToken` string, nullable — Token to retrieve the next page of search results. Pass this as `nextPageToken` in the next request. Null if there are no more pages.
  - `chargeInfo` union, required
    - object — Credits were charged immediately for this operation
      - `method` 'charged-now', required
      - `creditsCharged` number, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits will be charged after the operation completes
      - `method` 'charging-later', required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits that were charged for an asynchronous operation
      - `method` 'charged-for-async-process', required
      - `creditsCharged` number, required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — No credits were charged for this operation
      - `method` 'free', required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
    - object — Credits were refunded for this operation
      - `method` 'credits-refunded', required
      - `creditsRefunded` number, required
      - `message` string, required
      - `lowCreditAlert` object, nullable — Contains a link to get more credits, a warning message, and the remaining credit count.
        - `getMoreCreditsUrl` string, uri, required — URL to top up credits or restart billing cycle to get fresh credits.
        - `message` string, required — Human-readable credits warning.
        - `availableCredits` number, required — Number of credits remaining in the current billing period.
  - `warnings` object[], nullable — Warnings about extraneous fields in request
    - `field` string, required — Full path to extraneous field (e.g., 'searchParams.ExtraField')
    - `message` string, required — Warning message
  - `advice` string[], nullable — Tips, recommendations, and suggestions for using this API effectively.

## Other responses

- `400` — Default Response
- `401` — Default Response
- `402` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `429` — Default Response
- `500` — Default Response
- `503` — Default Response

---

[API](https://skmtc.net/fiber/apis/fiber-ai-api.md) · [All operations](https://skmtc.net/fiber/apis/fiber-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fiber/fiber-ai-api/versions/0c537984b99f/schema)
