Docs · Scraping

Smart scrape (auto-routing)

Skip the browser when the page does not need it.

POST /v1/scrape/smart

Detects whether a page requires JavaScript. Static pages return in milliseconds; dynamic pages get the full stealth browser. The response includes render_mode so you can see which path was taken.

Parameters

Name Type Required Default Description
url string yes URL to fetch.
format string no markdown Same options as /v1/scrape.
timeout integer no 30 Per-request timeout in seconds.

Request

curl -X POST https://api.datasonar.dev/v1/scrape/smart \
  -H "Authorization: Bearer osk_..." \
  -d '{"url": "https://example.com"}'

Response

{
  "status": "success",
  "url": "https://example.com",
  "content": "...",
  "render_mode": "http_only",
  "js_detected": false,
  "time_ms": 148
}

Related