# Screenshot all pages of a website from its sitemap

> Scan every page of a website into screenshots: read its sitemap, then send the addresses 100 at a time to the bulk API. A short script does it.

To scan all pages of a website, take the list of addresses from its sitemap.xml and send it to the CurlShot bulk endpoint, 100 pages per call. Every page is rendered in a real browser and you collect the screenshots with one status request per batch or by webhook. CurlShot does not crawl a site by following links, and it does not check links or SEO: it makes a picture of each address you give it, so the sitemap supplies the list.

Page for people: https://curlshot.com/tools/screenshot-all-pages-of-a-website

## How to screenshot every page of a website in three steps

1. Read the addresses from the sitemap.xml of the site (or from your own list).
2. Send them to the bulk endpoint in groups of up to 100.
3. Collect the screenshots with the batch status request, or receive each by webhook.

## A script that follows the sitemap

The script reads a sitemap.xml, splits the addresses into groups and sends each group as one bulk call. It stops on an API error instead of saving the error as a result. If the sitemap is an index that lists other sitemaps, run it on each of them.

- The jobs in each batch come back in the same order as the addresses you sent, so the first job belongs to the first address.
- Ask the batch_url with your access key to see how far the batch is and to get a link to every finished file. Or add webhook_url to the call and each result is sent to you as it finishes.
- Add viewport_device=iphone_15_pro to a second run to see every page in its phone layout.
- Each successful render counts as one screenshot, so a site with 400 pages in its sitemap uses 400 of your monthly allowance.

Node.js 18 or later:

```js
const sitemap = 'https://example.com/sitemap.xml'
const xml = await (await fetch(sitemap)).text()
const urls = [...xml.matchAll(/<loc>([^<]+)<\/loc>/g)].map((m) => m[1].trim())

for (let i = 0; i < urls.length; i += 100) {
  const response = await fetch('https://curlshot.com/api/v1/bulk', {
    method: 'POST',
    headers: { 'X-Access-Key': process.env.ACCESS_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({
      requests: urls.slice(i, i + 100).map((url) => ({ url, full_page: true, format: 'webp', block_cookie_banners: true })),
    }),
  })
  if (!response.ok) throw new Error('Bulk call failed: ' + response.status + ' ' + (await response.text()))
  const batch = await response.json()
  console.log(batch.batch_id, 'started:', batch.jobs.length, 'pages. Status at', batch.batch_url)
}
```

## What people use it for

- A screenshot of every page of a site before and after a redesign, to compare them
- A visual record of a client site, page by page
- Looking at every template of your own site on phone and desktop sizes
- Thumbnails for every page of a directory or a documentation site

## The same thing with the API

```bash
curl "https://curlshot.com/api/v1/screenshot?access_key=YOUR_ACCESS_KEY&url=https://example.com/about&full_page=true&format=webp&cache=true" \
  --output about.webp
```

An access key is free: https://curlshot.com/register. Read more:

- [Bulk screenshots](https://curlshot.com/docs/bulk.md)
- [Async and webhooks](https://curlshot.com/docs/async-and-webhooks.md)

## Questions

### How do I scan all the pages of a website?

Read the address list from the sitemap of the site, usually /sitemap.xml, and send it to the CurlShot bulk endpoint. Each address becomes one screenshot job. The script on this page does the reading and the sending.

### Does it crawl a website by following links?

No. CurlShot renders the addresses you send and nothing else, so a page that is not in the sitemap is not captured unless you add its address to the list.

### Does it check for broken links or SEO problems?

No. It makes a picture of each page, which is what you need to compare versions of a site or to look at every template. A link checker or an SEO crawler is a different tool.

### How many pages can I capture, and what does it cost?

One bulk call takes up to 100 pages, and you can send as many calls as your plan allows. Each successful render counts as one screenshot; failed renders are not counted. The pricing page shows the allowance of each plan and which plans include bulk.

## Related

- [Full-page screenshot](https://curlshot.com/tools/full-page-screenshot.md): Take a screenshot of a whole web page, from the top to the very bottom, as one image. Paste the address, nothing to install. Also available as an API.
- [Bulk screenshots](https://curlshot.com/tools/bulk-screenshots.md): Screenshot a whole list of web pages at once. Start up to 100 screenshots with one API call, then collect the results by webhook or one status request.
- [Save a web page online](https://curlshot.com/tools/save-web-page-online.md): Save any web page online as a PDF or an image, as it looks today. Paste the address, press the button and download the file. Free to try, also by API.

## Guides

- [How to screenshot a list of URLs in bulk](https://curlshot.com/blog/bulk-screenshots-list-of-urls.md): Screenshot hundreds or thousands of URLs: a queue simulator that says how long it takes, a short Node.js script, and what fails at scale.
