# s2ar Symbol Reader

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

Fetches a single named symbol (function, type, method, etc.) along with its doc comment from a public GitHub, GitLab, or Codeberg repository source file.

## Facts

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

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-symbol-reader-d75cc6fc
```

Example prompt: Can you grab the source code and doc comment for the `parseQueryString` function from the file `src/utils/query.ts` in the repo `acme-org/my-project` on GitHub?

## When to prefer this

Use this endpoint when you need the exact implementation and documentation of a single, specifically named symbol in a public repo, and you already know the file path and symbol name. It is more precise than a semantic code search and cheaper than fetching an entire file or repo map. Prefer it over broader search endpoints when the symbol name is known and you only need one definition.

## Known failure modes

- Symbol name not found in the specified file — returns an error or empty result
- Repository is private or inaccessible — access denied
- Invalid or non-existent file path — file not found error
- Unknown or invalid git ref specified — ref resolution failure
- Malformed repository identifier — parsing error
- Network timeout accessing the upstream repository

## How this service works

Function source from a GitHub repo — one symbol with its doc comment, by name. GET ?repo=&file=&symbol=

## Output

Returns the full source text of the named symbol (function, class, type, method, etc.) along with its associated doc comment, scoped to the exact file and optionally a specific git ref (branch, tag, or commit) within the repository.

## 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",
      "file",
      "symbol"
     ],
     "properties": {
      "ref": {
       "type": "string",
       "description": "branch, tag or commit; the default branch when omitted"
      },
      "file": {
       "type": "string",
       "description": "path inside the repository"
      },
      "repo": {
       "type": "string",
       "description": "a public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL"
      },
      "symbol": {
       "type": "string",
       "description": "a name as sym ls lists it"
      }
     },
     "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-symbol-reader-d75cc6fc/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)
