# GitHub Code Search via x402node

> GitHub Code Search via x402node is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-13).

Searches GitHub public repositories for code matching a query, returning matched files with repo info, path, snippet, language, and star count.

## Facts

- Endpoint: GET https://api.x402node.dev/search/github/code
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-c0de88d0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y3hiIqFNs7j5-0GNfd0mn

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 api-x402node-dev-c0de88d0
```

Example prompt: Search GitHub for real-world Python implementations of JWT token validation — show me up to 10 matched files with their repo name, file path, and a code snippet.

## When to prefer this

Use this endpoint when an AI coding agent needs real-world code examples or implementation patterns from public GitHub repositories, especially when looking for how specific libraries, algorithms, or APIs are used in practice. Prefer this over generic web search when you specifically want runnable code snippets with repository context and language filtering.

## Known failure modes

- Empty query returns an error or no results
- Language filter typo returns no results or unfiltered results
- Rate limiting or upstream GitHub API errors cause 5xx responses
- Payment not received causes 402 response blocking access
- Very broad query may return low-relevance results up to the limit

## How this service works

Search GitHub code across public repositories. Returns matched files with repo, path, snippet, language, and stars. Use ?q=YOUR_QUERY plus optional and language=python and limit=10. Built for AI coding agents looking for real-world implementations and similar code patterns.

## Output

Returns a list of matched files from public GitHub repositories, each containing the repository name, file path, code snippet, programming language, and the repository's star count.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "Search query (required)"
      },
      "limit": {
       "type": "string",
       "description": "Max results (optional)"
      },
      "language": {
       "type": "string",
       "description": "Language (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-c0de88d0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
