Sitemap Extractor API
Every URL a website has, from its sitemaps and pages.
The Sitemap Extractor API lists every URL a website has. It reads the site's sitemaps and robots.txt, and follows links when those are not enough. Use it to plan a crawl, check what a site publishes, or watch for new pages.
Call it
curl https://data.upscrape.com/sitemap \ -H "Authorization: Bearer $UPSCRAPE_API_KEY" \ -H "Content-Type: application/json" \ -H "Prefer: wait=30" \ -d '{"url": "https://stripe.com", "max_urls": 20}'
import osimport requestsjob = requests.post( "https://data.upscrape.com/sitemap", headers={"Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Prefer": "wait=30"}, json={"url": "https://stripe.com", "max_urls": 20},).json()for entry in job["results"][0]["data"]["urls"]: print(entry["url"])
const res = await fetch("https://data.upscrape.com/sitemap", { method: "POST", headers: { Authorization: `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", Prefer: "wait=30", }, body: JSON.stringify({ url: "https://stripe.com", max_urls: 20 }),});const job = await res.json();for (const entry of job.results[0].data.urls) console.log(entry.url);
The list is in results[0].data.urls, each with its url, and its title and description where the site gives them. From a run on 16 October 2026:
https://stripe.com/https://stripe.com/abouthttps://stripe.com/aehttps://stripe.com/ae/atlas/legalhttps://stripe.com/ae/climate/legal…
Narrow the list
| Input | What it does |
|---|---|
max_urls | URLs in this response, up to 5,000. 1,000 by default. |
include_patterns, exclude_patterns | Only URLs that match, or none that do, such as "path:/blog/*" or "contains:pricing". |
include_assets | Also list scripts, styles, images and files. Off by default: pages only. |
include_subdomains | Also list other subdomains of the same site. |
fetch_titles | Open each page to fill in its title and description. Slower; off by default. |
The next batch
A site with more URLs than max_urls returns continuation.token. Send it back as cursor, with the same other input, for the next batch: Paging through results shows the loop.
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
url |
string | yes | The site to list, such as https://react.dev/. | https://stripe.com |
cursor |
string | no | Pass the cursor from the last response, with the same options, to get the next URLs. | |
discover_sitemaps |
boolean | no | Look for sitemaps beyond the ones robots.txt names. | |
exclude_patterns |
array<string> | no | Leave out URLs matching these patterns. | |
fetch_titles |
boolean | no | Open each listed page to fill in its title and description. Slower; off by default. | |
include_assets |
boolean | no | Also list scripts, styles, fonts, images and files. Off by default: pages only. | |
include_patterns |
array<string> | no | Only URLs matching these patterns, such as path:/blog/* or contains:pricing. | |
include_subdomains |
boolean | no | Also follow other subdomains of the same site, such as docs. and blog. | |
max_sitemaps |
integer | no | The most sitemap files to read. | |
max_urls |
integer | no | The most URLs to return in this response. | 20 |
respect_robots |
boolean | no | Follow the site's robots.txt rules. On by default. |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "final_url": "https://stripe.com", "origin": "https://stripe.com", "robots": { "applied": true, "status": "applied", "status_code": 200, "url": "https://stripe.com/robots.txt", "sitemaps": [ "https://stripe.com/sitemap/sitemap.xml" ] }, "sitemaps": [ { "note": "no sitemap at this URL (HTTP 404)", "status": "missing", "status_code": 404, "url": "https://stripe.com/sitemap.xml" }, { "status": "ok", "status_code": 200, "url": "https://stripe.com/sitemap/partition-0.xml", "url_count": 1986 } ], "urls": [ { "title": "Stripe | Financial Infrastructure to Grow Your Revenue", "allowed": true, "description": "Stripe is a financial services platform that helps all types of businesses accept payments, build flexible billing models, and manage money…", "kind": "page", "source": "seed", "url": "https://stripe.com/" }, { "allowed": true, "depth": 1, "kind": "page", "source": "page", "url": "https://stripe.com/about" } ], "warnings": [ "mapped_inventory_limit_reached" ]}
Fields
| Field | Type | What it is | Example |
|---|---|---|---|
urls[].url |
string | The page's address. | https://stripe.com/ |
urls[].title |
string | The page's title, when the site's sitemap or the page gives one. | Stripe | Financial Infrastructure to Grow Your Revenue |
urls[].kind |
string | What the URL is: a page, or an asset when you ask for assets. | page |
urls[].source |
string | Where it was found: the start page, a link on a page, or a sitemap. | seed |
urls[].allowed |
boolean | Whether the site's robots.txt allows reading it. | true |
urls[].description |
string | The page's description, when the site gives one. | Stripe is a financial services platform that helps all types of… |
final_url |
string | The address the page ended at, after any redirects. | https://stripe.com |
origin |
string | The site the map covers. | https://stripe.com |
robots |
object | The page's instructions for search engines. | 5 fields |
robots.applied |
boolean | Whether the site's robots.txt rules were followed. | true |
robots.sitemaps |
array | Sitemaps found for the site. | https://stripe.com/sitemap/sitemap.xml |
robots.status |
string | Whether the page was read. | applied |
robots.status_code |
integer | The site's HTTP status for the page, such as 200. | 200 |
robots.url |
string | The page's address. | https://stripe.com/robots.txt |
sitemaps |
array | Sitemaps found for the site. | 3 records |
sitemaps[].note |
string | Why a sitemap could not be read, such as a missing file. | no sitemap at this URL (HTTP 404) |
sitemaps[].status |
string | Whether the page was read. | missing |
sitemaps[].status_code |
integer | The site's HTTP status for the page, such as 200. | 404 |
sitemaps[].url |
string | The page's address. | https://stripe.com/sitemap.xml |
urls |
array | Every URL found, with its title and description when the site gives them. | 6 records |
warnings |
array | Anything that limited the list, such as the URL limit you set being reached. | mapped_inventory_limit_reached |
What to know
- It reads the site's sitemaps and robots.txt, and follows links when they are not enough.
- Titles and descriptions come from the sitemap; set fetch_titles to open each page for them, which is slower.
- A site with more URLs than max_urls returns a continuation token: send it back as cursor for the next batch.
- Pages only by default; set include_assets for scripts, styles, images and files.
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Something missing or unclear? Ask the team that builds the endpoints.