Web Extract
The details you need from a page as ready JSON data: list the fields — a price, a date, a list of products — and a language model finds them on the page.
Specifications
Description
What it is
Web Extract opens a page and takes from it only what you need, as ready JSON data. You list the fields (for example, "product name", "price", "publication date"), and a language model finds this information on the page and puts it into your fields.
Use it when you need to:
- take a price, specifications, contacts, a date or an author from a page;
- turn a page with a list (products, jobs, events) into a list of records;
- fill a spreadsheet or a database with information from pages without parsing them by hand.
The model sees not only the main text but also the page tables and the data the site fills the page with using scripts. That is why long lists of products or prices are usually found in full.
If you need the whole page text, use Web Scrape.
What you need
- An API key. Create it in your account dashboard. Send the key with every request in the
Authorization: Bearer YOUR_API_KEYheader, replacingYOUR_API_KEYwith your key. Do not publish the key or share it with anyone: requests made with it are paid from your balance. - Money on your balance. Every request is paid; the price is shown on this page.
- A program that sends HTTP requests. The command line (
curl), Python with therequestslibrary or any API testing tool will do. Ready-made examples are in the "Code examples" block below: copy one, put in your key and run it.
How a request is built
- The method and address are in the "Endpoints" block on this page.
- Headers:
Authorization: Bearer YOUR_API_KEYandContent-Type: application/json. - The request body is JSON:
"name": valuepairs in curly braces, separated by commas. Text goes in double quotes; numbers andtrue/falsego without quotes.
Request example
In the examples PAGE_URL is the full page address starting with https://.
Separate fields:
{
"url": "PAGE_URL",
"schema": {
"title": "product name",
"price": "price as a number, without currency",
"currency": "price currency",
"in_stock": "whether it is in stock: true or false"
}
}A list of records:
{
"url": "PAGE_URL",
"schema": {
"items": "all products on the page: [{name, price, rating}]"
}
}Briefly, in one line:
{"url": "PAGE_URL", "schema": "publication date and author of the article"}Request parameters
url— required. The full page address.schema— required. What to extract. The field can also be calledfields. There are two options. An object: the key is the field name in the response, the value is a plain-language description; this way you know exactly which fields you get. A string: a description of what you need; the model then chooses the field names.include_tables— whether to show the page tables to the model. On by default.include_data— whether to show the page data (lists of products, prices and so on) to the model. On by default.
If you turn both off ("include_tables": false, "include_data": false), the model gets only the beginning of the main page text. Such a request is cheaper and faster, but it suits only short pages where what you need is at the top.
What the response contains
{
"object": "web_extract",
"url": "PAGE_URL",
"data": {
"title": "Product name",
"price": 19.9,
"currency": "USD",
"in_stock": true
},
"raw": null
}data— the information found, by your fields. If a field is not on the page, its value isnull.raw— usuallynull. If the model could not return valid JSON,datais an empty object{}andrawcontains the model reply as plain text. In that case simplify the field descriptions and repeat the request.
How to describe fields for more accurate results
- Write field names in Latin letters without spaces:
price,published_at. They are easier to use in a program. - Specify the value format: "price as a number, without currency", "date as YYYY-MM-DD", "true or false".
- For a list, show what one record consists of:
[{name, price}]. - If you do not need the whole list, say so: "the 5 cheapest products", "only jobs in Berlin".
- One request — one page. For several pages, send several requests.
- The model can make mistakes, especially in long lists with similar numbers. Spot-check important values on the page itself.
Time and limits
- A response takes 5–60 seconds: the larger the page, the longer. Set your program to wait for a response for at least 3 minutes.
- The model does not read very long pages to the end, only the first part.
- Page limits are the same as for Web Scrape: the page must open without signing in; the service does not click buttons or scroll; files (PDF, images) are not parsed; some sites block automated programs.
Pricing
The price consists of reading the page and the model work by the amount of text. That is why a large page with lists costs more than a short article. To save on simple pages where what you need is at the top, turn off include_tables and include_data. Prices are shown on this page.
If you get an error
The server replies with an HTTP status code. 200 means everything is fine; any other code means an error:
401— the key is missing or wrong. Check the header: the wordBearer, a space and the whole key.402— not enough money on your balance. Top it up in your account dashboard.403— this key is not allowed to use the tool. Check the key permissions in your dashboard.429— too many requests per minute. Wait a little and try again.503— the service is temporarily unavailable. Try again in a minute.- Other codes usually mean the request is malformed: a required field is missing or the JSON has a mistake (an extra or missing comma, single quotes instead of double). Compare your request with the example on this page.
Errors related to the page itself:
404— the site has no page at this address. Check the address.503— the site did not open: the address has a typo, the site does not respond or blocks automated programs. Check the address in a browser and try again later.
Endpoints
Code examples
Other NeuralBridge models
/v1 in base_url. For Anthropic SDK — without /v1.