Skip to main content
GET
Map a site's URLs

Overview

/map answers “what pages does this site have?” without downloading any of them. It merges two sources:
  • Sitemaps — found through robots.txt first, then the conventional locations (/sitemap.xml, /sitemap_index.xml). Sitemap indexes are followed one level deep. Authoritative and cheap: one request can describe a whole site.
  • On-page links — every link on the URL you pass. The fallback for sites that publish no sitemap, and the only source that reflects what is actually linked.
A URL found in both appears once. Sitemap provenance wins, because it carries lastmod and is the site’s own statement about its content, but the anchor text from the page is kept as a title. Use it to plan a crawl, to find one page without guessing its path, or to check what a site has published recently.

Example requests

Example response

Reading the response

Without search, links come back shortest path first — so the homepage and top-level sections lead, and the deep long tail follows. With search, results are filtered as well as ranked: links matching nothing are dropped, not just pushed down. A match in the URL path outranks one in the link text.

Choosing sources

robots.txt is read for its Sitemap: entries regardless. /map fetches at most one page of the site, so nothing here is affected by Disallow rules.

Scope

By default the result stays on the site you asked about, subdomains included, and URLs that differ only by query string collapse into one.
  • include_subdomains=false — restrict to the exact host. blog.stripe.com is excluded when you map stripe.com.
  • ignore_query_params=false — keep ?page=2 and ?page=3 as separate entries.
Links to other sites are never returned.

GET /scrape

Fetch the content of any URL you found. 3 credits.

POST /crawl

Fetch all of them in one job. 3 credits + 3 per page.

Authorizations

X-API-Key
string
header
required

Your Prefetch API key. Obtain one from the dashboard.

Query Parameters

url
string
required

The website URL to process. https:// is prepended automatically if no protocol is provided.

Example:

"https://stripe.com"

limit
integer
default:1000

Maximum number of links to return.

Required range: 1 <= x <= 5000

Rank and filter results by relevance to this query. Links that match nothing are dropped.

Example:

"pricing"

sitemap
enum<string>
default:include

Which sources to use. include merges sitemap entries with on-page links, skip uses on-page links only, only uses sitemaps only.

Available options:
include,
skip,
only
include_subdomains
boolean
default:true

Include links on subdomains of the target.

ignore_query_params
boolean
default:true

Treat URLs that differ only by query string as one page.

Response

Links discovered.

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required