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.
| Parameter | Type | Default | Description |
|---|---|---|---|
url | string | Required | Public HTTP(S) URL on port 80 or 443. Private addresses and embedded credentials are rejected. |
formats | string[] | ["markdown"] | Any combination of markdown, html, rawHtml and links. |
onlyMainContent | boolean | true | Prefer the main page content over surrounding navigation. |
timeout | integer | 30000 | Fetch budget in milliseconds, from 1 to 30000. |
template | string | page | page, article, product or custom. Custom requires extractionPlan. |
removeBase64Images | boolean | false | Remove 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.
