Back to articles
Archive.org Has a Free API — Check How Any Website Looked 20 Years Ago (Wayback Machine)

Archive.org Has a Free API — Check How Any Website Looked 20 Years Ago (Wayback Machine)

via Dev.to TutorialAlex Spinov

The Wayback Machine has been archiving the internet since 1996. It has 800 billion web pages stored. What most developers don't know: it has a free API . No key needed. You can programmatically check how any URL looked on any date. Quick Start import requests def wayback_check ( url ): """ Check if a URL exists in the Wayback Machine. """ api = f ' https://archive.org/wayback/available?url= { url } ' resp = requests . get ( api ) data = resp . json () snapshot = data . get ( ' archived_snapshots ' , {}). get ( ' closest ' , {}) if snapshot : return { ' archived ' : True , ' url ' : snapshot [ ' url ' ], ' timestamp ' : snapshot [ ' timestamp ' ], ' status ' : snapshot [ ' status ' ] } return { ' archived ' : False } result = wayback_check ( ' google.com ' ) print ( f ' Archived: { result [ " archived " ] } ' ) if result [ ' archived ' ]: print ( f ' Snapshot URL: { result [ " url " ] } ' ) Use Cases 1. Competitive Intelligence See how a competitor's pricing page changed over time: def

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles