Parser Presets
You can save, reuse, and modify custom parsing instructions through the Web Scraper API. Once you create a parser preset, we'll host it on our system, enabling you to reference it in your scraping jobs via the parser_preset
parameter in the payload.
This feature offers several key capabilities:
Save and manage your own parsers on our system
Easily reuse presets across multiple scraping jobs
Create, retrieve, update, delete, and list all presets
Access performance and usage statistics of a preset
API reference
When creating and managing parser presets, you can use Realtime and Push-Pull integration methods:
Realtime integration endpoint
https://realtime.oxylabs.io/v1/parsers
Push-Pull integration endpoint
https://data.oxylabs.io/v1/parsers
The table lists each available operation and its endpoint path:
Create a preset
POST
/v1/parsers
Retrieve a preset
GET
/v1/parsers/{preset_name}
Update a preset
PUT
/v1/parsers/{preset_name}
Delete a preset
DELETE
/v1/parsers/{preset_name}
List all presets
GET
/v1/parsers
View usage and performance statistics
GET
/v1/parsers/{preset_name}/stats
Usage examples
Create a preset
Endpoint: POST https://data.oxylabs.io/v1/parsers
Payload:
{
"name": "my_new_parser",
"description": "Extract text from all H4 elements on the page.",
"parsing_instructions": {
"titles": {
"_fns": [
{
"_args": ["//h4/text()"],
"_fn": "xpath"
}
]
}
}
}
Use a preset
Endpoint: POST https://realtime.oxylabs.io/v1/queries
Payload:
{
"source": "universal",
"url": "https://sandbox.oxylabs.io/products",
"parse": true,
"parser_preset": "my_new_parser"
}
Retrieve a preset
Endpoint: GET https://data.oxylabs.io/v1/parsers/{preset_name}
Update a preset
Endpoint: PUT https://data.oxylabs.io/v1/parsers/{preset_name}
Define the fields of the preset you want to update. In the following example, only the parsing_instructions
will get updated.
Payload:
{
"parsing_instructions": {
"titles": {
"_fns": [
{
"_args": ["//h4/text()"],
"_fn": "xpath"
}
]
},
"prices": {
"_fns": [
{
"_args": [".price-wrapper"],
"_fn": "css"
},
{"_fn": "element_text"}
]
}
}
}
Delete a preset
Endpoint: DELETE https://data.oxylabs.io/v1/parsers/{preset_name}
List all presets
Endpoint: GET https://data.oxylabs.io/v1/parsers
View statistics
Endpoint: GET https://data.oxylabs.io/v1/parsers/{preset_name}/stats
You can filter results by date and time using the date_from
and/or date_to
URL parameters. Use the format YYYY-MM-DDTHH
, where T
indicates the time, and HH
is the hour in a 24-hour format.
For example, to get statistics from 9 AM to 2 PM on August 5, 2025:
https://data.oxylabs.io/v1/parsers/{preset_name}/stats?date_from=2025-08-05T9&date_to=2025-08-05T14
Last updated
Was this helpful?