Documentation has been updated: see help center and changelog in one place.

Custom Parser

See the steps for a quick start with Oxylabs Custom Parser.

Custom Parser is a free Web Scraper API feature that lets you create parsing and data processing logic that’s executed on a raw HTML result. You can automatically generate parsers using AI or write them manually for advanced scenarios.

For in-depth instructions and examples, refer to these pages:

Getting started Generating parsers via API Parser Presets

Writing instructions manually List of parsing functions


Quick start

1. Generate a parser

We recommend starting out with our AI-powered OxyCopilot tool that lets you generate scrapers and parsers without writing any code.

Follow the steps shown in the video to generate a parser:

Here are the same steps shown in the video:

  1. Enter the URL(s) you want to scrape and parse

  2. Specify any parameters such as JavaScript rendering

  3. Write a prompt that describes what you want to parse

  4. Run OxyCopilot

Once you’re happy with the generated parser, load the instructions.

2. Save the parser as a preset

You can easily save your generated parsers through OxyCopilot for later use. See the steps below:

  1. Assign the preset to a specific API user

  2. Click Save

  3. Enter the preset name and the description (optional)

After saving the preset, you can use it with API requests.

3. Use the parser with API requests

To use your preset with Web Scraper API, send a payload with the parser_preset parameter set to your preset's name. In the code samples below, we're reusing the example_parser preset created in previous steps.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "universal",
        "url": "https://example.com/",
        "parse": true,
        "parser_preset": "example_parser"
    }'
Output sample
{
  "results": [
    {
      "content": {
        "title": "Example Domain",
        "parse_status_code": 12000
      },
      "created_at": "2025-10-24 10:04:59",
      "updated_at": "2025-10-24 10:05:00",
      "page": 1,
      "url": "https://example.com/",
      "job_id": "7387428891226308609",
      "is_render_forced": false,
      "status_code": 200,
      "type": "parsed",
      "parser_type": "preset",
      "parser_preset": "example_parser"
    }
  ]
}

Getting the HTML content of a parsed job

You may also retrieve the raw HTML result by adding ?type=raw to the end of the result retrieval URL. Read more here.

Last updated

Was this helpful?