s2ar

sym map

/v1/sym/map · $0.01 a call · 10 keyless calls a day · paid by x402, credits, mpp

A map of a public git repository fitted to a token budget: files ranked by how many others import them (PageRank over the import graph), each with its top-level definitions, parsed with tree-sitter (Rust, Python, TypeScript/TSX, JavaScript, Go, Lua, C, C++, Java, Ruby). Use it to orient before reading anything. Every answer carries a receipt.

Call it

curl 'https://api.s2ar.dev/v1/sym/map?repo=BurntSushi%2Fripgrep&ref=14.1.1&budget=600'
curl -X POST https://api.s2ar.dev/v1/sym/map \
  -H 'content-type: application/json' \
  -d '{"repo": "BurntSushi/ripgrep", "ref": "14.1.1", "budget": 600}'

With a key: add -H 'Authorization: Bearer $S2AR_KEY'. Over x402, while sales are open: the same call at https://api.s2ar.dev/x402/v1/sym/map; unpaid, it answers 402 with the accepts[] to sign, then send the payment as PAYMENT-SIGNATURE (or X-PAYMENT). Sales are paused since 2026-10-16, and the mirror answers 410. From an agent: the MCP tool sym_map_repo at https://api.s2ar.dev/mcp.

Parameters

parametertyperequiredwhat
repostringyesa public GitHub, GitLab or Codeberg repository: owner/repo, github.com/owner/repo or its https URL
refstringbranch, tag or commit; the default branch when omitted
budgetintegerapproximate tokens (default 1000) (minimum 100, maximum 8000)

The answer

{
 "ok": true,
 "text": "crates/core/flags/mod.rs:\n  trait Flag\n  enum Category\n…",
 "tokens_est": 577,
 "charged_usd": 0.01,
 "repo": "https://github.com/BurntSushi/ripgrep",
 "ref": "14.1.1",
 "receipt": {
  "evidence_hash": "sha256:94abfed2…",
  "cost_usd": 0.01,
  "what": "map",
  "determinism": "replayable",
  "witnesses": [
   "sym"
  ],
  "issued_at": "2026-10-10T00:00:00Z",
  "refund_rule": "failed calls are never charged",
  "charter": "https://api.s2ar.dev/charter"
 }
}

Every paid answer carries its receipt; a record's sha256 re-verifies free at /v1/verify/{sha256}. A call that fails is never charged.

A worked example

read the function: the call, its answer and its record, re-derived.

The errors are the same on every route.