Research preview — APIs may change. GitHub
Calling the API
This guide covers the mechanics of making requests to Astral — how to format inputs, what comes back, and how to handle errors.Base URL
| Environment | URL |
|---|---|
| Production | https://api.astral.global |
| Local development | http://localhost:3004 |
Request format
All compute endpoints acceptPOST requests with a JSON body. The required fields depend on the operation, but every request needs a chainId to identify which chain to sign for.
Distance, length
Contains, intersects
Optional fields
| Field | Description |
|---|---|
schema | EAS schema UID — required if you plan to submit the result onchain |
recipient | Ethereum address to set as the attestation recipient |
Geographic feature inputs
You can pass geographic features in four formats:Raw GeoJSON
A GeoJSON geometry object directly in the request:UID string
A reference to an onchain location attestation:UID + URI (offchain attestation)
A reference to an offchain attestation stored on IPFS or another location:Inline signed attestation
A full offchain attestation object:Authentication
No authentication is currently required. Rate limits apply by IP address (100 requests/hour for unauthenticated clients). Wallet-based authentication with higher limits is planned.Response format
A successful response includes the computed result, proof of computation, and a pre-signed attestation for optional onchain submission.result— The computed answer. A number for distance/area/length, a boolean for contains/within/intersects.units— Unit of measurement (for numeric results)."meters"or"square_meters".operation— The spatial operation that was performed.timestamp— Unix timestamp of when the computation ran.inputRefs— Hashes of the input geographic features. These let you verify which inputs were used in the computation.attestation— The full EAS attestation data, including the TEE’s cryptographic signature.delegatedAttestation— A pre-signed attestation ready for onchain submission via EAS. Thedeadlineindicates when the signature expires.
Error handling
Errors follow RFC 7807 (Problem Details for HTTP APIs):Common error types
| Type | Status | What it means |
|---|---|---|
invalid-input | 400 | Bad request data, missing fields, or invalid geometry |
attestation-not-found | 404 | The UID does not exist on the specified chain |
verification-failed | 401 | Signature verification failed |
computation-error | 500 | The PostGIS operation failed |
rate-limited | 429 | Too many requests — wait and retry |