A selector is the rule that extracts one field from a page.

{
  "property_name": "price",
  "selector": "span.product-price",
  "attribute_type": "TEXT"
}

- `property_name` — the key in the result JSON. Append `[]` to return every match as

an array.

- `selector` — the CSS selector, or a JSON path when the type is `GJSON`.

- `attribute_type` — what to read.

- `attribute` — with `ATTRIBUTE`, the HTML attribute to read (`href`, `src`, `data-id`).

- `children` — with `OBJECT`, the nested selector list.

attribute_type values

- `TEXT` — the text inside the element.

- `ATTRIBUTE` — an HTML attribute value, used together with `attribute`.

- `INNER_HTML` — the element's HTML content.

- `JSON` — parses the content as JSON.

- `GJSON` — reads a field from a JSON response using dot notation, e.g. `data.items.0.price`.

- `URL` — the page's own URL.

- `BODY` — the entire page body.

- `OBJECT` — builds a nested object from `children`.

- `GOJA` — custom extraction logic written in JavaScript.

Pattern 1 — single fields

"selectors": [
  { "property_name": "title", "selector": "h1", "attribute_type": "TEXT" },
  { "property_name": "price", "selector": ".price", "attribute_type": "TEXT" }
]
{ "title": "Product Name", "price": "$199.90" }

Pattern 2 — lists with the [] suffix

{
  "property_name": "links[]",
  "selector": "a.product-link",
  "attribute_type": "ATTRIBUTE",
  "attribute": "href"
}
{ "links": ["/product/1", "/product/2", "/product/3"] }

Pattern 3 — lists of objects

The most common pattern: several fields per card or row in a listing.

{
  "property_name": "products[]",
  "selector": ".product-card",
  "attribute_type": "OBJECT",
  "children": [
    { "property_name": "name", "selector": ".name", "attribute_type": "TEXT" },
    { "property_name": "price", "selector": ".price", "attribute_type": "TEXT" },
    {
      "property_name": "url",
      "selector": "a",
      "attribute_type": "ATTRIBUTE",
      "attribute": "href"
    }
  ]
}
{
  "products": [
    { "name": "Product A", "price": "$199", "url": "/product-a" },
    { "name": "Product B", "price": "$249", "url": "/product-b" }
  ]
}

Selectors inside `children` are matched within the element matched by the parent selector.

Pattern 4 — reading a JSON response with GJSON

When you call a JSON API with `mode: "http"`, CSS selectors do not apply. Use `GJSON` to pull

fields out of the response body.

"selectors": [
  { "property_name": "echoed_name", "selector": "json.name", "attribute_type": "GJSON" },
  { "property_name": "first_item", "selector": "data.items.0.title", "attribute_type": "GJSON" }
]

Limiting results

{
  "urls": ["https://shop.example.com/listing"],
  "selectors": [],
  "max_items": 50
}

Auto-generated class names such as `css-1x2y3z` change on every deploy. Prefer `data-*`

attributes or structural selectors, and re-check your selectors when a target site is

redesigned.

If a selector returns nothing, first view the page source: if the element is missing from the

server HTML, the content is rendered by JavaScript — switch to `mode: "browser"` and set an

appropriate `wait_until`. You can also draft selectors automatically with

`POST /webhook/generate-schema`.

Last updated: September 21, 2026