Parser Presets
Learn how parser presets work and how to use them in your scraping jobs.
Last updated
Was this helpful?
Learn how parser presets work and how to use them in your scraping jobs.
Last updated
Was this helpful?
Was this helpful?
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
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/presets
Retrieve a preset
GET
/v1/parsers/presets/{preset_name}
Update a preset
PUT
/v1/parsers/presets/{preset_name}
Delete a preset
DELETE
/v1/parsers/presets/{preset_name}
List all presets
GET
/v1/parsers/presets
View usage and performance statistics
GET
/v1/parsers/presets/{preset_name}/stats
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"
}
]
}
}
}
Endpoint: POST https://realtime.oxylabs.io/v1/queries
Payload:
{
"source": "universal",
"url": "https://sandbox.oxylabs.io/products",
"parse": true,
"parser_preset": "my_new_parser"
}
Endpoint: GET https://data.oxylabs.io/v1/parsers/presets/{preset_name}
Endpoint: PUT https://data.oxylabs.io/v1/parsers/presets/{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"}
]
}
}
}
Endpoint: DELETE https://data.oxylabs.io/v1/parsers/presets/{preset_name}
Endpoint: GET https://data.oxylabs.io/v1/parsers/presets
Endpoint: GET https://data.oxylabs.io/v1/parsers/presets/{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/presets/{preset_name}/stats?date_from=2025-08-05T9&date_to=2025-08-05T14