Web Crawl
Site crawl by links: collects the text of several pages starting from a start page. Runs in the background — start a job, then check when it is ready.
Specifications
Description
What it is
Web Crawl walks through a site: it opens the start page, finds links on it, follows them and collects the main text of every page. This is handy when you need several pages of one section at once: help articles, pages of a small site, materials of a category.
A crawl takes time, so it works in two steps:
- You start a crawl and immediately get a job number —
id. - From time to time you ask whether the job is ready. When the crawl is finished, the response contains the collected pages.
If you need just one page, Web Scrape is simpler and faster.
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.
Step 1. Start a crawl
Method POST, the address ends with /v1/crawl. In the example PAGE_URL is the full start page address starting with https://.
{"seed_url": "PAGE_URL", "max_pages": 5}Parameters:
seed_url— required. The address of the page the crawl starts from. The field can also be calledurl.max_pages— how many pages to collect, including the start page. Default: 5. Currently one crawl can collect up to 10 pages: if you ask for more, the service collects 10.max_depth— how far to follow links. Currently only1is supported: the start page and the pages it links to. To read only the start page, set"max_pages": 1.same_domain—true(default): only pages of the same site as the start page.false: links to other sites may be followed too. The service treats an address withwww.and without it as different sites, so start from the address the site itself opens with.
The response comes immediately:
{"object": "web_crawl", "id": "0c1f75e0-ff84-4873-98db-5debce57d5ba", "status": "queued"}Save the id: you will use it to get the result.
Step 2. Check the status and get the pages
Method GET, the address ends with /v1/crawl/{id}: replace {id} with the job number from step 1. Use the same Authorization header; no request body is needed.
While the crawl is running, the response looks like this:
{"object": "web_crawl", "id": "0c1f75e0-…", "status": "running", "pages_done": 3, "error": null}status values:
queued— the job is waiting in the queue, the crawl has not started yet;running— the crawl is in progress;pages_doneshows how many pages are already collected;done— finished, the pages are in thepagesfield;error— the crawl failed, the reason is in theerrorfield.
When status is done:
{
"object": "web_crawl",
"id": "0c1f75e0-…",
"status": "done",
"pages_done": 2,
"error": null,
"pages": [
{"url": "PAGE_URL", "title": "Start page title", "content": "Page text in Markdown…", "depth": 0},
{"url": "https://…", "title": "Another page title", "content": "…", "depth": 1}
]
}urlandtitle— the page address and title;content— the main page text in Markdown (the same as in Web Scrape);depth—0for the start page,1for pages found through its links.
The response also has service fields; you can ignore them.
Tips
- Check the status every 3–5 seconds, not more often. A small crawl usually finishes within half a minute to a minute.
- If a job stays
queuedfor a long time, other crawls are ahead of it in the queue. Wait a little. - Pages that fail to open are skipped and the crawl goes on, so you may get fewer pages than
max_pages. - Start from a contents page (a section, a list of articles): then its links lead to the materials you need rather than random pages.
- A crawl does not collect page tables and data. If you need them, read the page with Web Scrape using
include_tablesandinclude_data.
Limits
The same as for Web Scrape: pages 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
Every collected page is paid; the price is shown on this page. If no page could be collected, one page is charged.
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.
Endpoints
Code examples
Other NeuralBridge models
/v1 in base_url. For Anthropic SDK — without /v1.