String Web Access API
Fetch

Response formats

Return a page as structured JSON, raw bytes, or clean Markdown.

The format field controls how /fetch returns the response. It defaults to json.

json (default)

Structured metadata and response data. The body is a JSON object with the destination's status code, filtered response headers, and the parsed body.

{
  "statusCode": 200,
  "headers": { "content-type": ["application/json"], "content-length": ["123"] },
  "data": { "message": "Hello World" }
}

raw

The original response bytes, with upstream headers forwarded where possible. The body is always gzip-compressed (Content-Encoding: gzip), and the original destination status code is returned in the x-status-code header.

curl https://request.usestring.ai/v1/fetch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://httpbin.org/html", "format": "raw" }'

markdown

HTML responses are distilled to clean, readable Markdown. Navigation, ads, and other boilerplate are removed (content-dense listing and data pages keep their full body), while headings, lists, links, tables, code blocks, and inline formatting are preserved. Relative URLs are rewritten against the request URL's origin.

Any structured data embedded in the page is preserved as fenced JSON code blocks, since it often carries the page's underlying data. Non-HTML responses are returned verbatim as text. The body is sent with Content-Type: text/markdown; charset=utf-8.

curl https://request.usestring.ai/v1/fetch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://example.com/article", "format": "markdown" }'

Markdown is great for LLMs

The markdown format strips the boilerplate that wastes tokens and confuses models, while keeping the data. It's the recommended format when feeding pages into an LLM pipeline.