# s2ar Repo Symbol Map

> s2ar Repo Symbol Map is a paid API for AI agents from api.s2ar.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-10).

Returns files in a GitHub/GitLab/Codeberg repo ranked by imports, with their definitions, fitted to a token budget.

## Facts

- Endpoint: GET https://api.s2ar.dev/x402/v1/sym/map?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/s2ar-repo-symbol-map-dfa53753
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JrVaPKkl9R2EITFVx6wFK

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 s2ar-repo-symbol-map-dfa53753
```

Example prompt: Can you give me a map of the most important files and their definitions in the vercel/next.js GitHub repo, fitted to about 2000 tokens?

## When to prefer this

Choose this endpoint when you need a compact, importance-weighted structural overview of a public repository — especially when working within a token budget (e.g., for feeding into an LLM context window). It is superior to raw file listing because it ranks files by import centrality and includes symbol definitions, giving semantic meaning to the structure. Prefer it over the file-skeleton endpoint when you want cross-file ranking by importance rather than a flat per-file outline, and over the semantic code search endpoint when you want a holistic map rather than answers to a specific question.

## Known failure modes

- Repository not found or is private — returns error indicating inaccessible repo
- Invalid repo format (not owner/repo or recognizable URL) — returns validation error
- Token budget too small to include any meaningful content — may return minimal or empty map
- Rate limiting or upstream GitHub/GitLab/Codeberg API failures — returns upstream error
- Invalid ref (branch/tag/commit does not exist) — returns ref-not-found error
- Payment not processed — x402 payment required error before response is served

## How this service works

GitHub repo map — files ranked by imports with their definitions, fitted to a token budget. GET ?repo=owner/repo

## Output

A ranked list of files from the repository, ordered by how often they are imported by other files, each accompanied by their symbol definitions (functions, types, classes, etc.), with the entire output fitted to the specified token budget (default 1000 tokens). This gives an agent or developer a compact, importance-weighted map of the codebase's core structure.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "repo"
     ],
     "properties": {
      "ref": {
       "type": "string",
       "description": "branch, tag or commit; the default branch when omitted"
      },
      "repo": {
       "type": "string",
       "description": "a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL"
      },
      "budget": {
       "type": "string",
       "description": "approximate tokens (default 1000)"
      }
     },
     "additionalProperties": {
      "type": "string"
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

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