Skip to content

API overview

The Altar API is an HTTP API that returns JSON. Everything you see in the app comes from it.

Base URL https://altar.fund/api/v1
Reference Routes you can try and Signed routes
Machine-readable description /openapi.json (OpenAPI 3.1)
Text for language models /llms.txt and /llms-full.txt

The description is generated from the code

Section titled “The description is generated from the code”

The OpenAPI document is generated from the server’s route table and its Zod schemas every time these docs are built. A test compares the routes Express serves with the routes in the document. It fails when a route is missing from the document, or when the document lists a route the server no longer has. So the reference cannot silently drift from the server.

The version is part of the path: /api/v1. There is one version today.

Most read routes need no authentication. Routes that change data, and routes that read private data, need a typed-data signature (EIP-712) in the request. There are no API keys and no session tokens. Read Authentication and signing.

  • Send JSON with content-type: application/json.
  • Large integers in a request use an object: { "__type__": "bigint", "value": "123" }. This applies to timestamps and chain identifiers inside signed bodies.
  • Large numbers in a response are decimal strings. Points, prices, and amounts are whole numbers scaled by a power of ten. Prices and points are scaled by 10^18.
  • Errors return an HTTP status and a body { "error": "message" }. Common statuses: 400 (bad request), 401 (expired timestamp or bad signature), 403 (not allowed), 404 (not found), 409 (conflict), 429 (too many requests).
  • Pagination. List routes take limit (1 to 1000, default 100) and offset (default 0), and return the page information in the body.
  • Points versions. Routes that read points take an optional version. Without it, they use the latest version. See Verify it yourself.

I found these limits in the application code. Other layers in front of the API can add their own limits.

Limit Value
POST /stats/sacrifices without an address 5 requests per 10 seconds for each client address. The limit is held in the memory of the server process.
POST /address/register-voucher 5 requests per 10 seconds for each client address, and 3 per minute for each destination address.
Request body size 100 KB. The three address-pool upload routes allow 5 MB.
Signature age A signed timestamp must be at most 60 minutes old and at most 5 minutes in the future.
Page size 1000 rows.
  • The API sends Cache-Control: no-store on its responses, except where a route sets its own. Published address-set artifacts are cached for one year, because they never change.
  • The server allows cross-origin requests from any origin unless an operator limits them with a list of allowed origins.
Terminal window
curl https://altar.fund/api/v1/health
curl https://altar.fund/api/v1/projects

The request and response schemas live in the sacrifice-utils package of the Altar repository. See Using sacrifice-utils.