---
title: "POST /web-scraping"
method: POST
path: "/web-scraping"
tags: ["webscrape"]
---

# POST /web-scraping

`POST /web-scraping`

Scrape a webpage with custom options

## Request body

- WebScrapeDto
  - `url` string, required — Target URL
  - `device` 'desktop' | 'mobile' — Device type to emulate. Defaults to desktop.
  - `blockAds` boolean — Whether to block ads
  - `renderJS` boolean — Whether to render JavaScript
  - `proxyCountry` string — Proxy country code to route the request
  - `format` 'html' | 'markdown' | 'json' | 'markdown-filtered' | 'all' — Format of the scraped result. Defaults to html.
  - `fileOutput` boolean — Whether to get response in file format
  - `extractionMode` 'default' | 'cssSchema' | 'xpathSchema' — Extraction mode (only used if format=json)
  - `extractionSchema` ExtractionSchemaDto
    - `name` string, required — Name/Label for this extraction schema
    - `baseSelector` string — Base selector for scoping extraction (css/xpath only)
    - `fields` union[], required — List of fields to extract
      - union
        - DefaultExtractionFieldDto
          - `title` string, required — Title/key of the extracted field
          - `value` object, required — Static value to assign to this field
        - SelectorExtractionFieldDto
          - `name` string, required — Field name in the extracted JSON
          - `selector` string, required — Selector or XPath to extract value
          - `type` string, required — Type of data to extract
          - `attribute` string — If type=attr, specify attribute name
          - `fields` SelectorExtractionFieldDto[] — Nested fields

## Response `200`

Successfully scraped webpage

- WebScrapeResponseDto
  - `timestamp` number, required — Timestamp of the request in milliseconds
  - `apiStatus` 'success' | 'failure', required — API status message
  - `apiCode` number, required — API status code
  - `meta` WebScrapeMetaDto, required
    - `url` string, required — The target URL that was scraped
    - `device` 'desktop' | 'mobile', required — Device type used
    - `format` 'html' | 'markdown' | 'json' | 'markdown-filtered' | 'all', required — Output format of the result
    - `fileOutput` boolean, required — Whether to get response in file format
    - `blockAds` boolean, required — Whether ads were blocked
    - `renderJS` boolean, required — Whether JavaScript was rendered
    - `proxyCountry` string — Proxy country used, if any
    - `extractionMode` string, required — Extraction mode (only used if format=json)
    - `extractionSchema` ExtractionSchemaDto, required
      - `name` string, required — Name/Label for this extraction schema
      - `baseSelector` string — Base selector for scoping extraction (css/xpath only)
      - `fields` union[], required — List of fields to extract
        - union
          - DefaultExtractionFieldDto
            - `title` string, required — Title/key of the extracted field
            - `value` object, required — Static value to assign to this field
          - SelectorExtractionFieldDto
            - `name` string, required — Field name in the extracted JSON
            - `selector` string, required — Selector or XPath to extract value
            - `type` string, required — Type of data to extract
            - `attribute` string — If type=attr, specify attribute name
            - `fields` SelectorExtractionFieldDto[] — Nested fields
    - `test` TestMetaDto, required
      - `id` string, required — Unique test identifier
  - `data` union, required — Scraped data (URL or inline content depending on output)
    - string
    - object

## Other responses

- `400` — Bad request (invalid parameters)
- `500` — Internal server error

---

[API](https://skmtc.net/geekflare/apis/geekflare-api.md) · [All operations](https://skmtc.net/geekflare/apis/geekflare-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/geekflare/geekflare-api/versions/936993afc936/schema)
