> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapio.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Search YouTube

> Search YouTube for videos, channels, or playlists.



## OpenAPI

````yaml get /v1/youtube/search
openapi: 3.1.0
info:
  title: Scrapio
  version: 1.0.0
  description: >-
    Turn any URL into structured data. Fetch raw HTML, crawl sites, extract
    structured content, interact with dynamic pages, and search the web through
    one API.
  contact:
    name: Scrapio Support
    url: https://scrapio.dev
  license:
    name: Proprietary
servers:
  - url: https://api.scrapio.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: System
  - name: Fetch
  - name: Crawl
  - name: Map
  - name: Interact
  - name: Search
  - name: Google
  - name: Fast Search
  - name: Jobs
  - name: YouTube
  - name: Amazon
  - name: Walmart
  - name: Booking
  - name: Agoda
  - name: Airbnb
  - name: ChatGPT
  - name: Perplexity
  - name: Gemini
  - name: Bing
  - name: Reddit
  - name: TikTok
  - name: Apple App Store
  - name: Target
  - name: Monitors
paths:
  /v1/youtube/search:
    get:
      tags:
        - YouTube
      summary: Search YouTube
      description: >-
        Search YouTube and return structured results including title, URL,
        channel, description, view count, and duration. Supports filtering by
        type (video, channel, playlist), language, country, and geo-location.
        For large result sets, use the `/v1/youtube/search/crawl` async
        endpoint.
      operationId: youtubeSearch
      parameters:
        - name: search
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            description: Search query text
        - name: language
          in: query
          required: false
          schema:
            description: Language for results
            type: string
            minLength: 2
            maxLength: 16
            pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$
        - name: country
          in: query
          required: false
          schema:
            description: Country code for results
            type: string
            minLength: 2
            maxLength: 2
            pattern: ^[A-Za-z]{2}$
        - name: geo
          in: query
          required: false
          schema:
            description: Geo location for results
            type: string
            minLength: 2
            maxLength: 32
        - name: type
          in: query
          required: false
          schema:
            description: Type of result to search for
            type: string
            enum:
              - video
              - channel
              - playlist
              - all
        - name: limit
          in: query
          required: false
          schema:
            description: Max number of results
            type: integer
            exclusiveMinimum: 0
            maximum: 1000
        - name: start_page
          in: query
          required: false
          schema:
            description: First result page to fetch
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
        - name: end_page
          in: query
          required: false
          schema:
            description: Last result page to fetch
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
      responses:
        '200':
          description: Paginated YouTube search results with metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YouTubeSearchResponse'
        '400':
          description: Invalid search parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: No results found for the query.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: >-
            curl
            "https://api.scrapio.dev/v1/youtube/search?search=openai&type=video&limit=10"
            \
              -H "Authorization: Bearer $SCRAPIO_API_KEY"
        - lang: Python
          label: Python
          source: |-
            import os, requests
            resp = requests.get(
                "https://api.scrapio.dev/v1/youtube/search",
                headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
                params={"search": "openai", "type": "video", "limit": 10},
            )
            for r in resp.json()["results"]:
                print(r["title"], r["url"])
        - lang: JavaScript
          label: Node.js
          source: >-
            const params = new URLSearchParams({ search: "openai", type:
            "video", limit: "10" });

            const { results } = await
            fetch(`https://api.scrapio.dev/v1/youtube/search?${params}`, {
              headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}` },
            }).then(r => r.json());

            results.forEach(r => console.log(r.title, r.url));
components:
  schemas:
    YouTubeSearchResponse:
      type: object
      properties:
        request_id:
          type: string
        results:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              id:
                type: string
              title:
                type: string
              url:
                type: string
                format: uri
              thumbnail:
                type: string
                format: uri
              channel:
                type: string
              description:
                type: string
              published_at:
                type: string
              view_count:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              duration:
                type: string
            required:
              - kind
              - id
              - title
              - url
              - thumbnail
            additionalProperties: false
        pagination:
          type: object
          properties:
            limit:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            count:
              type: integer
              minimum: 0
              maximum: 9007199254740991
            start_page:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            end_page:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            pages_crawled:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - limit
            - count
            - start_page
            - end_page
            - pages_crawled
        query_context:
          type: object
          properties:
            search:
              type: string
            language:
              type: string
            country:
              type: string
            type:
              type: string
              enum:
                - video
                - channel
                - playlist
                - all
            start_page:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
            end_page:
              type: integer
              exclusiveMinimum: 0
              maximum: 9007199254740991
          required:
            - search
            - type
            - start_page
            - end_page
      required:
        - request_id
        - results
        - pagination
        - query_context
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        request_id:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
        diagnostics:
          type: object
          properties:
            outcome:
              type: string
              enum:
                - failed
            retryable:
              type: boolean
            blocked:
              type: boolean
            timed_out:
              type: boolean
          required:
            - outcome
            - retryable
          additionalProperties: false
      required:
        - request_id
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````