Agentic Platform
Documentation API reference Tools Skills

Tools

HTML Extractor through CSS Selector

html_extractor_css_selector Content

Generate a CSS selector to extract data from a given HTML page.

Get the CSS selector for a given element.

Playground

Your organization, project and token stay in this browser's local storage and are sent straight to the API — this page never sees them.

POST
item
url required The URL to be used
extract_description required The description of the element for which we want the CSS selector

Billing

Fixed cost per URL requested, plus whatever fetching the page costs and one model call that writes the selector. Asking for a PageWorkers preview fetches the page a second time, through the preview.

These usage SKUs can be charged on a call, including SKUs from tools this one may call.

SKU Credits Description Used by
Tool call 1 per request Charged once per successful item, on top of any usage below.
  • This tool
GPT-5 mini (flex), input 125 per million tokens Tokens the model reads from the prompt you send.
  • This tool
GPT-5 mini (flex), output 1,000 per million tokens Tokens the model writes in its answer.
  • This tool
GPT-5 mini (flex), read from cache 12.5 per million tokens Tokens the model reads from a cached prompt. Cheaper than a fresh read.
  • This tool
GPT-5 mini (standard), input 250 per million tokens Tokens the model reads from the prompt you send.
  • This tool
GPT-5 mini (standard), output 2,000 per million tokens Tokens the model writes in its answer.
  • This tool
GPT-5 mini (standard), read from cache 25 per million tokens Tokens the model reads from a cached prompt. Cheaper than a fresh read.
  • This tool
Live page fetch 495 per 1,000 page Fetches a page from the live web as an ordinary visitor would.
Live page fetch, hard-blocked page 7,425 per 1,000 page A page that refused every gentler attempt. Charged on top of them, so a hard-blocked page costs the whole sequence.
Live page fetch, protected page 2,475 per 1,000 page A page that refused an ordinary fetch and had to be retried. Charged on top of the ordinary attempt, not instead of it.

Schemas

item is what you send, config how the tool behaves, and the response is what you get back.

Item

object
Properties
url string required

The URL to be used

extract_description string required

The description of the element for which we want the CSS selector

Example
{
  "url": "string",
  "extract_description": "string"
}

Response

object
Properties
crawl string | null

If fetched from sitecrawler, the crawl where the URL was found

Default: ""

css_selector string | null

The CSS selector extracted for the user description

Default: ""

preview CssSelectorPreview

Preview of the extracted data using the CSS selector

Type: CssSelectorPreview

Default: null

validation string | null

Validation status or error message

Default: "Error during validation"

Example
{
  "crawl": "",
  "css_selector": "",
  "preview": null,
  "validation": "Error during validation"
}

Type Definitions

4 types

These are the available sub-object types that can be used in the properties above.

CssSelectorPreview object
#
descriptors PreviewDescriptor

Items: PreviewDescriptor

Default: null

error string | null

Default: null

PreviewAttribute object
#
key string required
value string | null required
truncated boolean required
PreviewDescriptor object
#
tag string required
first_attributes array required

Items: PreviewAttribute

inner_html_excerpt PreviewExcerpt required

Type: PreviewExcerpt

inner_text_excerpt PreviewExcerpt required

Type: PreviewExcerpt

has_other_attributes boolean required
PreviewExcerpt object
#
value string | null

Default: null

truncated boolean | null

Default: null

Endpoints

POST http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/process
POST http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/batch_process
POST http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/async_process
POST http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/async_batch_process

See running a long job in the background for the polling flow.

cURL

curl -X POST "http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/process" \
  -H "Authorization: Bearer $BOTIFY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "item": {
    "url": "<url>",
    "extract_description": "<extract_description>"
  }
}'

Raw metadata