View .md

Map

List a site's URLs quickly, without converting any content. Map reads the site's sitemaps and runs a links-only crawl, then returns the same-site URLs it found, optionally filtered by a search term. Use it to plan a crawl, pick pages for a batch scrape, or find where a topic lives on a site.

POST/orgs/{id}/map

Requires an API key with the crawl scope. Map is synchronous and returns within 45 seconds.

bash
curl -X POST "https://xdive.dev/api/orgs/$ORG_ID/map" \
  -H "X-API-Key: $XDIVE_API_KEY" -H "Content-Type: application/json" \
  -d '{"url": "https://docs.example.com", "search": "webhook", "limit": 100}'

The SDK methods return the urls array.

Parameters

FieldTypeDefaultDescription
urlstringrequiredThe page to start from. Its registrable domain is the site that is mapped.
searchstringnoneKeep only URLs that contain this text, case-insensitively. Pages that do not match are still traversed, so matches deep in the site are found.
limitinteger5000Maximum URLs to return. Values above 5000, and 0, mean 5000.
max_depthinteger2Link hops for the links-only crawl.

How URLs are found

  1. Sitemaps. The Sitemap entries in the site's robots.txt are read, or /sitemap.xml when there are none. Sitemap indexes are followed.
  2. Links. A links-only crawl starts at url and follows links up to max_depth hops, fetching at most 200 pages. Every same-site link on those pages is collected, including links to pages that were not fetched, so the result can be much larger than 200.

Only http and https URLs on the seed's registrable domain are returned (for docs.example.com, URLs on www.example.com count too). Duplicates are removed. Pages that robots.txt disallows are not fetched. Sitemap URLs come first, in sitemap order, followed by the crawl's discoveries.

Map is a discovery tool: it does not check that each URL still resolves, and it returns URLs in the form the sitemap or link used.

Response

json
{
  "count": 3,
  "urls": [
    "https://docs.example.com/guides/webhooks",
    "https://docs.example.com/reference/webhook-events",
    "https://docs.example.com/blog/signed-webhooks"
  ]
}
FieldTypeDescription
countintegerNumber of URLs returned.
urlsarray of stringsThe URLs.

Usage

Map does not count pages against your quota, but it is refused with 402 once your monthly page quota is used up. It counts against your plan's request rate limit and concurrency limit like other synchronous endpoints.

Errors

StatusCodeWhen
400url is missing or not an absolute http or https URL, or the body is not valid JSON.
402The monthly page quota is used up.
403The key lacks the crawl scope.
429Your plan's request rate limit was exceeded. Retry after Retry-After.
429CONCURRENCY_LIMITToo many concurrent requests for your plan. Retry after Retry-After.
503SERVER_BUSYThe server is at capacity. Retry after Retry-After.

See Errors and limits for authentication errors and rate limits.

  • Crawl to fetch and convert the pages.
  • Batch scrape to scrape a chosen subset.
  • llms.txt to build an index of a site for language models.