Wayback Machine Scraper: Clean Markdown & Historical Page Diff
Pricing
$25.00 / 1,000 valid diffs
Wayback Machine Scraper: Clean Markdown & Historical Page Diff
Compare two archived versions of a web page near two dates. Get a clean Markdown diff, both Wayback capture links, and CDX digests.
Pricing
$25.00 / 1,000 valid diffs
Rating
0.0
(0)
Developer
Carlo Clores
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 hours ago
Last modified
Categories
Features
Share
histdiff
Compare a web page on two dates. Each result includes the later page as clean Markdown, a unified line diff, and both Wayback replay URLs and CDX digests. One changed, usable pair costs $0.025. An unchanged pair, missing capture, junk page, or failed comparison costs $0 under the Store configuration below.
Run in Apify Console
- Sign in to Apify. Open the published histdiff Actor in the Store, or open your private build under Actors after deployment.
- Open Input and switch to JSON. Paste the input below and select Start. Each date is a UTC calendar day. The start date can equal the end date.
- Open the completed run's Output tab. Comparisons shows status and replay links. Text and provenance shows the diff, Markdown and digests. To retrieve every field, export the default dataset as JSON with all fields selected.
{"urls": ["https://openai.com/pricing", "https://stripe.com/pricing"],"date_start": "2024-01-01","date_end": "2026-01-01","tolerance_days": 45,"min_words": 50}
Supply 1–50 absolute HTTP(S) URLs. Each entry produces one row in input order, including duplicates. Both dates are required in YYYY-MM-DD form. The default tolerance is 45 days and accepts zero for an exact calendar day. The default minimum word count is 50 and accepts integers of one or more.
Reading a result
This example uses fixture HTML with one changed line out of five. The timestamps and digests illustrate the shape of the archive metadata.
{"url": "https://example.com/pricing","status": "ok","billable": true,"timestamp_a": "2024-01-01T14:22:10Z","timestamp_b": "2025-12-28T09:11:04Z","archive_url_a": "https://web.archive.org/web/20240101142210id_/https://example.com/pricing","archive_url_b": "https://web.archive.org/web/20251228091104id_/https://example.com/pricing","cdx_digest_a": "J7K2NVF5YLWWDGLKJOKHXLZPYCZ3LJXA","cdx_digest_b": "KXS2G7YBQNG2S3LONDKPQ6VZ533HJJBN","title_b": "Pricing - Example","word_count_b": 58,"markdown_b": "# Pricing\n\nThe Pro plan includes support for every member of your team. All plans come with a monthly invoice and there are no setup fees. Each member has their own workspace and can invite teammates to join projects. Your administrator can change the number of seats at any time from the account settings page.\n\nPro: $49 per month.","unified_diff": "--- a\n+++ b\n@@ -2,4 +2,4 @@\n \n The Pro plan includes support for every member of your team. All plans come with a monthly invoice and there are no setup fees. Each member has their own workspace and can invite teammates to join projects. Your administrator can change the number of seats at any time from the account settings page.\n \n-Pro: $29 per month.\n+Pro: $49 per month.","change_ratio": 0.2,"error": null}
unified_diff uses stable file labels a and b, LF separators, and three lines of context. Minus lines belong to the start capture. Plus lines belong to the end capture. The ratio is (larger line count − matching line count) / larger line count using the same line matcher as the diff. A replacement counts once. Blank lines participate. Equal Markdown yields status: "ok", an empty diff, ratio zero and both sets of provenance.
| Status | Meaning | Charge |
|---|---|---|
ok | Both captures passed extraction | $0.025 for a nonempty diff, otherwise $0 |
no_snapshot | CDX returned no eligible capture for a requested date | $0 |
junk | Every attempted digest for a date failed the content checks | $0 |
error | The input, upstream, extraction, or spending limit prevented delivery of a comparison | $0 |
Failure rows contain the URL and error code with all comparison fields set to null. Codes include INVALID_URL, INVALID_INPUT, NO_SNAPSHOT, JUNK_SNAPSHOT, UPSTREAM_TIMEOUT, UPSTREAM_HTTP_ERROR, INVALID_CDX, REPLAY_MISMATCH, PROXY_UNAVAILABLE, EXTRACTION_FAILED, RESPONSE_TOO_LARGE, RESULT_TOO_LARGE and CHARGE_LIMIT. A missing or invalid URL array fails input validation before any charge.
Capture selection and junk policy
- The Actor lowercases the host and removes the fragment and tracking keys
utm_*,gclid, andfbclidcase-insensitively. CDX receives the remaining URL, including its query. - For each date, it asks CDX for exact URL matches with status 200 and MIME type
text/html, collapsing adjacent duplicate digests. It searches backward from the end of the requested UTC day first, then forward from the next midnight if needed. Both tolerance boundaries are inclusive. A same-day capture wins over all earlier captures. The reverse search keeps the most recent member of a repeated digest. Wayback CDX documentation - The Actor fetches the CDX row's original URL via its timestamped
id_replay. Redirects produce a free upstream error. A replay's declared content type must be HTML or XHTML, and a supplied Memento datetime must agree with the CDX timestamp. Up to three URLs run concurrently, with one Wayback request at a time per URL. All requests use Apify Proxy, a ten-second deadline per attempt, and up to two retries on transport errors, HTTP 408, 429, or 5xx. - The Actor checks the original HTML title and every H1 for these case-insensitive phrases:
just a moment,attention required,access denied,404 not found,page not found,parked, anddomain is for sale. For extracted pages under 150 words it also checks body text forverify you are human,verify you're human,checking your browser,enable javascript and cookies to continue, andperforming security verification. - Trafilatura extracts Markdown with links from the server-returned HTML. A missing document, empty extraction, or extraction below
min_wordsis junk. The count uses Unicode word tokens in the resulting Markdown, including link text and destinations. Apostrophes and internal hyphens can join a token. Equality with the threshold passes. Trafilatura extraction API - If the first digest is junk, the Actor tries exactly one other distinct digest when available, in the same before-then-after order. If neither passes, the row is
junk. A replay transport failure or extractor exception produces a free error. A response over 8,000,000 decoded bytes or a result over 8,000,000 serialized bytes produces a free size error.
Synchronous REST call
The deployed Actor's API tab shows its ID. In PowerShell, set APIFY_TOKEN to a personal token from Console → Settings → Integrations, then run the following. Enter the publisher's Apify username at the prompt. The response is an array of dataset rows. Synchronous Actor endpoint
$publisher = Read-Host 'Apify publisher username'$endpoint = "https://api.apify.com/v2/actors/$publisher~histdiff/run-sync-get-dataset-items"$body = @{urls = @('https://stripe.com/pricing')date_start = '2024-01-01'date_end = '2026-01-01'} | ConvertTo-Json$headers = @{ Authorization = "Bearer $env:APIFY_TOKEN" }$rows = Invoke-RestMethod -Method Post -Uri $endpoint -Headers $headers -ContentType 'application/json' -Body $body -TimeoutSec 310$rows | ConvertTo-Json -Depth 5
Apify's synchronous endpoint waits up to 300 seconds. For a large batch, use Console or an asynchronous Actor run. If the HTTP connection times out, check Runs before starting another paid comparison.
Apify MCP
Add the hosted Streamable HTTP server https://mcp.apify.com?tools=call-actor,get-actor-run,get-dataset-items to your MCP client's remote servers. Connect and sign in to Apify using the browser authorization flow. Give the client the published Actor's full name and input. Substitute the publisher's username in this request. Apify MCP setup and tools
Use call-actor to run PUBLISHER/histdiff for https://stripe.com/pricing between 2024-01-01 and 2026-01-01. Wait for completion, read the default dataset, and show the first row's status, billable flag, diff and both archive links.
The run response contains a run ID and default dataset ID. Follow the run to completion if still active, then use the storage tools to read the dataset items. REST and MCP each start a separate run.
Project files and local verification
histdiff/.actor/actor.jsoninput_schema.jsonoutput_schema.jsondataset_schema.jsonDockerfile.actorignoresrc/main.pycdx.pyextract.pydiff.pytests/test_actor.pytest_release.pyrequirements.txtTEST_PLAN.mdREADME.md
From this directory with Python 3.12 installed, run these PowerShell commands. The acceptance suite uses temporary storage and simulated archive responses. The package pins the three direct dependencies.
python -m venv .venv.\.venv\Scripts\python -m pip install -r requirements.txt.\.venv\Scripts\python -m unittest discover -s tests -v
For a local live run, save the input example as UTF-8 INPUT.json in this folder, configure your Apify Proxy credentials in the environment, and run .\.venv\Scripts\python -m src.main. The SDK writes results to local storage. Each independent local run needs a fresh default dataset. TEST_PLAN.md
Deployment checklist
- Install the Apify CLI with
npm install -g apify-cli. From the Actor directory, runapify loginand sign in to the publisher account. CLI documentation - For a new empty project, run
apify initbefore copying in this source. The supplied directory already contains the initialized Actor definition. Verify the Actor name ishistdiffand the publisher account has the intended Actor slot. - Run the local tests, then
apify push. Wait for a successful build of version 0.1. Confirm Apify Proxy access on the account and run the private build once. Actor deployment - In Console's monetization settings, choose Pay per event, add a flat-price primary event named exactly
valid-diff, title it Valid diff, and set its price to USD 0.025 across plans. Give it the description “One delivered comparison with two usable captures and a nonempty Markdown diff.” - Remove or zero-price both synthetic events,
apify-actor-startandapify-default-dataset-item. Turn off Pay per event + usage. Confirm that the pricing preview has exactly one positive-priced event. These account settings establish the Store price. Apify pay-per-event configuration - Read the Store preview and publish the Actor to Apify Store. Run one synchronous REST call and one MCP call using the examples above. Inspect their datasets and compare their event ledgers with the billable results. Use equal dates on a known good capture to check that a successful unchanged comparison costs $0.
The Actor writes eligible rows before calling Actor.charge. A failed dataset write stops the run before billing that row. Apify storage and billing are separate operations. If the process stops in between, a delivered row can be free. A resumed run skips already written rows by input position to avoid billing them twice. The billable flag describes eligibility and Apify's event ledger records the actual charge.
What I deliberately did not build
v0.1 excludes a standalone API, RapidAPI integration, custom MCP server, cache, Common Crawl, headless browser, LLM summaries, and WARC byte-offset verification. Apify handles access, proxies, storage and billing. The provenance fields identify the CDX records used for each comparison.