# Code Search: GitHub + npm

> Code Search: GitHub + npm is a paid API for AI agents from agent-search.centorprat.workers.dev, paid per call via x402, $0.006/call, status unknown (last checked 2026-10-30).

Search GitHub repositories and npm packages for a coding task, returning results ranked by stars and relevance with metadata like last push date and links.

## Facts

- Endpoint: POST https://agent-search.centorprat.workers.dev/code?utm_source=zero.xyz
- Price: $0.006/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/code-search-github-npm-c39efeaf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UDSMsP84wOc-P7P5qjIIW

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability code-search-github-npm-c39efeaf -d '<json body>'
```

Example prompt: Search for the best Python libraries for extracting tables from PDFs — show me up to 10 results ranked by stars and relevance, with GitHub repos and npm packages where applicable.

## When to prefer this

Choose this endpoint when you need to discover libraries or repositories for a specific coding task and want results filtered for quality (minimum star threshold) and recency. It combines GitHub and npm in one call, making it ideal for JavaScript/TypeScript work or cross-ecosystem discovery. Prefer this over general web search when you specifically need ranked, maintained open-source packages with metadata like stars and last activity date.

## Known failure modes

- Query too vague returns irrelevant or low-quality results
- Language filter mismatch causes empty npm results for non-JS queries
- numResults out of range (outside 1-20) may cause validation error
- Network or upstream GitHub/npm API failure returns partial or empty results
- Obscure or very new libraries may not appear due to minimum star threshold

## How this service works

Find libraries and repositories for a coding task: GitHub repositories ranked by stars and relevance (popular, maintained ones first; under 30 stars dropped) plus npm packages for JavaScript / TypeScript, with description, stars, last push or publish date and links.

## Output

A ranked list of GitHub repositories and npm packages matching the coding task query. Each result includes the name, description, star count, last push or publish date, and a direct link. GitHub results are ranked by stars and relevance with repos under 30 stars excluded; npm results are included for JavaScript/TypeScript queries.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "the task or library, e.g. python pdf table extraction"
  },
  "language": {
   "type": "string",
   "description": "python, javascript, rust, go, ..."
  },
  "numResults": {
   "type": "integer",
   "description": "1-20 (default 10)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/code-search-github-npm-c39efeaf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-search.centorprat.workers.dev](https://www.zero.xyz/host/agent-search.centorprat.workers.dev/llms.txt)
