
Build a Broken Link Detector in Under 50 Lines of Node.js
Your site has broken links right now. You just don't know which ones. It could be a blog post from 2019 linking to a vendor that went under. A docs page pointing to a GitHub repo you archived. A partner integration page whose link rotted when they redesigned their site. None of these show up in your analytics. Users quietly bounce, Google quietly downgrades you, and you find out six months later when SEO drops. Here's how to build a broken link detector in under 50 lines of Node.js that actually works — no browser automation, no Puppeteer, no scraping logic to maintain. The Approach The standard approach to link checking is messy: spin up a headless browser, navigate to the page, wait for JS to render, extract hrefs from the DOM, then check each one with fetch . That's 80+ lines before you've handled relative URLs, redirects, or rate limiting. There's a faster way. SnapAPI's /v1/metadata endpoint returns all links from a page as a clean array in a single API call — no browser to manage
Continue reading on Dev.to Webdev
Opens in a new tab


