Scrape a page#

POST /v1/scrape

Retrieve one public page as Markdown, processed HTML, raw HTML or links. Combine output formats in one request. A useful successful page costs one credit; an error, challenge or unusable page consumes zero page credits.

ParameterTypeDefaultDescription
urlstringRequiredPublic HTTP(S) URL on port 80 or 443. Private addresses and embedded credentials are rejected.
formatsstring[]["markdown"]Any combination of markdown, html, rawHtml and links.
onlyMainContentbooleantruePrefer the main page content over surrounding navigation.
timeoutinteger30000Fetch budget in milliseconds, from 1 to 30000.
templatestringpagepage, article, product or custom. Custom requires extractionPlan.
removeBase64ImagesbooleanfalseRemove inline base64 image data before content extraction.
curl -X POST https://api.luni.gg/v1/scrape \
  -H "Authorization: Bearer $LUNI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: scrape-formats" \
  -d '{"url":"https://example.com","formats":["markdown","links"],"onlyMainContent":true}'

Each template adds structuredData containing observed fields, missingFields and sourceURL. Missing facts are not inferred; a page without a template's required fields (an article's title and body, a product's name) fails without a charge. See Studio and extraction rules for custom plans.

Retrieval starts with public HTTP. When the source looks challenged and a renderer gateway is configured, Luni escalates automatically — clients do not choose a render mode. Login cookies, arbitrary browser actions and screenshots are not accepted by this endpoint.