Sitemap URLs of a website

GET https://api.api.sh/web/v1/sitemap
1 credit / call web data try it in the playground →

Every URL a site lists in its XML sitemaps: the sitemaps are found from robots.txt (or /sitemap.xml and /sitemap_index.xml), sitemap indexes are followed, gzip sitemaps and plain-text sitemaps are read. The first page also lists sitemaps (with lastmod for sitemaps named in an index). Each URL has lastmod, changefreq, priority, image and video counts, hreflang alternates (alternates=true; their count otherwise), the news title for news sitemaps and the sitemap it came from. Pass sitemap to read one sitemap only. Pass next_cursor back as cursor; null on the last page.

Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
urlrequired string Site (home page or domain), or a sitemap URL. Example: https://www.bbc.com
sitemap string Read only this sitemap (or sitemap index).
alternates boolean List each URL's hreflang alternates (language, URL); without it alternates is their count. Default: false
limit integer URLs per page (default 1000, max 10000). Default: 1000
cursor string Pass next_cursor from the previous response; null on the last page.

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/web/v1/sitemap?url=https%3A%2F%2Fwww.bbc.com" \
  -H "x-api-key: $APISH_KEY"

Response

A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.