Execute a JavaScript function on HTML from SiteCrawler crawls.
Execute custom JavaScript extraction functions on HTML content from SiteCrawler.
This agent is optimized for batch processing - when processing multiple URLs,
they are sent to javascript executor together for better performance.
The JavaScript function should be in the format 'function() { ... }' and has
access to a `document` object for DOM traversal (querySelector, querySelectorAll, etc.).
If no crawl is specified (analysis_slug in config), the last successful crawl is used.
Temporary uploaded URLs on https://app.botify.com/:organization/:project/o/storage/tmp
are resolved from project storage and do not require a crawl.
Each input URL may carry a list of quality control expectations. When set,
the agent evaluates them against the extracted JSON result and reports, per
item, whether all expectations passed and the details of any failures.
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
requiredURL to execute the JavaScript function on. Temporary uploaded URLs on https://app.botify.com/:organization/:project/o/storage/tmp are allowed.
expectations
Quality control expectations the extracted result must satisfy. When provided, the agent evaluates them against the extracted JSON and reports any failures.
config
function
requiredJavaScript function to execute on the HTML. Should be in the format 'function() { ... }' and return the extracted data.
Billing
Fixed cost per item requested. The code runs against HTML you have already supplied, inside Botify, so nothing further is billed.
These usage SKUs can be charged on a call.
SKU
Credits
Description
Tool call
1 per request
Charged once per successful item.
Schemas
item is what you send, config how the tool behaves,
and the response is what you get back.
Item
object
Properties
urlstringrequired
URL to execute the JavaScript function on. Temporary uploaded URLs on https://app.botify.com/:organization/:project/o/storage/tmp are allowed.
expectationsarray
Quality control expectations the extracted result must satisfy. When provided, the agent evaluates them against the extracted JSON and reports any failures.
A sub-object pattern that at least one array item must match.
The mapping ``fields`` is keyed by the sub-object's attribute names
(e.g. ``{"review_text": "great", "review_rating": 5}``). Keys not
listed here are not checked.
For convenience, a bare sub-object is accepted as a shorthand for
``fields``: ``{"name": "Année", "value": "1982"}`` is normalised to
``{"fields": {"name": "Année", "value": "1982"}}``. To match an array of
*scalars* (e.g. a list of URLs), pass the scalar directly in
``expected_array_items`` rather than an :class:`ArrayItemMatch`.
fieldsobject
Sub-object fields to match (subset, no exhaustivity required)
instructionsstring | null
Free-form note describing how to locate this item in the page. Never used by the evaluator — purely informational.
An expectation about a single field of the extracted JSON.
Exactly one of ``expected_value`` (for scalar fields),
``expected_array_items`` (for array-item patterns) or
``expected_length`` (for the length of an array field) must be set. The
``operator`` is only meaningful for scalar and length expectations.
fieldstringrequired
Name of the extracted JSON field to check. Supports dotted paths for nested objects (e.g. ``dimensions.width``).
operatorstring
Predicate applied between the actual value and ``expected_value`` (scalar expectations) or between the array length and ``expected_length`` (length expectations). Defaults to ``equals``. Length expectations support only ``equals`` / ``gt`` / ``gte`` / ``lt`` / ``lte``.
Values:equalscontainsmatches_regexgtgteltlte
Default: "equals"
expected_valuenull
Expected scalar value (set when the field is a scalar)
Default: null
expected_array_itemsArrayItemMatch
Patterns to match against array items (set when the field is an array). Each pattern is either a scalar — the array must contain an item equal to it (use this for arrays of strings or numbers, e.g. image URLs) — or a sub-object of fields, in which case at least one array item must match all the listed fields. For each pattern, at least one item must match.