Web archives provide an invaluable historical record for technical SEO audits, site migrations, and content gap discovery. When auditing an acquired domain or evaluating a website recovery, knowing which URLs historically existed helps identify lost organic landing pages, unhandled 301 redirects, and orphaned content clusters.
However, it is critical to understand the technical boundaries of web archives. The Internet Archive's Wayback Machine does not maintain an exhaustive index of the web. Captures represent an incomplete historical sample governed by crawler link discovery, crawl frequency, and site exclusion policies. Furthermore, while historical robots.txt directives historically prevented public display, current Internet Archive policy allows domain owners to request exclusions or removals directly. This guide explains how to extract available historical URL records accurately using the official CDX API, filter out parameter noise, and use the inventory for technical SEO audits.
Understanding the Internet Archive CDX API
The Internet Archive provides a public endpoint known as the CDX (Capture Index) Server API. According to the official Internet Archive CDX Server documentation, the CDX API allows developers and webmasters to query indexed capture metadata programmatically without downloading rendered web snapshots.
| CDX Parameter | Syntax Example | Function & Practical Application |
|---|---|---|
url & wildcard |
url=example.com/* |
Defines the target domain or directory. Adding /* retrieves captured sub-paths across the specified host. |
matchType |
matchType=prefix |
Controls URL matching. Options include exact, prefix (entire path hierarchy), host, or domain (including all subdomains). |
fl (field list) |
fl=original,timestamp,statuscode,mimetype |
Restricts output columns. When auditing URL inventory, requesting only original minimizes payload. When selecting snapshots for recovery, including timestamp is necessary to select specific capture dates. |
collapse |
collapse=urlkey |
Deduplicates captures. By collapsing on urlkey, the API returns only unique URL paths rather than hundreds of recurring crawl timestamps. |
filter |
filter=statuscode:200 |
Filters captures by HTTP response. Limits results to successfully crawled 200 OK pages or specific MIME types (e.g. filter=mimetype:text/html). |
Direct CDX API Query Construction & Pagination
You can execute queries directly in your browser, terminal, or via automated scripts. A standard query to extract unique HTML pages recorded with HTTP status 200 looks like this:
https://web.archive.org/cdx/search/cdx?url=example.com/*&output=json&fl=original,statuscode,mimetype&collapse=urlkey&filter=statuscode:200&filter=mimetype:text/html
Understanding deduplication versus timestamp selection is vital: querying with collapse=urlkey and fl=original produces a clean, unique URL inventory. However, if your goal is content recovery, omit collapse=urlkey and request timestamp so you can evaluate the progression of snapshots over time.
Pagination & Request Boundaries: For large websites with tens of thousands of recorded captures, single unpaged requests may encounter gateway timeouts. As outlined in the official CDX documentation, queries can be paginated using page (0-indexed) with a defined pageSize, or sequenced by setting showResumeKey=true. When showResumeKey=true is enabled, the API outputs a continuation token (resume key) at the end of each result block, allowing your script to resume the stream seamlessly.
Using the SEOLinkScan Wayback URL Extractor
For audits where command-line scripting is inconvenient, our free Wayback URL Extractor handles CDX API queries through a clean web interface. You enter the domain, specify filtering preferences, and export the deduplicated historical URL list directly to CSV without writing custom API scripts.
Worked Hypothetical Scenario: Pre-Migration URL Reconciliation
The following worked example illustrates how an SEO team reconciles available historical archive records against a live sitemap to recover lost redirect equity. All URL counts and spreadsheet figures are hypothetical illustrative inputs.
Hypothetical Scenario: E-Commerce Store Re-platforming
An e-commerce business migrated from Magento to Shopify six months ago. Organic search impressions dropped by 35% post-migration. The SEO consultant suspects legacy high-authority category and tutorial URLs were dropped without proper 301 redirection.
Step 1: Extract Available Historical URL Inventory
The consultant extracts unique historical HTML URLs from web.archive.org using the CDX API, yielding a working list of 1,420 unique URLs captured over the prior three years.
Step 2: Compare Against Current XML Sitemap
Using a spreadsheet formula (such as XLOOKUP), the historical list is matched against the live XML sitemap containing 850 active URLs. The comparison highlights 570 URLs present in the historical archive that do not appear in the active sitemap.
Important Nuance: Absence from an XML sitemap does not automatically prove a page is missing or 404; URLs may be active orphan pages, intentionally non-indexed utilities, or unlisted campaign pages. Status validation requires live HTTP crawling.
Step 3: Live HTTP Status Validation
The consultant audits the 570 legacy URLs in batches using automated HTTP header checks:
- 310 URLs: Return HTTP 301 (properly redirected to new Shopify product paths).
- 215 URLs: Return HTTP 404 (legacy blog tutorials and discontinued category pages).
- 45 URLs: Return HTTP 302 (temporary redirects). Because the re-platforming is permanent, these should be updated to permanent 301 redirects to ensure canonical equity transfer.
Step 4: Prioritize and Map 301 Redirects
Rather than redirecting all 215 404s blindly to the homepage (which search engines classify as soft 404s per Google Search Central documentation), the team maps high-value legacy URLs to their closest 1-to-1 topical equivalents on the new site.
Preserving Raw URLs & Cleaning Parameter Noise
Historical web captures frequently include tracking parameters, session identifiers, and faceted navigation strings (e.g., ?sort=price, ?ref=twitter). When cleaning your raw extract:
- Differentiate Tracking from Functional Parameters: Use regular expressions to strip passive tracking parameters (such as
utm_*,fbclid, orgclid). However, retain functional query parameters (such as?product_id=or?p=) if the legacy CMS used dynamic routing. - Preserve Server-Specific Trailing Slashes: Do not strip or append trailing slashes uniformly across the entire export without verifying server conventions. If the legacy server enforced
/category/with a slash, altering it to/categorycreates an artificial redirect hop. - Focus on Unique Canonical Paths: Review unique underlying content paths rather than duplicate pagination or sorting variations.
Actionable Takeaway Checklist
- Extract Unique Capture Keys: Query the CDX API with
collapse=urlkeyto generate clean path inventories. - Filter by MIME Type: Restrict queries to
text/htmlto exclude image assets, stylesheets, and scripts from page lists. - Verify Live HTTP Status: Test legacy URLs in bounded batches using our Broken Link Checker to identify active 404s.
- Map 1-to-1 Redirects: Avoid mass homepage redirects; redirect historical URLs to relevant modern equivalents.