---
title: "Web Scraping"
method: POST
path: "/v1/scrape"
tags: ["Search"]
---

# Web Scraping

`POST /v1/scrape`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/v1/scrape`
- Auth: API key in header `Authorization`

Scrape content from a webpage

## Request body

- ScrapeRequest
  - `url` string, required: URL to scrape content from
  - `provider` 'brightdata' | 'valyu': Scrape provider (brightdata or valyu)
  - `format` 'raw' | 'parsed': Format of the response (raw or parsed)
  - `scrape_render` true | false: Force Javascript to fully render before scraping
  - `scrape_length` string: Content length for extraction (valyu supports short, medium, large, max, or custom integer 1000-1000000)

## Response `200`

Successful scrape with content

- ScrapeResponse
  - `scrape_content` union
    - string: Raw HTML content when format=raw
    - ScrapeParsedContent
      - `title` string
      - `textContent` string
      - `excerpt` string
      - `hrefs` string[]
  - `usage` ScrapeUsage
    - `scrape_id` string
    - `timestamp` integer
    - `requested_records` integer
    - `raw_length` integer
    - `parsed_length` integer
    - `cost` number, float
    - `latencyMs` integer

## Other responses

- `400`: Bad request or scrape failed

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
