NeuralBridge
Sign in Download IDE
NeuralBridge

Web Scrape

scraping

Web page text by link: the main content without menus and ads in Markdown, optionally with the page tables and data.

Specifications

Context window
—
Max tokens in response
—
Vendor
NeuralBridge
Release
—
Login
text
Output
text

Description

What it is

Web Scrape opens a page by its address and returns its main text without menus, ads, buttons and footer. The text comes in Markdown: headings, lists and links are kept, so it is easy to read, store and pass to a language model.

On request the service also returns two kinds of content that do not get into the main text:

  • the page tables;
  • the page data — information the site fills the page with using scripts: for example, a list of products with prices or catalogue rows.

Use it when you need to:

  • get the text of an article, a manual or a help page by its link;
  • pass the page content to a chatbot so it can answer based on it;
  • take a table or a list from a page in a form that is easy to process.

If you need specific details rather than the whole text (a price, a date, an author), Web Extract is more convenient: it returns the fields you ask for.

What you need

  • An API key. Create it in your account dashboard. Send the key with every request in the Authorization: Bearer YOUR_API_KEY header, replacing YOUR_API_KEY with 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 the requests library 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_KEY and Content-Type: application/json.
  • The request body is JSON: "name": value pairs in curly braces, separated by commas. Text goes in double quotes; numbers and true / false go without quotes.

Request example

In the examples PAGE_URL is the full page address as shown in the browser address bar, starting with https:// or http://.

Page text only:

{"url": "PAGE_URL"}

Text, tables and page data:

{"url": "PAGE_URL", "include_tables": true, "include_data": true}

Request parameters

  • url — required. The full page address.
  • include_tables — true to get the page tables in the tables field. Off by default.
  • include_data — true to get the page data in the data field. Off by default. It helps on pages where a list (products, prices, ratings) is drawn by a script and is missing from the main text or incomplete.

Tables and data do not change the price of a request.

What the response contains

{
  "object": "web_scrape",
  "url": "PAGE_URL",
  "content": "# Article title\n\nThe first paragraph of the article…",
  "content_type": "text/html; charset=utf-8",
  "tables": [
    "| Name | Price |\n|---|---|\n| Product 1 | 100 |\n| Product 2 | 250 |"
  ],
  "data": [
    {
      "path": "…",
      "total": 120,
      "columns": ["name", "price.amount", "price.currency"],
      "records": [
        {"name": "Product 1", "price.amount": 100, "price.currency": "USD"}
      ]
    }
  ]
}
  • content — the main page text in Markdown. \n in JSON means a line break; in your program it becomes a normal line break.
  • content_type — the content type reported by the site (a service field).
  • tables — present only with "include_tables": true. A list of tables, each a Markdown string with columns separated by |. Empty tables and one-row tables (usually used only for layout) are skipped.

The data field is present only with "include_data": true. It is a list of record sets, largest first. Each set has:

  • total — how many records the set has on the page;
  • records — the records themselves. If total is greater than the number of items in records, the long list was cut;
  • columns — the record field names. Nested fields are written with a dot: price.amount is the amount field inside price. Fields that have the same value in every record are left out;
  • path — where in the page data the set was found (a service field; it helps to recognise the same set the next time you read this page).

If the page has no tables or data, tables and data are empty lists [].

Limits

  • The page must open without signing in. Private sections and password-protected pages cannot be read.
  • The service does not click buttons or scroll. If text appears only after a visitor does something, it will not be in content. On some of these pages include_data helps.
  • The service is made for web pages. Files (PDF, documents, images) are not turned into text: content will be empty.
  • The service waits up to 30 seconds for the site to respond. A very slow site may not make it.
  • Some sites block automated programs. Then you get an error or an empty content.
  • Very long tables and lists are cut.

Tips

  • If content is empty or lacks the list you need, repeat the request with "include_tables": true and "include_data": true.
  • To read several pages of one site at once, use Web Crawl.
  • You can pass the text from content straight to a language model together with your question: models understand Markdown well.

Pricing

Every request (one page) is paid at a fixed price 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 word Bearer, 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

POSThttps://api.neuralbridge.ru/v1/scrapeprimary
Scrape — Extract readable content of a page by URL. With "include_tables": true the response also has the page tables (markdown, field tables); with "include_data": true — records from the data the site fills the page with by script (field data: path, total, columns, records).

Code examples

python
import requests

response = requests.post(
    "https://api.neuralbridge.ru/v1/scrape",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    # PAGE_URL — полный адрес страницы, например из результатов поиска
    json={"url": "PAGE_URL", "include_tables": True},
    timeout=90,
)
response.raise_for_status()
page = response.json()
print(page["content"][:2000])  # начало текста страницы
for table in page.get("tables", []):
    print(table)
For OpenAI SDK, specify /v1 in base_url. For Anthropic SDK — without /v1.
Prices
Rate to be confirmed
The request cost in rubles — in the response, field usage.cost
Identifier
neuralbridge/web-scrape-06195
Get API key