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

# Scrape a page



## OpenAPI

````yaml /docs/openapi.yaml post /scrape
openapi: 3.0.3
info:
  title: BeeCrawl API
  version: 0.1.0
  description: Self-hostable web scraping, crawling, search, and extraction API.
servers:
  - url: https://api.beecrawl.dev
    description: BeeCrawl hosted deployment
  - url: http://127.0.0.1:8000
    description: Local development
security:
  - apiKey: []
tags:
  - name: Scraping
  - name: Discovery
  - name: Async jobs
  - name: Search
  - name: Extraction
paths:
  /scrape:
    post:
      tags:
        - Scraping
      summary: Scrape a page
      operationId: scrapePage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScrapeRequest'
            example:
              url: https://example.com
              formats:
                - markdown
                - links
              use_browser: auto
      responses:
        '200':
          description: Scraped page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    ScrapeRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        formats:
          type: array
          items:
            type: string
            enum:
              - markdown
              - html
              - rawHtml
              - links
              - screenshot
          default:
            - markdown
        location:
          $ref: '#/components/schemas/Location'
        timeout_seconds:
          type: integer
          minimum: 1
          default: 30
        wait_for_ms:
          type: integer
          minimum: 0
          default: 0
        use_browser:
          type: string
          enum:
            - never
            - auto
            - always
          default: auto
    ScrapeResponse:
      type: object
      required:
        - request_id
        - url
        - final_url
        - markdown
        - metadata
      properties:
        request_id:
          type: string
        url:
          type: string
          format: uri
        final_url:
          type: string
          format: uri
        markdown:
          type: string
        html:
          type: string
        rawHtml:
          type: string
        links:
          type: array
          items:
            type: string
            format: uri
        screenshot:
          type: string
          description: PNG data URL when requested.
        metadata:
          $ref: '#/components/schemas/ScrapeMetadata'
    Location:
      type: object
      properties:
        country:
          type: string
        languages:
          type: array
          items:
            type: string
    ScrapeMetadata:
      type: object
      properties:
        title:
          type: string
          nullable: true
        language:
          type: string
          nullable: true
        status_code:
          type: integer
          nullable: true
        provider:
          type: string
        rendered:
          type: boolean
        elapsed_ms:
          type: integer
          nullable: true
    Error:
      type: object
      additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Web-Extract-Api-Key
      description: API key. X-Api-Key and Bearer authentication are also accepted.

````