OpenAdapterOpenAdapter
Tools

Extract Data

Extract structured data from any page using CSS, XPath, regex, or text selectors. Returns clean JSON.

Base URL & authentication

Base URL: https://api.openadapter.in

All requests need an Authorization: Bearer sk-cv-... header. Generate or copy your API key from the Dashboard → API Keys page.

Endpoint: POST /v1/tools/scrape/extract Cost per call: 0.15 credits Minimum plan: free

Extract structured data from any page using CSS, XPath, regex, or text selectors. Returns clean JSON keyed by selector name.

Request

selectors is an array of selector objects:

FieldNotes
nameOutput key for the value(s) found
typecss, xpath, regex, or text
queryThe selector / pattern itself
attributeOptional — attribute name to extract instead of inner text (e.g. href)
allOptional — set true to return an array of all matches instead of just the first

mode accepts fast, stealth, or dynamic (JS-rendered).

curl https://api.openadapter.in/v1/tools/scrape/extract \
  -H "Authorization: Bearer $OPENADAPTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "selectors": [
      {"name": "title", "type": "css", "query": "h1"},
      {"name": "links", "type": "css", "query": "a", "attribute": "href", "all": true}
    ],
    "mode": "fast"
  }'
import requests

resp = requests.post(
    "https://api.openadapter.in/v1/tools/scrape/extract",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "url": "https://example.com",
        "selectors": [
            {"name": "title", "type": "css", "query": "h1"},
            {"name": "links", "type": "css", "query": "a", "attribute": "href", "all": True},
        ],
        "mode": "fast",
    },
)
print(resp.json())
const res = await fetch('https://api.openadapter.in/v1/tools/scrape/extract', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.OPENADAPTER_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://example.com',
    selectors: [
      { name: 'title', type: 'css', query: 'h1' },
      { name: 'links', type: 'css', query: 'a', attribute: 'href', all: true },
    ],
    mode: 'fast',
  }),
});
console.log(await res.json());

Pricing

Each call costs 0.15 credits. Available on the free plan and above.

On this page