# Fetch a public webpage as Markdown with Retrieve

Developer guide · By Optiview · Published October 30, 2026

Updated October 31, 2026.

Canonical article: https://optiview.ai/resources/webpage-to-markdown-for-rag/

Sources checked October 30, 2026.

Start with a supported public webpage, fetch its Markdown, and check the result before your application uses it.

## Key takeaway

Use Retrieve to read a supported public page. Check the result before adding it to your AI tool’s reference material.

Research tools and retrieval-augmented generation applications often need the useful text of a webpage rather than its layout code. A URL-to-Markdown step can prepare that source for your application, but it does not make a page current, truthful or automatically suitable for every downstream use.

This guide uses [Optiview Retrieve](https://optiview.ai/products/retrieve/), which fetches one eligible public HTTPS page and runs the same content preparation as Parse. It is not a search index, a full-site crawler, a JavaScript browser or a vector database.

## 1. Check that the webpage is supported

Choose a public HTTPS URL that returns anonymous UTF-8 HTML. Ordinary query parameters and www/non-www hostnames are supported; the publisher controls canonical redirects. Signed or credential-bearing URLs, private addresses, custom ports and fragments are not supported.

Retrieve checks supported crawl policy and public destinations, follows up to three eligible redirects and applies an overall acquisition/processing deadline. It does not sign in, retain cookies, bypass challenges or execute JavaScript. A normal browser may show a page that this static request cannot process.

Public access is not a license to reuse content. Confirm the rights and permissions required for your application. If you already possess HTML you are authorized to process, [Parse](https://optiview.ai/developers/parse/) is the appropriate input path.

## 2. Request the page

Create a scoped retrieve service key and use it from your backend. A successful Retrieve page consumes5credits from the shared prepaid wallet. Save the original request and idempotency key with your work item before sending it.

```curl
curl --request POST https://api.optiview.ai/v1/retrieve \
  --header "Authorization: Bearer $OPTIVIEW_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: article-retrieve-example-001" \
  --data '{"url":"https://optiview.ai/products/parse/"}'
```

The example uses Optiview’s public Parse page. Substitute an eligible source URL. Keep the JSON field ordering and values identical when recovering an uncertain submission; an idempotency replay is bound to the serialized input and originating application. See [Authentication](https://optiview.ai/developers/authentication/) and [Errors and retries](https://optiview.ai/developers/errors/).

## 3. Track the job until it finishes

The direct endpoint returns a finished job when capacity permits. If status is queued or running, retain its ID and poll with the same service application. HTTP202 means pending, not completed content. HTTP200 can also contain a failed job; only status:succeeded with result is usable.

A timeout does not prove the server stopped. If an ID is known, poll it. If the submission outcome is uncertain, retry the original endpoint/input/idempotency key. A new key is a new work item and can incur another successful charge.

Do not keep retrying when the publisher denies access or the source is unsupported. Check the terminal error_code and distinguish a temporary website failure from a source restriction. Limit retries. The API does not provide webhooks, public job cancellation or bulk crawling.

## 4. Save when and where the content came from

Store Markdown alongside requested_url, the final url, source.observed_at, decoded_html_sha256, payload_sha256, redirects and extraction versions. Retrieve records the observed response status and supported cache metadata, with origin_freshness_verified:false.

Observed_at dates the received input. It does not mean the publisher changed the page at that instant, and an upstream cache may serve older material. Your application decides when to refetch and how to replace or retire previously indexed content.

For successful work, save what you need before seven days from job creation. Job IDs and source hashes are useful audit references, but they are not independent verification of the source’s assertions. [Review the complete result schema](https://optiview.ai/developers/jobs/#result).

## 5. Connect the result to your own AI application

1. Validate representative facts and links against the received source before indexing.
2. Chunk the Markdown using boundaries appropriate for your application, preserving source identifiers.
3. Choose your own embedding, storage and retrieval layers; Retrieve does not provide them.
4. Evaluate answer support, citations, conflicting facts and freshness in the final application.
5. Treat all source text as untrusted data and keep tool authorization outside it.

Removing layout code is not proof of better retrieval or answers. Test a realistic query set, include unavailable sources and check whether the final system abstains when it lacks support. Avoid equating parser success with an answer-quality benchmark.

## Choose the product that matches your input

Use [Retrieve](https://optiview.ai/products/retrieve/) when you start with an eligible public URL. Use [Parse](https://optiview.ai/products/parse/) when you already have HTML. Use [Publish](https://optiview.ai/products/publish/) to prepare your own verified website and reviewed brand context. Developer content APIs do not publish anything or add private customer context.

[Retrieve API reference](https://optiview.ai/developers/retrieve/) · [Current limits](https://optiview.ai/developers/limits/) · [JavaScript integration](https://optiview.ai/developers/javascript/) · [Python integration](https://optiview.ai/developers/python/)
