Introduction
Overview of the SPACEDEX REST and WebSocket API.
The SPACEDEX API lets you access market data, manage your account, and place spot trades programmatically. It is a fast, predictable interface built for bots, dashboards, and integrations of every size.
There are two ways to talk to SPACEDEX: a REST API for requests and responses, and a WebSocket API for real-time streaming of prices, order-book updates and account events.
Base endpoints
| Interface | Base URL |
|---|---|
| REST | https://api.spacedex.com |
| WebSocket | wss://stream.spacedex.com |
Conventions
Every REST response is JSON. All timestamps are Unix time in milliseconds. Quantities and prices are returned as strings to preserve precision, so parse them with a decimal-safe type, never a float, before doing math.
| Term | Meaning |
|---|---|
| Symbol | A trading pair such as BTCUSDT (base asset BTC, quote asset USDT) |
| Base asset | The asset you are buying or selling (BTC in BTCUSDT) |
| Quote asset | The asset the price is denominated in (USDT in BTCUSDT) |
| Weight | The rate-limit cost of an endpoint (see Rate Limits) |
Endpoint security
Each endpoint carries a security type. Public endpoints need nothing. Signed endpoints (TRADE and USER_DATA) require an API key and a request signature, described in Authentication.
| Security type | Requirement |
|---|---|
| PUBLIC | No key. Market data and exchange metadata. |
| API_KEY | A valid API key header, no signature. |
| TRADE | API key + signature. Places and cancels orders. |
| USER_DATA | API key + signature. Reads private account data. |