Archived pages

GET /web-archive/pages lists every page the Wayback Machine archived on a domain: when each was first and last captured, how often, and a link to its last good copy. It works for sites that are long gone, so you can map a lost site, check an expired domain’s history before buying it, or pick the pages to capture with website time-travel. It’s on every plan and costs no screenshots; requests count towards your plan’s rate limit.

Example

Request
curl "https://screenshotforweb.com/api/v1/web-archive/pages?domain=example.com&limit=2" \
  -H "X-API-Key: sk_live_your_key"
Response
{
  "success": true,
  "data": {
    "domain": "example.com",
    "subdomains": false,
    "type": "pages",
    "status": "ok",
    "from": null,
    "to": null,
    "count": 2,
    "hasMore": true,
    "nextCursor": "eyJ2IjoxLCJxIjoi...",
    "pages": [
      {
        "url": "https://example.com/",
        "firstCaptured": "2018-05-05T00:19:43.000Z",
        "lastCaptured": "2026-05-07T22:01:46.000Z",
        "captures": 103,
        "versions": 102,
        "mimeType": "text/html",
        "archivedUrl": "https://web.archive.org/web/20260507220146/https://example.com/"
      },
      {
        "url": "https://example.com/about/",
        "firstCaptured": "2019-09-18T22:21:17.000Z",
        "lastCaptured": "2023-03-26T03:17:34.000Z",
        "captures": 11,
        "versions": 10,
        "mimeType": "text/html",
        "archivedUrl": "https://web.archive.org/web/20230326031734/https://example.com/about/"
      }
    ]
  }
}

Parameters

NameDefaultWhat it does
domainrequiredThe site, such as example.com. A full URL works too: only its host is used. The bare domain and www. are always included. *.example.com adds every subdomain.
subdomainsfalsetrue also lists blog.example.com, shop.example.com and the rest.
typepagespages (HTML), documents (PDF, Word, Excel, PowerPoint, OpenDocument, EPUB) or all (every file, images and scripts included).
statusokok counts only captures that loaded normally (HTTP 200). any adds redirects and errors, which finds pages that were removed or moved.
queryStringstruefalse leaves out URLs with a query string, such as WordPress’s ?replytocom=12 copies of a post, so mostly real pages are left.
from, toall timeOnly captures in this range: a year (2019), a month (2019-06) or a day (2019-06-30). Both ends are included, so to=2019 means up to the end of 2019.
limit100Pages per response, from 1 to 1,000.
cursornoneThe nextCursor of the previous response, for the next page of results.

Unknown parameters are rejected with 400 VALIDATION_ERROR, so a typo can’t silently widen your search. IP addresses, single names such as localhost, and private names such as .local aren’t accepted.

What each page tells you

  • url: the page as the archive saved it. Variants that differ only by http/https or www. are one page.
  • firstCaptured, lastCaptured: the first and last capture matching your filters. These are when the archive visited, not when the page was published.
  • captures: how many matching captures there are. versions: how many of them differ.
  • archivedUrl: the last matching capture on the Wayback Machine. To screenshot it without the archive’s toolbar, add if_ after the timestamp: https://web.archive.org/web/20230326031734if_/https://example.com/about/.

Getting every page

While hasMore is true, pass nextCursor back as cursor, with the same other parameters. A cursor only works for the search it came from; you can change limit between pages. A response can occasionally hold fewer pages than limit, even none, while hasMore is still true: keep going until it’s false.

JavaScript
async function archivedPages(domain) {
  const pages = [];
  let cursor = null;
  for (;;) {
    const params = new URLSearchParams({ domain, limit: "1000" });
    if (cursor) params.set("cursor", cursor);
    const res = await fetch(`https://screenshotforweb.com/api/v1/web-archive/pages?${params}`, {
      headers: { "X-API-Key": process.env.SCREENSHOT_API_KEY },
    });
    if (res.status === 429 || res.status === 503) {
      // Over your rate limit, or the archive is busy: wait as long as asked, then try again.
      const seconds = Number(res.headers.get("Retry-After") ?? 30);
      await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
      continue;
    }
    const body = await res.json();
    if (!body.success) throw new Error(body.error.message);
    pages.push(...body.data.pages);
    if (!body.data.hasMore) return pages;
    cursor = body.data.nextCursor;
  }
}

Capture the pages

Send any archivedUrl to POST /screenshot to see the page as it looked, or use bulk screenshots for many at once. Archived pages load slowly, and some lost their stylesheets in the archive, so allow a longer timeout.

curl -X POST https://screenshotforweb.com/api/v1/screenshot \
  -H "X-API-Key: sk_live_your_key" -H "Content-Type: application/json" \
  -d '{"url":"https://web.archive.org/web/20230326031734if_/https://example.com/about/","fullPage":true,"timeout":60000}'

Speed, caching and limits

A first lookup asks the Internet Archive directly and can take up to 45 seconds for a large site; give your client a timeout of at least 60 seconds. Answers are then kept for up to six hours and shared, so repeating a search is quick. The X-Cache header says HIT or MISS, and responses may be reused for five minutes (Cache-Control: private, max-age=300). The archive is shared by everyone, so lookups are spaced out: when many arrive at once you may get 503 ARCHIVE_BUSY with a Retry-After header.

Errors

StatusCodeWhat to do
400VALIDATION_ERRORFix the parameter the message names. A cursor from another search is rejected the same way.
403ARCHIVE_EXCLUDEDThe Internet Archive withholds this site’s captures, usually at its owner’s request.
429RATE_LIMITEDOver your plan’s requests per minute; wait and retry.
502ARCHIVE_BAD_RESPONSE, ARCHIVE_REJECTEDThe archive gave an answer we couldn’t use. Retry later.
503ARCHIVE_UNAVAILABLE, ARCHIVE_BUSYThe archive is down or busy, or too many lookups are waiting. Retry after the Retry-After seconds.
504ARCHIVE_TIMEOUTThe archive took too long. Narrow from/to or lower limit.

What’s included

Only pages the Internet Archive crawled can be listed: a page it never visited won’t appear, however long it was online. Popular pages tend to have many captures; deep pages of small sites may have one or none. In the dashboard, the Playground’s Archived pages tab runs the same search and can send any page straight to the screenshot form.