CssSelectorPreview
object
descriptors
PreviewDescriptor
error
string | null
Tools
Generate a CSS selector to extract data from a given HTML page.
Get the CSS selector for a given element.
Your organization, project and token stay in this browser's local storage and are sent straight to the API — this page never sees them.
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. |
|
| GPT-5 mini (flex), input | 125 per million tokens | Tokens the model reads from the prompt you send. |
|
| GPT-5 mini (flex), output | 1,000 per million tokens | Tokens the model writes in its answer. |
|
| 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. |
|
| GPT-5 mini (standard), input | 250 per million tokens | Tokens the model reads from the prompt you send. |
|
| GPT-5 mini (standard), output | 2,000 per million tokens | Tokens the model writes in its answer. |
|
| GPT-5 mini (standard), read from cache | 25 per million tokens | Tokens the model reads from a cached prompt. Cheaper than a fresh read. |
|
| 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. |
|
item is what you send, config how the tool behaves,
and the response is what you get back.
url
string
required
The URL to be used
extract_description
string
required
The description of the element for which we want the CSS selector
{
"url": "string",
"extract_description": "string"
}
crawl
string | null
If fetched from sitecrawler, the crawl where the URL was found
css_selector
string | null
The CSS selector extracted for the user description
preview
CssSelectorPreview
Preview of the extracted data using the CSS selector
validation
string | null
Validation status or error message
{
"crawl": "",
"css_selector": "",
"preview": null,
"validation": "Error during validation"
}
These are the available sub-object types that can be used in the properties above.
CssSelectorPreview
object
descriptors
PreviewDescriptor
error
string | null
PreviewAttribute
object
key
string
required
value
string | null
required
truncated
boolean
required
PreviewDescriptor
object
tag
string
required
first_attributes
array
required
inner_html_excerpt
PreviewExcerpt
required
inner_text_excerpt
PreviewExcerpt
required
has_other_attributes
boolean
required
PreviewExcerpt
object
value
string | null
truncated
boolean | null
http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/process
http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/batch_process
http://agents.botify.com/{organization}/{project}/html_extractor_css_selector/async_process
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 -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>"
}
}'