POST /v1/map
Return all URLs found on a website, synchronously, in a single request. Useful for discovering pages before a targeted crawl or scrape.
The engine reads the sitemaps listed in the site's robots.txt (Sitemap: lines) first, then sitemap.xml and sitemap_index.xml. If no sitemap has a URL, it falls back to parsing internal href links on the homepage. The response says how many URLs the site has (total_discovered) and, when the list is shorter than that, why (truncated_reason).
Request
POST /v1/map
Content-Type: application/json
x-api-key: YOUR_KEYBody
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | The website to map. Can be the homepage or any page on the domain. | |
limit | number | No | 100 | Maximum URLs. Clamped to your plan's map_links cap: Free 100, Hobby 1,000, Pro 5,000, Scale 10,000. |
search | string | No | Keep only URLs relevant to this text and return them best match first. Scored on the words in the URL path (exact word, word prefix, substring); ties go to the shallower URL, then discovery order. No model call. Max 200 characters. | |
includePaths | string[] | No | Keep only URLs whose path matches one of these patterns. Up to 50 patterns, 200 characters each. | |
excludePaths | string[] | No | Drop URLs whose path matches one of these patterns. Wins over includePaths. Same limits. | |
includeAssets | boolean | No | false | Keep stylesheet, script, image, font, media and archive URLs. By default a path ending in .css, .js, .mjs, .json, .webmanifest, .xml, .ico, .png, .jpg, .jpeg, .gif, .webp, .svg, .avif, .woff, .woff2, .ttf, .otf, .mp4, .mp3 or .zip is dropped. |
maxAge | number | No | 0 | Reuse a map of this site discovered within this many milliseconds instead of fetching again. 0 always discovers fresh. Max 2,592,000,000 (30 days). Filters, includeAssets and limit are applied to the reused discovery. A reused map costs 0 credits. |
ignoreRobotsTxt | boolean | No | false | robots.txt is respected by default; set true to opt out. |
Path patterns
Patterns are matched against the URL path (not the host or query) and are globs, not regular expressions.
| Pattern | Matches |
|---|---|
/blog | /blog and everything under it, but not /blogger |
/blog/* | one segment below /blog, such as /blog/post-1 |
/blog/** | anything below /blog, at any depth |
/**/*.pdf | any path ending in .pdf, including /file.pdf (**/ matches zero or more segments) |
A pattern without a leading / gets one. A pattern may contain at most 8 wildcards. If the patterns are too expensive to evaluate against the site, the request returns HTTP 400 filter_too_complex and nothing is charged; it never returns unfiltered results.
When search contains a / it is a literal path fragment: URLs containing it are kept in discovery order, without re-ranking. Invalid input returns HTTP 400 with invalid_include_paths, invalid_exclude_paths, invalid_search or invalid_max_age.
Example: map a full site
curl -X POST https://api.superscraper.dev/v1/map \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.northside-roasters.example",
"limit": 200
}'Example: find every page in one section
curl -X POST https://api.superscraper.dev/v1/map \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.superscraper.dev",
"search": "/core/"
}'Because search contains a /, this keeps only the URLs under /core/, such as
https://docs.superscraper.dev/core/scrape and https://docs.superscraper.dev/core/map.
Response
HTTP 200 when the site was reachable (including zero links).
HTTP 422 blocked_by_site when the site refused the request (HTTP 401/403) and no links were found.
HTTP 422 robots_disallowed when the site's robots.txt does not allow the homepage and no links were found (send ignoreRobotsTxt: true to opt out).
HTTP 422 no_address when neither the host nor its www. form resolves.
HTTP 429 site_rate_limited when the site answered HTTP 429 and no links were found (retry_after seconds).
HTTP 502 map_fetch_failed when fetch failed for another reason and no links were found.
None of these errors is charged.
Only URLs on the requested site are returned: its host with or without www., and its subdomains. Sitemap entries
for other sites are skipped and not counted in total_discovered. Pages are ordered by the sitemap's <lastmod>:
changed in the last 30 days, then in the last year, then undated, then older.
HTTP 504 map_timeout when the time budget expired with no links.
| Field | Type | Description |
|---|---|---|
url | string | Normalized base URL |
links | string[] | Deduplicated list of discovered URLs |
total | number | Number of URLs in links |
total_discovered | number | Distinct URLs found during discovery (de-duplicated across every sitemap read), before filters and limit |
truncated | boolean | true when links is not every URL that was, or could have been, discovered |
truncated_reason | string | null | Why: "limit", "plan_limit", "time_budget" or "byte_cap"; null when not truncated. See below |
total_is_lower_bound | boolean | undefined | true when discovery did not read every sitemap, so the site has at least total_discovered URLs |
source | string | Where links came from: "sitemap", "crawl", or "none" |
cached | boolean | undefined | true when the links came from a maxAge reuse |
cacheAgeMs | number | undefined | Age of the reused discovery in milliseconds, present with cached |
timedOut | boolean | undefined | Present when the 25s budget was hit but some links may still be returned |
Example: exclude noise, rank by relevance
curl -X POST https://api.superscraper.dev/v1/map \
-H "x-api-key: ss_live_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.superscraper.dev",
"search": "scrape",
"excludePaths": ["/agents/**"],
"maxAge": 3600000
}'Example response
{
"url": "https://www.northside-roasters.example",
"links": [
"https://www.northside-roasters.example/",
"https://www.northside-roasters.example/shop",
"https://www.northside-roasters.example/shop/espresso-blend",
"https://www.northside-roasters.example/shop/single-origin",
"https://www.northside-roasters.example/shop/decaf",
"https://www.northside-roasters.example/about",
"https://www.northside-roasters.example/contact",
"https://www.northside-roasters.example/wholesale",
"https://www.northside-roasters.example/cafes/downtown",
"https://www.northside-roasters.example/cafes/alberta",
"https://www.northside-roasters.example/cafes/sellwood",
"https://www.northside-roasters.example/blog",
"https://www.northside-roasters.example/blog/how-to-brew-pour-over"
],
"total": 13,
"total_discovered": 13,
"truncated": false,
"truncated_reason": null,
"source": "sitemap"
}Truncation
truncated_reason gives the most serious cause that applies.
| Value | Meaning |
|---|---|
"time_budget" | The 25-second budget ended discovery. total_discovered is a lower bound. timedOut is also true |
"byte_cap" | A read ceiling ended discovery: one sitemap over 52 MB, more than 160 MB of sitemaps, more than 50 sitemap files, more than 1,000 children in one index, or more than 50,000 URLs held while search, includePaths or excludePaths is in use (10,000 when the discovery is reused through maxAge), or sitemap indexes nested more than two levels. total_discovered is a lower bound |
"limit" | The list was cut at the limit you sent (or the default of 100 when your plan allows more). total_discovered is the full count, unless total_is_lower_bound is true |
"plan_limit" | The list was cut at your plan's map_links cap (you asked for more, or sent no limit and the cap is the default). total_discovered is the full count, unless total_is_lower_bound is true |
null | links holds every URL discovered that matched your filters |
URLs are de-duplicated before they are counted or kept, in sitemap order (children in the order the index lists them). Without filters the first 10,000 distinct URLs are kept and discovery goes on counting for up to 4 seconds, or until 200,000 distinct URLs are tracked. If that allowance runs out the response carries truncated_reason: "plan_limit" with total_is_lower_bound: true. A filter that matches fewer URLs than limit is not a truncation: total is the number of matches and total_discovered is the size of the site.
total_is_lower_bound is also true when a child sitemap could not be fetched.
Source values
| Value | Meaning |
|---|---|
"sitemap" | Links were read from the sitemaps in robots.txt, sitemap.xml or sitemap_index.xml |
"crawl" | No sitemap had a URL; links extracted from href attributes on the homepage. example.com and www.example.com count as the same site |
"none" | No links could be discovered |
Sitemap index support
Every <loc> in a sitemap index is read as a child sitemap, including children whose URL has a query string (sitemap_products_1.xml?from=1&to=99) and gzip files (.xml.gz). Nested indexes are followed two levels down, four files at a time, up to 50 files. Sitemaps are read as a stream, so a multi-megabyte sitemap does not slow other requests. Discovery runs under a 25-second budget; if it is exceeded the response returns the links found so far with truncated_reason: "time_budget" and timedOut: true.