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

# Create an async job

> Submit any surface operation (fetch, crawl, interact, search, map) as an async job.



## OpenAPI

````yaml post /v1/jobs
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/jobs:
    post:
      tags:
        - Jobs
      summary: Create an async job
      description: >-
        Submit any surface operation (fetch, crawl, interact, search, map) as an
        async job. Returns a `job_id` immediately; poll `GET /v1/jobs/{id}` for
        status and retrieve the output from `GET /v1/jobs/{id}/result` once
        complete. Send an `Idempotency-Key` header to safely retry submission.
        Results are retained for 24 hours.
      operationId: createJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJobRequest'
            examples:
              fetch:
                summary: Async fetch job
                value:
                  kind: fetch
                  input:
                    url: https://example.com
                    render_js: true
                    output:
                      - markdown
              crawl:
                summary: Async crawl job
                value:
                  kind: crawl
                  input:
                    seeds:
                      - https://docs.example.com/
                    max_pages: 20
                    output:
                      - markdown
      responses:
        '202':
          description: Job accepted and queued for execution.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobAcceptedResponse'
        '400':
          description: Invalid job request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Idempotency key reused with a different request body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl -X POST https://api.scrapio.dev/v1/jobs \
              -H "Authorization: Bearer $SCRAPIO_API_KEY" \
              -H "Content-Type: application/json" \
              -H "Idempotency-Key: my-job-001" \
              -d '{"kind":"fetch","input":{"url":"https://example.com","output":["markdown"]}}'
        - lang: Python
          label: Python
          source: |-
            import os, requests
            resp = requests.post(
                "https://api.scrapio.dev/v1/jobs",
                headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}", "Idempotency-Key": "my-job-001"},
                json={"kind": "fetch", "input": {"url": "https://example.com", "output": ["markdown"]}},
            )
            print(resp.json()["job_id"])
        - lang: JavaScript
          label: Node.js
          source: |-
            const resp = await fetch("https://api.scrapio.dev/v1/jobs", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}`, "Content-Type": "application/json", "Idempotency-Key": "my-job-001" },
              body: JSON.stringify({ kind: "fetch", input: { url: "https://example.com", output: ["markdown"] } }),
            });
            const { job_id } = await resp.json();
components:
  schemas:
    CreateJobRequest:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              description: Wraps a /fetch request
              enum:
                - fetch
            input:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Target page URL to fetch
                render_js:
                  description: Whether to render JavaScript before capturing output
                  type: boolean
                device:
                  type: string
                  enum:
                    - desktop
                    - mobile
                    - tablet
                  description: Device profile to emulate
                session:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      description: Session id to reuse
                  required:
                    - id
                  additionalProperties: false
                  description: Reuse an existing browser session by id
                output:
                  description: Which output formats to return (default ["html"])
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - html
                      - markdown
                      - json
                      - screenshot
                    description: Which output formats to return
                extract:
                  description: Structured extraction config, requires `json` output
                  anyOf:
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract whole page, no config
                          enum:
                            - page
                      required:
                        - mode
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract fields via CSS selectors
                          enum:
                            - selectors
                        fields:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: object
                            properties:
                              selector:
                                type: string
                                minLength: 1
                                description: CSS selector to match
                              type:
                                type: string
                                enum:
                                  - text
                                  - html
                                  - attr
                                description: What to extract from the matched element
                              attribute:
                                description: Attribute name, required when type is 'attr'
                                type: string
                                minLength: 1
                            required:
                              - selector
                              - type
                            additionalProperties: false
                          description: Named fields to extract
                      required:
                        - mode
                        - fields
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract using a field-name/description schema
                          enum:
                            - schema
                        schema:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                          description: Field name to description map
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - schema
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract via free-text instruction
                          enum:
                            - instruction
                        instruction:
                          type: string
                          minLength: 1
                          description: Free-text extraction instruction
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - instruction
                      additionalProperties: false
                wait_for:
                  type: object
                  properties:
                    network_idle:
                      description: Wait for network idle before capturing
                      type: boolean
                  additionalProperties: false
                  description: Condition to wait on before capturing
                timeout_ms:
                  description: Max time to wait for the fetch, in ms
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 300000
                use_proxy:
                  description: >-
                    Skip the cheap direct/stealth tiers and go straight to the
                    strongest (proxy) access tier. Requires a paid plan. Useful
                    when you already know the target needs it, to avoid wasted
                    attempts and reduce the chance of timing out mid-escalation.
                  type: boolean
              required:
                - url
              additionalProperties: false
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Callback URL to notify when the job completes
              required:
                - url
              additionalProperties: false
              description: Optional webhook callback for job completion
          required:
            - kind
            - input
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              description: Wraps an /interact request
              enum:
                - interact
            input:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Target page URL to open
                device:
                  type: string
                  enum:
                    - desktop
                    - mobile
                    - tablet
                  description: Device profile to emulate
                session:
                  type: object
                  properties:
                    id:
                      type: string
                      minLength: 1
                      description: Session id to reuse
                  required:
                    - id
                  additionalProperties: false
                  description: Reuse an existing browser session by id
                actions:
                  minItems: 1
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Navigate to a URL
                            enum:
                              - goto
                          url:
                            type: string
                            format: uri
                        required:
                          - type
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Click a matched element
                            enum:
                              - click
                          selector:
                            type: string
                            minLength: 1
                        required:
                          - type
                          - selector
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Type text into a matched element
                            enum:
                              - type
                          selector:
                            type: string
                            minLength: 1
                          value:
                            type: string
                        required:
                          - type
                          - selector
                          - value
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Select an option in a matched <select>
                            enum:
                              - select
                          selector:
                            type: string
                            minLength: 1
                          value:
                            type: string
                        required:
                          - type
                          - selector
                          - value
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Press a keyboard key
                            enum:
                              - press
                          key:
                            type: string
                            minLength: 1
                          selector:
                            type: string
                            minLength: 1
                        required:
                          - type
                          - key
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Scroll the page or a matched element
                            enum:
                              - scroll
                          selector:
                            type: string
                            minLength: 1
                          direction:
                            type: string
                            enum:
                              - down
                              - up
                          amount:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                        required:
                          - type
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Wait for a matched element to appear
                            enum:
                              - wait_for
                          selector:
                            type: string
                            minLength: 1
                        required:
                          - type
                          - selector
                        additionalProperties: false
                      - type: object
                        properties:
                          type:
                            type: string
                            description: Wait a fixed duration
                            enum:
                              - wait_ms
                          duration_ms:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                        required:
                          - type
                          - duration_ms
                        additionalProperties: false
                  description: Ordered sequence of interaction steps to run
                output:
                  description: Which output formats to return after actions
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - html
                      - markdown
                      - json
                      - screenshot
                    description: Which output formats to return
                extract:
                  description: Structured extraction config, requires `json` output
                  anyOf:
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract whole page, no config
                          enum:
                            - page
                      required:
                        - mode
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract fields via CSS selectors
                          enum:
                            - selectors
                        fields:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: object
                            properties:
                              selector:
                                type: string
                                minLength: 1
                                description: CSS selector to match
                              type:
                                type: string
                                enum:
                                  - text
                                  - html
                                  - attr
                                description: What to extract from the matched element
                              attribute:
                                description: Attribute name, required when type is 'attr'
                                type: string
                                minLength: 1
                            required:
                              - selector
                              - type
                            additionalProperties: false
                          description: Named fields to extract
                      required:
                        - mode
                        - fields
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract using a field-name/description schema
                          enum:
                            - schema
                        schema:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                          description: Field name to description map
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - schema
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract via free-text instruction
                          enum:
                            - instruction
                        instruction:
                          type: string
                          minLength: 1
                          description: Free-text extraction instruction
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - instruction
                      additionalProperties: false
                timeout_ms:
                  description: Max time for the whole interaction, in ms
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 300000
                use_proxy:
                  description: >-
                    Skip the cheap direct/stealth tiers and go straight to the
                    strongest (proxy) access tier. Requires a paid plan.
                  type: boolean
              required:
                - url
                - actions
              additionalProperties: false
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Callback URL to notify when the job completes
              required:
                - url
              additionalProperties: false
              description: Optional webhook callback for job completion
          required:
            - kind
            - input
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              description: Wraps a /search request
              enum:
                - search
            input:
              type: object
              properties:
                query:
                  type: string
                  minLength: 1
                  description: Search query text
                provider:
                  description: Search provider to use
                  type: string
                  enum:
                    - google
                max_results:
                  description: Max number of results to return
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 10
                fetch_results:
                  description: Whether to fetch full content of result pages
                  type: boolean
                output:
                  description: >-
                    Output formats when fetching results (requires
                    fetch_results)
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - html
                      - markdown
                      - json
                      - screenshot
                    description: Which output formats to return
                extract:
                  description: Structured extraction config, requires `json` output
                  anyOf:
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract whole page, no config
                          enum:
                            - page
                      required:
                        - mode
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract fields via CSS selectors
                          enum:
                            - selectors
                        fields:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: object
                            properties:
                              selector:
                                type: string
                                minLength: 1
                                description: CSS selector to match
                              type:
                                type: string
                                enum:
                                  - text
                                  - html
                                  - attr
                                description: What to extract from the matched element
                              attribute:
                                description: Attribute name, required when type is 'attr'
                                type: string
                                minLength: 1
                            required:
                              - selector
                              - type
                            additionalProperties: false
                          description: Named fields to extract
                      required:
                        - mode
                        - fields
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract using a field-name/description schema
                          enum:
                            - schema
                        schema:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                          description: Field name to description map
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - schema
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract via free-text instruction
                          enum:
                            - instruction
                        instruction:
                          type: string
                          minLength: 1
                          description: Free-text extraction instruction
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - instruction
                      additionalProperties: false
                timeout_ms:
                  description: Max workflow duration, in ms
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 300000
              required:
                - query
              additionalProperties: false
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Callback URL to notify when the job completes
              required:
                - url
              additionalProperties: false
              description: Optional webhook callback for job completion
          required:
            - kind
            - input
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              description: Wraps a /crawl request
              enum:
                - crawl
            input:
              type: object
              properties:
                seeds:
                  minItems: 1
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Starting URLs to crawl from
                max_pages:
                  description: Cap on total pages crawled
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 50
                max_depth:
                  description: Max link depth from seeds
                  type: integer
                  minimum: 0
                  maximum: 5
                same_domain_only:
                  description: Restrict crawl to seed domains
                  type: boolean
                output:
                  description: Output formats per page (default ["markdown"])
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - html
                      - markdown
                      - json
                extract:
                  description: Structured extraction config, requires `json` output
                  anyOf:
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract whole page, no config
                          enum:
                            - page
                      required:
                        - mode
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract fields via CSS selectors
                          enum:
                            - selectors
                        fields:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: object
                            properties:
                              selector:
                                type: string
                                minLength: 1
                                description: CSS selector to match
                              type:
                                type: string
                                enum:
                                  - text
                                  - html
                                  - attr
                                description: What to extract from the matched element
                              attribute:
                                description: Attribute name, required when type is 'attr'
                                type: string
                                minLength: 1
                            required:
                              - selector
                              - type
                            additionalProperties: false
                          description: Named fields to extract
                      required:
                        - mode
                        - fields
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract using a field-name/description schema
                          enum:
                            - schema
                        schema:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type: string
                          description: Field name to description map
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - schema
                      additionalProperties: false
                    - type: object
                      properties:
                        mode:
                          type: string
                          description: Extract via free-text instruction
                          enum:
                            - instruction
                        instruction:
                          type: string
                          minLength: 1
                          description: Free-text extraction instruction
                        engine:
                          type: string
                          enum:
                            - llm
                            - heuristic
                          description: Extraction engine to use
                      required:
                        - mode
                        - instruction
                      additionalProperties: false
                timeout_ms:
                  description: Max crawl duration, in ms
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 300000
                use_proxy:
                  description: >-
                    Skip the cheap direct/stealth tiers and go straight to the
                    strongest (proxy) access tier for every page crawled.
                    Requires a paid plan.
                  type: boolean
              required:
                - seeds
              additionalProperties: false
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Callback URL to notify when the job completes
              required:
                - url
              additionalProperties: false
              description: Optional webhook callback for job completion
          required:
            - kind
            - input
          additionalProperties: false
        - type: object
          properties:
            kind:
              type: string
              description: Wraps a /map request
              enum:
                - map
            input:
              type: object
              properties:
                seeds:
                  minItems: 1
                  type: array
                  items:
                    type: string
                    format: uri
                  description: Starting URLs to map from
                max_urls:
                  description: Cap on total URLs returned
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 100
                max_depth:
                  description: Max link depth from seeds
                  type: integer
                  minimum: 0
                  maximum: 5
                same_domain_only:
                  description: Restrict mapping to seed domains
                  type: boolean
                include_metadata:
                  description: Include page metadata in results
                  type: boolean
                timeout_ms:
                  description: Max mapping duration, in ms
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 300000
                use_proxy:
                  description: >-
                    Skip the cheap direct/stealth tiers and go straight to the
                    strongest (proxy) access tier for every URL mapped. Requires
                    a paid plan.
                  type: boolean
              required:
                - seeds
              additionalProperties: false
            webhook:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Callback URL to notify when the job completes
              required:
                - url
              additionalProperties: false
              description: Optional webhook callback for job completion
          required:
            - kind
            - input
          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

````