---
title: "Fetch any public URL (HTML or PDF) and return clean Markdown + metadata (1 credit)"
method: POST
path: "/v1/webpage"
---

# Fetch any public URL (HTML or PDF) and return clean Markdown + metadata (1 credit)

`POST /v1/webpage`

## Request

- Base URL: `https://api.serpkite.com`
- URL: `https://api.serpkite.com/v1/webpage`
- Auth: HTTP bearer

## Request body

- WebpageRequest
  - `url` string, uri, required: An HTML page or a PDF
  - `format` 'json' | 'markdown' | 'compact'
  - `include_html` boolean
  - `include_links` boolean: Also return the page's outbound links (`links`)
  - `include_images` boolean: Also return the page's image URLs (`image_links`)
  - `country` string: Fetch through an exit in this country (ISO 3166-1 alpha-2) for geo-dependent pages
  - `max_age` integer

## Response `200`

OK (text/markdown when format=markdown)

- WebpageResponse
  - `request` RequestEcho, required: The normalised request that produced this response (defaults filled in)
    - `endpoint` string, required
    - `engine` union, required: The engine policy as asked (google, auto, one provider or a list)
      - string
      - string[]
    - `q` string
    - `url` string
    - `country` string
    - `language` string
    - `location` string
    - `num` integer
    - `page` integer
    - `device` string
    - `autocorrect` boolean
    - `tbs` string
    - `start_date` string, date
    - `end_date` string, date
    - `safe` string
    - `place_id` string
    - `cid` string
    - `fid` string
    - `sort` string
    - `include_content` integer
    - `format` string
    - `include_domains` string[]
    - `exclude_domains` string[]
    - `boost_domains` string[]
    - `highlights` boolean
  - `url` string, required: Final URL after redirects
  - `status_code` integer
  - `markdown` string, required
  - `text` string
  - `html` string: Only with include_html=true
  - `metadata` PageMetadata, required
    - `title` string
    - `description` string
    - `language` string
    - `canonical` string
    - `site_name` string
    - `image` string
    - `published_time` string
    - `author` string
    - `content_type` string: The page's media type
    - `pages` integer: Page count of a PDF
  - `links` PageLink[]: include_links=true only. Outbound links in document order, deduplicated
    - `url` string, required: Absolute URL
    - `text` string: Anchor text
  - `image_links` string[]: include_images=true only. Image URLs in document order
  - `meta` Meta, required
    - `request_id` string, required
    - `credits_used` number, required
    - `engine` string: The provider that produced the result (`consensus` for a merged engine=consensus answer)
    - `route` RouteStep[]: Provider attempts in order (fresh results only; absent on cache hits). With engine=consensus, every provider started; ones stopped early are `canceled`, ones cut off by the deadline `timeout`
      - `provider` string, required
      - `outcome` 'ok' | 'partial' | 'empty' | 'soft_empty' | 'blocked' | 'timeout' | 'error' | 'unsupported' | 'bad_param' | 'bad_target' | 'canceled', required
      - `ms` integer, required: Duration of the attempt in milliseconds
    - `cached` boolean, required
    - `cached_at` string, date-time
    - `resolved_urls` boolean
    - `parse_quality` 'ok' | 'partial' | 'empty'
    - `latency_ms` integer

## Other responses

- `400`: Error
- `401`: Error
- `402`: Error
- `403`: Error
- `429`: Error
- `503`: Temporarily unavailable, not billed, safe to retry after `Retry-After`. Codes: `upstream_error` (the upstream page couldn't be fetched or parsed), `upstream_blocked` (the upstream is rate limiting us), `upstream_timeout` (the search took too long), `unavailable` (endpoint or dependency down). The API never sends 502 or 504.

---

[API](https://skmtc.dev/serpkite/apis/serpkite-serp-api.md) · [All operations](https://skmtc.dev/serpkite/apis/serpkite-serp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/serpkite/apis/serpkite-serp-api/revisions/f2c6dd05cfc5?raw)
