WEB_CRAWL follows a site’s links breadth first from a start address and reads each page the way WEB_SCRAPE does. You get every page’s Markdown, metadata and images in one result.
Request
Parameters
The crawl follows a link when it stays on the site (with or without
www.), matches the path patterns, names a web page rather than a file (PDFs, images, archives and other files are skipped), and is allowed by the site’s robots.txt for every crawler.
Response
For example:Credits
When you submit, the task holds 1 credit per page ofmaxPages (25 credits in the example above). When it completes, it is charged 1 credit for each page in pages, and the rest of the hold is released. Pages in failed are not charged. A crawl that returns 3 of 25 pages costs 3 credits. See Credits and limits for how holds work.
Limits and errors
- When the start page cannot be read, the task fails with
PAGE_UNAVAILABLE. Any other page that cannot be read goes tofailedand the crawl continues. - Invalid options return
422 VALIDATION_ERRORnaming the field. WEB_CRAWLignoresmarkdown,rawResponseandsearchQueries. It rejectshtmlandanalysiswith422andcitationAnalysiswith400; see unsupported flags.- Other request errors are listed in Errors.
Related
- Web map to list a site’s addresses without reading them
- Web scrape for one page