Back to articles
I Built a Script That Finds Hidden APIs on Any Website (Here's the Code)

I Built a Script That Finds Hidden APIs on Any Website (Here's the Code)

via Dev.to TutorialAlex Spinov

Most websites have hidden JSON APIs that return cleaner data than their HTML pages. I built a simple Node.js script that discovers them automatically. The Problem Traditional web scraping is fragile: CSS selectors break when sites redesign HTML parsing is slow and error-prone Anti-bot systems block headless browsers But many sites expose internal JSON APIs that are faster, more stable, and return structured data. The Discovery Script const https = require ( " https " ); async function findAPIs ( domain ) { const commonPaths = [ " /api/v1 " , " /api/v2 " , " /api/graphql " , " /_next/data " , " /wp-json/wp/v2/posts " , " /feed.json " , " /sitemap.xml " , " /.well-known/openid-configuration " , " /robots.txt " , " /manifest.json " ]; const results = []; for ( const path of commonPaths ) { try { const res = await fetch ( `https:// ${ domain }${ path } ` ); if ( res . ok ) { const contentType = res . headers . get ( " content-type " ) || "" ; results . push ({ path , status : res . status

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles