> ## 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.

# Queue a search crawl

> Submit a large YouTube search as an async job, for result counts beyond what the synchronous search endpoint returns.



## OpenAPI

````yaml post /v1/youtube/search/crawl
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/crawl:
    post:
      tags:
        - YouTube
      summary: Queue a YouTube search crawl job
      description: >-
        Submits a large-scale YouTube search as an async job. Useful when
        `limit` exceeds what the synchronous search endpoint can return in a
        single call. Returns a `job_id` to poll for results.
      operationId: queueYouTubeSearchCrawl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/YouTubeSearchQuery'
            examples:
              basic:
                summary: Crawl 500 results for a query
                value:
                  search: machine learning tutorials
                  limit: 500
                  type: video
      responses:
        '202':
          description: YouTube crawl job queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobAcceptedResponse'
        '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'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl -X POST https://api.scrapio.dev/v1/youtube/search/crawl \
              -H "Authorization: Bearer $SCRAPIO_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{"search":"machine learning tutorials","limit":500,"type":"video"}'
        - lang: Python
          label: Python
          source: |-
            import os, requests
            resp = requests.post(
                "https://api.scrapio.dev/v1/youtube/search/crawl",
                headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
                json={"search": "machine learning tutorials", "limit": 500, "type": "video"},
            )
            print(resp.json()["job_id"])
components:
  schemas:
    YouTubeSearchQuery:
      type: object
      properties:
        search:
          type: string
          minLength: 1
          description: Search query text
        language:
          description: Language for results
          type: string
          minLength: 2
          maxLength: 16
          pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$
        country:
          description: Country code for results
          type: string
          minLength: 2
          maxLength: 2
          pattern: ^[A-Za-z]{2}$
        geo:
          description: Geo location for results
          type: string
          minLength: 2
          maxLength: 32
        type:
          description: Type of result to search for
          type: string
          enum:
            - video
            - channel
            - playlist
            - all
        limit:
          description: Max number of results
          type: integer
          exclusiveMinimum: 0
          maximum: 1000
        start_page:
          description: First result page to fetch
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
        end_page:
          description: Last result page to fetch
          type: integer
          exclusiveMinimum: 0
          maximum: 9007199254740991
      required:
        - search
      additionalProperties: false
    AsyncJobAcceptedResponse:
      type: object
      properties:
        request_id:
          type: string
        mode:
          type: string
          enum:
            - async
        status:
          type: string
          enum:
            - queued
        job_id:
          type: string
        job_type:
          type: string
      required:
        - request_id
        - mode
        - status
        - job_id
      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

````