
PyPI API: Discover Python Packages in Any Domain (Free, Instant)
PyPI (Python Package Index) has a JSON API that lets you search 500K+ packages. No auth needed. Get Package Info curl 'https://pypi.org/pypi/scrapy/json' Returns: name, version, summary, author, license, downloads, dependencies. Search via Simple API PyPI doesn't have a traditional search endpoint, but you can use the simple index: async function searchPyPI ( query ) { // Use PyPI search via xmlrpc const url = `https://pypi.org/search/?q= ${ encodeURIComponent ( query )} &o=` ; const res = await fetch ( url ); const html = await res . text (); // Parse search results const matches = [... html . matchAll ( /class="package-snippet__name"> ([^ < ] + ) <.* ? class="package-snippet__description"> ([^ < ] * ) </g s )]; return matches . map ( m => ({ name : m [ 1 ]. trim (), description : m [ 2 ]. trim () })); } Or get specific package details: async function getPackage ( name ) { const res = await fetch ( `https://pypi.org/pypi/ ${ name } /json` ); const data = await res . json (); return {
Continue reading on Dev.to Webdev
Opens in a new tab


