Look up Python packages on PyPI by name with variant matching, paid via x402 micropayment.
What it does
The `/scout/pypi` endpoint is part of the Scout Multi-source Intelligence API hosted at scout.hugen.tokyo. It searches the Python Package Index (PyPI) by package name, automatically trying multiple name variants (hyphenated, underscored, with py- prefix) to maximize match likelihood. Results include package version, summary, license, and links.
This endpoint is one of 19+ source-specific search endpoints offered by Scout, which also covers GitHub, npm, Hacker News, arXiv, Semantic Scholar, Stack Overflow, X/Twitter, Product Hunt, and more. The PyPI endpoint accepts a required `q` query parameter for the package name and an optional `per_page` parameter (1–20, default 5). It costs $0.005–$0.01 per call, payable in USDC on Base via the x402 protocol. Alternative access methods include a broker API key (with $0.05 free credit), an MCP server at mcp.hugen.tokyo, or the `x402-pay` Python SDK.
The endpoint is live and returns a 402 payment challenge with a sample response showing package name, version, and summary. The OpenAPI spec is comprehensive, covering all Scout endpoints with parameter schemas, descriptions, and documented response codes (200, 402, 502).
Capabilities
Use cases
- —AI agents discovering Python dependencies before generating code
- —Automated dependency auditing by looking up package metadata and licenses
- —Programmatic package discovery for build tools or CI/CD pipelines
- —Comparing Python packages by version, summary, and license info
- —Integrating PyPI search into multi-source intelligence reports
Fit
Best for
- —AI agents that need programmatic PyPI lookups without scraping
- —Developers wanting pay-per-call PyPI search without API keys or rate limits
- —Multi-source research workflows that include Python ecosystem data
Not for
- —Bulk downloading or mirroring PyPI package files
- —Searching for packages across non-Python ecosystems (use /scout/npm for Node)
- —Free-tier usage — every call requires a micropayment
Quick start
# Using x402-pay SDK (pip install x402-pay)
import x402_pay
result = x402_pay.get('https://scout.hugen.tokyo/scout/pypi?q=fastapi&per_page=5')
print(result.json())Example
Request
{
"url": "https://scout.hugen.tokyo/scout/pypi?q=fastapi&per_page=5",
"method": "GET"
}Response
{
"count": 1,
"query": "fastapi",
"source": "pypi",
"results": [
{
"name": "fastapi",
"summary": "FastAPI framework",
"version": "0.115.0"
}
]
}Endpoint
Quality
Full OpenAPI schema with parameter details, live 402 challenge with sample response data, and multiple documented access methods. Docked slightly because no dedicated docs page exists, response schema is not formally specified, and the sample response in the challenge is minimal.
Warnings
- —No /docs or /README endpoint available — all documentation comes from the OpenAPI spec only.
- —The 402 challenge shows $0.01 but the OpenAPI description says $0.005 — actual price may vary.
- —Response body schema is not formally defined in the OpenAPI spec; only a text description is provided.
Citations
- —Endpoint searches PyPI packages by name with multiple name variants (hyphenated, underscored, py- prefix)https://scout.hugen.tokyo
- —Accepts q (required) and per_page (1-20, default 5) query parametershttps://scout.hugen.tokyo
- —Payment required is $0.005 per the OpenAPI spechttps://scout.hugen.tokyo
- —402 challenge shows $0.01 USDC on Base with sample responsehttps://scout.hugen.tokyo/scout/pypi
- —Scout API covers 19+ platforms including Reddit, Hacker News, GitHub, Stack Overflow, arXiv, npm, PyPI, X/Twitter, YouTube, Product Hunt, and morehttps://scout.hugen.tokyo
- —Alternative access via broker API key, MCP server, or x402-pay Python SDKhttps://scout.hugen.tokyo/scout/pypi