code-archive
Software Heritage
A universal archive of source code, the 'Library of Alexandria of code', preserving over 20 billion unique source files from more than 350 million projects. You can search for projects, look up files by hash (sha1/sha256/git), and resolve permanent SWHID identifiers, on the website or through its keyless REST API. The place to go when a repository has vanished from its original host, or when you need to identify a file by its hash.
Why it’s useful & how it works
Software Heritage is the closest thing to a universal safety net for source code: it continuously crawls public repositories from GitHub, GitLab, package managers like PyPI and npm, and dozens of other forges, preserving every unique file and commit with a permanent SWHID identifier. A researcher reaches for it when a repository has disappeared from its original host, when they need to pinpoint an exact file by its cryptographic hash, or when they want a stable, citable reference to a specific version of code. You can search by project name or URL to find archived origins, look up a file directly by its SHA-1, SHA-256, or git hash, or resolve an SWHID to jump straight to a preserved snapshot.
What’s inside
Over 20 billion unique source files and 350 million software projects preserved, drawn from forges, package repositories, and FOSS distributions worldwide. The archive crossed 2 petabytes of stored data in 2025.
API access
https://archive.softwareheritage.org/api/1/ , /content/sha1:<h>/, /content/sha256:<h>/, /origin/search/<text>/, /resolve/<SWHID>/
What we measured
Our own probes, not the archive’s own claims. Re-run periodically; every reading below is dated.
Reachability
- Direct request
- Responded HTTP 200 338 ms
- Through a datacenter proxy
- Responded HTTP 200 767 ms
- API, direct
- Responded HTTP 200 209 ms
- API, through a proxy
- Responded HTTP 200 770 ms
Did a real search return anything?
Returned results · 10 results for the sample query · median 1 s · stable across runs
Sample query: https://github.com/DzRepo/Python-Insights
Benchmark coverage
Found 9 of 10 test items (90%) in the Software / packages cluster. Median response 532 ms.
By how well known the item is: 5/5 well-known, 4/4 mid, 0/1 obscure .
One item it found: https://github.com/mehul-clou/sending-http-requests-starter
Found 0 of 2 test items (0%) in the File by hash cluster. Median response 592 ms.
By how well known the item is: 0/2 mid .
Reachability measured 2026-08-22. Search checked 2026-08-22. Benchmark run 2026-08-22.
Access
Programmatic API access (a key may be required, see the API tag).