How Wayback Machine restoration works: a technical guide
For developers and technical SEOs: how captures are made, how to query the Wayback CDX API, why an empty Availability API answer proves nothing, and a restoration pipeline from discovery to validation.
Data through

Restoring a website from the Wayback Machine is a data problem before it is a design problem. You are reconstructing a site from an index of individual captures, each one a response recorded for one URL at one moment, and the quality of the rebuild depends on choosing the right ones. This guide is for whoever will do that work: a developer or technical SEO who is comfortable with HTTP and some scripting.
It covers what a capture is, where captures come from, how to query the Internet Archive's CDX index, the traps in the data, and a pipeline that turns it into a clean site. One rule sits above all of it: archive presence is not permission. The Internet Archive says it "does not make guarantees as to the copyright status of items", and who may reuse recovered content is covered, with the non-technical steps, in how to restore a website from the Wayback Machine.
What a capture is
A capture is a stored copy of the response a crawler received for one URL at one time. It is identified by the URL and a timestamp: the number in the middle of an archive address, which the Internet Archive's help pages say "translates as yyyymmddhhmmss". Fourteen digits, to the second.
Three properties matter for restoration:
- Each capture keeps its status. The calendar colours a dot blue for a 2xx response, green for 3xx, orange for 4xx and red for 5xx. A redirect or an error is recorded as faithfully as a working page.
- Every file is captured on its own. A page, each of its images and each stylesheet have separate captures with separate timestamps, which is why one archived page can be assembled from several dates.
- Captures are not immediate. The help pages describe "a 3-10 hour lag time between the time a site is crawled and when it appears in the Wayback Machine."
Where captures come from
Capture density varies enormously between sites, and between pages on the same site, because captures arrive by several routes. The Internet Archive says "hundreds of web crawls" contribute every day. Individuals add pages with Save Page Now, which saves "the page you enter including the images and CSS" but "does not save any of the outlinks"; it saves one page, not a site, and does not add the URL to future crawls. Archive Team, a volunteer group, saves sites that often end up in the Wayback Machine, and Archive-It is a subscription service through which organisations run their own crawls.
The upshot: a homepage that people kept saving by hand can have hundreds of versions while the inner pages of the same site have one or none. Plan a restore around what is actually there, which means building an inventory before anything else.
The CDX Server API
The CDX server is the index the Wayback Machine itself uses. Its README describes "a standalone HTTP servlet that serves the index that the wayback machine uses to lookup captures". It answers GET requests at web.archive.org/cdx/search/cdx and returns plain text or, optionally, a JSON array.
Two caveats before you build on it. The README is titled "Wayback CDX Server API - BETA", and its last change in the GitHub repository was in October 2018, so treat the parameter descriptions as indicative and test behaviour against the live service. When we checked on 7 October 2026 it answered in the documented format. A query for the latest capture of example.com returned this single line, with the seven public fields in order:
com,example)/ 20261007031409 https://example.com/ text/html 200 U2352G3H6BFNEDPBNQI5XGOBSQAN4W4J 1093
The seven public CDX fields, and what each means for a restore
| Field | What it holds | How you use it when restoring |
|---|---|---|
| urlkey | A normalised form of the URL. The index is usually sorted by it and then by date. In the line above, example.com's homepage appears as com,example)/ with the host reversed. | Group variants of the same address. Collapse on it to get one row per URL. |
| timestamp | The capture time as 14 digits, yyyymmddhhmmss. | Choose a capture for each page, and keep each page's assets close to its date. |
| original | The URL as captured, for example https://example.com/. | Your source list of old addresses. Normalise scheme and www variants before mapping them. |
| mimetype | The content type recorded for the response, such as text/html. | Separate pages from images, stylesheets, scripts and PDFs. |
| statuscode | The HTTP status the crawler received. | Treat 200s as content candidates, 3xx rows as evidence of the old site's own redirects, and note 4xx and 5xx. |
| digest | A hash of the captured content. The README identifies duplicates by rows sharing a digest. | Spot unchanged versions, and see when content changed: a redesign, or a parking page. |
| length | A size value for the stored record. The README lists the field without defining it. | A rough signal only. A sudden, tiny homepage can hint at a parking page; confirm by looking. |
Source: Field list from the Wayback CDX Server API README (Internet Archive, GitHub, last changed October 2018); example line observed by DropOps on 7 October 2026.
The parameters that matter
- matchType widens a query beyond the single URL you give. matchType=prefix returns "all results under the path", and matchType=domain returns the host "and all subhosts". A prefix query on the host covers the whole site; domain adds subdomains.
- from and to restrict results to a timestamp range.
- filter takes the form filter=field:regex, keeps matching rows, and can be repeated; an exclamation mark before the field name inverts it. filter=statuscode:200 together with filter=mimetype:text/html leaves working HTML pages only.
- collapse takes collapse=field, or collapse=field:N to compare only the first N characters, and drops rows that duplicate the row before them. collapse=digest removes consecutive identical versions. Because the index is usually sorted by URL and then date, collapse=urlkey normally leaves one row per URL. The README is explicit that "only adjacent digest are collapsed, duplicates elsewhere in the cdx are not affected": a page that changes and later changes back is counted again.
- limit matters because, in the README's words, the server "may return millions or billions of record", and its configuration caps a single query (150,000 rows by default, per the README). Split large sites by path or date range, and write code that expects a truncated answer.
A worked example (illustrative)
Everything in this section is illustrative. example-domain.test is a reserved test name, the rows below were invented to show common patterns, and none of it is real archive output.
Suppose you are restoring example-domain.test, a small business site that ran from about 2013 until its domain lapsed. A first query lists every working HTML page once:
https://web.archive.org/cdx/search/cdx?url=example-domain.test/&matchType=prefix&filter=statuscode:200&filter=mimetype:text/html&collapse=urlkey
A second asks for the full history of the site at every status, with consecutive identical captures folded together:
https://web.archive.org/cdx/search/cdx?url=example-domain.test/&matchType=prefix&collapse=digest
Merged and trimmed to the interesting rows, an illustrative answer might look like this:
Illustrative CDX rows for example-domain.test (invented for this example, not real output)
Digests and lengths are made up for illustration.
| urlkey | timestamp | original | mimetype | statuscode | digest | length |
|---|---|---|---|---|---|---|
| test,example-domain)/ | 20130412093011 | http://example-domain.test/ | text/html | 200 | DIGESTA1 | 4120 |
| test,example-domain)/ | 20170918141502 | http://example-domain.test/ | text/html | 200 | DIGESTB2 | 5388 |
| test,example-domain)/ | 20190603080244 | https://example-domain.test/ | text/html | 200 | DIGESTC3 | 6015 |
| test,example-domain)/ | 20240211170931 | https://example-domain.test/ | text/html | 200 | DIGESTD4 | 612 |
| test,example-domain)/contact.php | 20190603080301 | https://example-domain.test/contact.php | text/html | 200 | DIGESTE5 | 3290 |
| test,example-domain)/index.php?page=services | 20160122110455 | http://example-domain.test/index.php?page=services | text/html | 200 | DIGESTF6 | 4877 |
| test,example-domain)/offers | 20200115120000 | https://example-domain.test/offers/ | text/html | 301 | DIGESTH8 | 389 |
| test,example-domain)/services | 20190603080412 | https://example-domain.test/services/ | text/html | 200 | DIGESTG7 | 5102 |
Reading it as a restorer would:
- Three designs, then something else. The homepage has distinct digests in 2013, 2017 and 2019, which look like real versions of the site. The 2024 row has a new digest and a fraction of the length. On a lapsed domain that pattern is worth opening, because a holding or parking page recorded after the business stopped would look exactly like this. Confirm by looking at the capture, not by the number.
- A URL change the old site made itself. /index.php?page=services in 2016 and /services/ in 2019 are the same page under two URL schemes. Other sites may link to either, so both belong in the redirect map.
- A redirect kept as evidence. The 301 on /offers/ tells you the old site redirected that address in 2020. The seven public fields do not include the redirect's target, so to learn where it pointed you have to open the capture.
- Protocol drift. The move from http to https in 2019 means the same homepage appears under two original URLs. Normalise scheme (and www, where the site used it) before counting pages, or you will count the site twice.
The Availability API, and why an empty answer proves nothing
The simpler Wayback Availability API (archive.org/wayback/available?url= followed by the address) answers one question: is there a capture near a given time? It returns "a single closest snapshot", takes an optional timestamp of "1-14 digits (YYYYMMDDhhmmss)", and returns the most recent capture if you give none. Its documentation, last updated in 2013, suggests it for 404 handlers that look for an archived copy to display.
When nothing is available the response is {"archived_snapshots":{}}, which the documentation defines as "not archived or currently not accessible". Those are two different situations, and the response does not say which applies. In our own test on 7 October 2026, the Availability API gave that empty answer for example.com and for archive.org/about/terms.php, while the CDX API listed captures of both; a request for bbc.co.uk returned a snapshot normally. That is one day's observation by DropOps, not a statement by the Internet Archive, but it is enough to set a rule: never conclude that a site was not archived from an empty Availability response. Ask the CDX index.
Timestamps, nearest captures and mixed dates
When you browse an archived page you are not looking at a single moment. For links missing at the date you are viewing, the help pages say the Wayback Machine "will grab the closest available date", and where it has no copy at all it "will look for the link on the live web and grab it if available". The rendered page can therefore combine a 2015 HTML capture, a 2017 stylesheet, a 2012 logo and an image served today by whoever now controls that address.
That is helpful for browsing and hazardous for restoration. A rebuild made by saving what the browser shows inherits the blend without recording it. Work from the index instead: for each page you keep, record its timestamp and the timestamp of every asset taken with it, and set a tolerance (a few months either side, say) beyond which an asset gets a second look. A stylesheet captured three years after the HTML may belong to a redesign that page never had.
Links, rewriting and redirects
Recovered HTML carries the old site's links in several forms, and each needs a decision during the rebuild:
- Relative links such as ../services/ or contact.php resolve against the page's original URL. Resolve them against the original field from CDX, not the archive address you fetched from, then map the result to the new site.
- Absolute links to the old site appear in every variant the site ever used: http and https, with and without www, with and without index.php. Normalise them to one form, then map.
- Links to other sites need checking individually. Pew Research Center found in 2024 that 38% of web pages that existed in 2013 were no longer accessible a decade later.
- Links into the archive. Anything saved from the playback view, rather than taken as content, may contain archive addresses: web.archive.org/web/ followed by a timestamp and the original URL. Rewrite every one. A restored site must not depend on the archive at run time.
Status codes need the same care. A 3xx capture is evidence that the old site had moved an address itself, and it belongs in your redirect map. A 4xx or 5xx capture records a page that was failing at that moment, not necessarily for good. And a 200 is not proof of content: a parked domain, a "for sale" notice and a hacked page full of spam links can all return 200. Read the status code as what the server said, then look at what it served.
Crawl gaps and exclusions
Some gaps are structural. The archive collects "web pages that are publicly available"; it does not archive pages that need a password, or pages "only accessible when a person types into and sends a form". Orphan pages are missed ("If there are no links to your pages, the robot won't find it"), crawlers "don't enter queries in search boxes", and JavaScript that generates links "without having the full name in the page" hides those links from the crawler. Site search results, filtered product lists and member areas are the usual casualties.
Other gaps come from exclusion. Sites "may have been excluded from the Wayback Machine due to a robots.txt file on the site or at a site owner's direct request", and the Internet Archive reviews removal requests without making "any guarantees beforehand about the outcome". Robots.txt has a history worth knowing for dropped domains. In 2017 the Internet Archive wrote that parked domains blocking search engines through robots.txt had "historically also removed the entire domain from view in the Wayback Machine". Having stopped referring to robots.txt files on US government and military sites, it said it was "looking to do this more broadly". That was a stated intention, not a published final policy, and current help pages still say robots.txt "may have prevented the crawling of a site". The practical consequence: what is visible for a domain can change, so record what you found and when.
What the archive holds for dropped .uk domains
For a sense of scale, DropOps measured the homepage capture history of a sample of dropped .uk domains. For each domain we made one CDX request for the bare domain with collapse=digest and counted HTTP 200 captures, so the figure is distinct homepage versions, not visits; and because collapsing only folds adjacent duplicates, a homepage that changes and changes back counts again. Across 7,310 domains with homepage history, dropped between 16 August and 30 September 2026, the median was 33 versions, with an interquartile range of 14 to 62. The sample was weighted towards domains with strong link evidence, so it describes that sample, not every dropped name, and it says nothing about inner pages, images or files. The full study, with its method and limits, is in what can actually be recovered from an archived website.
Being a polite client
The CDX README gives no rate-limit figures, so this guide does not offer any. The Internet Archive's terms describe access to its collections as provided "at no cost to you", which is reason enough to behave like a considerate guest:
- Cache every response locally, keyed by URL and timestamp, and never fetch the same capture twice. A digest you already hold is content you already have.
- Ask the index for a whole prefix in one query rather than making one query per URL.
- Fetch sequentially with a pause between requests, not in bursts of parallel connections.
- Back off when responses slow down or errors appear, and stop rather than retry in a tight loop.
- Identify your tool with a descriptive user agent and a contact address.
A restoration pipeline
- DiscoverQuery CDX for the host with matchType=prefix, and matchType=domain if subdomains mattered. Record each query and the date you ran it, because the index changes.
- InventoryNormalise scheme, www and trailing slashes, then group by urlkey. For each URL record the first and last capture, the status codes seen, the content type and the distinct digests.
- Choose capturesFor each page, pick the latest 200 that shows the real site, before any parking page, 'for sale' notice or hacked period. Take assets within a set tolerance of the page's timestamp and flag the rest.
- FetchDownload the chosen captures slowly and through a cache. Store the timestamp and digest beside every file so each recovered asset can be traced to its capture.
- SanitiseStrip scripts, trackers, analytics tags and third-party embeds, and remove every archive address. Hold back dated facts such as phone numbers, prices, opening hours, staff names and testimonials until someone confirms them.
- RebuildMove the content and structure into a current CMS or static build. Rebuild forms, search and anything interactive from scratch: the archive never held them.
- Map URLsGive every old address a decision: keep it, redirect it once to its closest equivalent, or let it return 404 or 410. Include the old site's own 3xx captures. No chains, no loops, no mass redirects to the homepage.
- ValidateRequest every old URL and check its status and target against the map. Check internal links, titles and canonical tags, and confirm nothing on the new site loads from the archive.
Step seven is where the archive's evidence turns into lasting value, and it is a job of its own. How to recover old URLs and build a redirect map turns the inventory from step two into a prioritised, one-hop map, and how to rebuild an old website without losing its SEO covers the launch and the checks afterwards.
DropOps Sites, our website builder for domains you own, follows the same pipeline in outline. It reads a domain's old addresses and a sample of old pages from public web archives, strips scripts, trackers and embeds from anything it recovers, hotlinks nothing from the archive, and holds old details such as phone numbers and prices until the owner confirms them. Nothing goes live until the owner publishes. What an archive holds for any given domain varies, and none of it is guaranteed.
Sources
- Wayback CDX Server API - BETA (README) — Internet Archive (GitHub), 2018-10-01
- Wayback Machine APIs — Internet Archive, 2013-09-24
- Using The Wayback Machine — Internet Archive Help Center
- Wayback Machine General Information — Internet Archive Help Center
- Save Pages in the Wayback Machine — Internet Archive Help Center
- How do I request to remove something from archive.org? — Internet Archive Help Center
- Robots.txt meant for search engines don't work well for web archives — Internet Archive Blogs, 2017-04-17
- Internet Archive's Terms of Use (dated 31 Dec 2014), read from the Wayback capture of 30 Nov 2024 — Internet Archive, 2014-12-31
- When Online Content Disappears — Pew Research Center, 2024-05-17
- Rights — Internet Archive Help Center
Related reading
How to restore a website from the Wayback Machine
A practical UK guide to rebuilding a lost website from public web archives: finding and choosing captures, what will be missing and why, who owns the words and pictures, and how to keep the old addresses working.
What can actually be recovered from an archived website?
Public web archives keep the words and look of many old websites and almost none of the machinery behind them. An asset-by-asset guide, with original DropOps data on the archived homepages of 7,613 recently dropped, mostly well-linked .uk domains.
How to recover old URLs and build a redirect map
Where a site's old addresses can be found once the site has gone, how messy those lists are, and how to turn them into a one-hop redirect map ranked by evidence, with a worked example and rules for Apache, nginx and _redirects.


