Quickstart
The API fetches a web page and returns the values matching the CSS selectors you send.
Before you start
Create an API key in Dashboard → API keys, then set the base URL and your key (see Authentication):
export SCRAPE_ENGINE_URL="https://<your API host>/v1"
export SCRAPE_ENGINE_KEY="sk_…"The examples below are live: press Send to run them from this page.
Your first request
Send a POST request to /scrape with the target_url of the page and a list of CSS selectors in fields:
Actions
Data
data holds one value per selector, in the same order:
{ "data": ["Web scraping"] }One value per selector by default
Each selector returns only the first matching element, or null if nothing matched. To get every match, see Get every match.
Read an attribute
To read an attribute of the element instead of its text, such as a link target or an image source, write the selector as an object with an attribute:
Actions
Data
{
"data": [
"Web scraping",
"https://en.wikipedia.org/wiki/Web_scraping"
]
}Next: the full POST /scrape reference, or try anything in the Playground.