Skip to main content

Snap a quick status check on any URL or list of URLs

Project description

🔗 linksnap

Snap a quick status check on any URL or list of URLs.

linksnap is a fast, zero-dependency Python library for checking whether URLs are alive, dead, or redirecting — with response times, SSL validation, file scanning, and CSV/JSON export built in.


Install

pip install linksnap


Quick start

import linksnap

linksnap.snap([ "https://google.com", "https://github.com", "https://thispagedoesnotexist99.com", "https://httpstat.us/404", ])

Output:

🔗 linksnap — checking 4 URL(s)...

✅ ALIVE (200) [143ms] 🔒 https://google.com ✅ ALIVE (200) [201ms] 🔒 https://github.com ❌ DEAD https://thispagedoesnotexist99.com ❌ DEAD (404) [89ms] https://httpstat.us/404

📊 4 checked | 2 alive | 0 redirected | 2 dead | 0 errors


Features

✅ Check a list of URLs

results = linksnap.check([ "https://google.com", "https://github.com", ])

for r in results: print(r["url"], r["status"], r["code"], r["response_ms"])

Each result is a dict with:

  • url the original URL
  • status ALIVE, DEAD, REDIRECT, or ERROR
  • code HTTP status code (or None)
  • redirect final URL if redirected (or None)
  • response_ms response time in milliseconds (or None)
  • ssl True (valid cert), False (invalid cert), None (not HTTPS)

🌐 Scan a webpage for broken links

linksnap.scan_page("https://example.com")

Fetches the page, extracts every link, and checks them all at once.


📂 Check links from a file

linksnap.from_file("urls.txt") # one URL per line linksnap.from_file("links.csv") # scans all cells linksnap.from_file("page.html") # extracts all href links


💾 Export results

results = linksnap.check(["https://google.com", "https://github.com"])

linksnap.to_json(results, "results.json") linksnap.to_csv(results, "results.csv")


⚙️ Options

All functions support these optional arguments:

workers=10 number of concurrent threads (increase for large lists) retries=1 how many times to retry a dead link before giving up

linksnap.snap(urls, workers=20, retries=2)


Why linksnap?

  • ⚡ Fast — checks URLs concurrently using threads
  • 📦 Zero deps — pure Python stdlib, nothing to install
  • 🔒 SSL check — flags invalid or missing HTTPS certificates
  • ⏱ Timing — measures response time for every URL
  • 🔁 Retries — retries dead links before marking them as dead
  • 📂 Files — reads from .txt, .csv, and .html files
  • 💾 Export — saves results to JSON or CSV

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linksnap-1.0.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linksnap-1.0.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file linksnap-1.0.0.tar.gz.

File metadata

  • Download URL: linksnap-1.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for linksnap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f11db85406c20efb88a89420f4ceefa6b5240c58db60ff78f92f63cd4157df82
MD5 c28a275dadb45371d8ac33fdd0d8ab55
BLAKE2b-256 dab647da174c965cfb5dcf2a2b3a53b8d8236fc4dfa4adfe903ad04c809dacb5

See more details on using hashes here.

File details

Details for the file linksnap-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: linksnap-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for linksnap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2013af8306c3872912b8eeb51a34683284b37491b7dfe094a0af7feb5fe8dc0
MD5 7b577c96828e438a0b8d5e0851e857c8
BLAKE2b-256 a8c9298ce9d4d4415ee87317bfd95e21a1235c7b34499b4dcac6e4f0efafdfbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page