Skip to main content
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

See Local development for setup instructions.

Request format

All compute endpoints accept POST 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

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.
Here is what each field means:
  • 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. The deadline indicates when the signature expires.

Error handling

Errors follow RFC 7807 (Problem Details for HTTP APIs):

Common error types

Handling errors in code

Full example: curl

Next steps

Agent integration

Use Astral as a spatial oracle in agent workflows

Blockchain integration

Submit signed results onchain via EAS

API reference

Full endpoint documentation