Studio and extraction rules#
Studio turns a public page into a reusable scraper. Describe the fields and records you want, or choose a Page, Article or Product template. If your request has no URL, Studio picks a public page to start from and tells you which one. Review source-backed sample records and missing fields before saving.
| Action | Behaviour | Credit cost |
|---|---|---|
| Pick a page | A request with no URL gets a suggested public page to generate rules from. | 0 |
| Generate rules | Prompt and source sample go to the configured AI provider; rules are validated and tested on one fetched page. | 1 for a usable preview |
| Save a scraper | Preserve the reviewed extraction rules and source. | 0 |
| Run a scraper | Reuse saved rules and inspect asynchronous results in request history. | 1 per successful page |
| Schedule runs | Off by default; every 24 hours or every 7 days. | Same successful-page rate |
Selecting a schedule authorizes recurring runs. Turn it off or delete the saved scraper to stop future admissions. Already admitted operations keep their inputs. A lack of credits or a failed/invalid prior run can pause a schedule; inspect its state before relying on it.
Generated scrapers return bounded extraction rules, not executable code. A preview covers one fetched page, not automatic pagination, scraper repair or an entire site's accuracy. Manual templates remain available when generation is unavailable.
Use custom rules through the scrape API
curl -X POST https://api.luni.gg/v1/scrape \
-H "Authorization: Bearer $LUNI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: custom-rules" \
-d '{"url":"https://example.com","formats":["markdown"],"template":"custom","extractionPlan":{"version":1,"name":"Page heading","description":"Read the main heading","itemSelector":"$page","fields":[{"name":"title","selector":"h1","attribute":"text","required":true}]}}'Use $page for one document or a bounded item selector for repeated records. Plans allow at most 12 fields; unsupported selectors and executable actions are rejected. Saved and generated plan output uses structuredData with source evidence and explicit missing values.
