Exchange API.
Made understandable.
Read the local asset catalogue, request a quote, create an account-owned order, and track its status using Next.js route handlers.
GET /api/quoteJSON requests and responses.
Explicit demo and live modes.
Try a quote request
This console calls the running local endpoint. It never creates an order or sends funds.
Run a request to inspect the response.
curl 'https://simpleswap.world/api/quote?from=btc&to=eth&amount=0.1&fixed=false'
Endpoints at a glance
| Method | Route | Purpose |
|---|---|---|
| GET | /api/currencies | Supported asset and network options |
| GET | /api/quote | Estimate, limits, fees, expiry, and mode |
| POST | /api/exchanges | Create an order with recipient validation |
| GET | /api/exchanges/{id} | Read an order owned by your account or browser |
| POST | /api/exchanges/{id}/cancel | Cancel a waiting demo order |
| POST | /api/exchanges/{id}/advance | Advance one simulated demo stage |
Authenticate your integration
Create a local API key in your account, copy it once, and store it as a server environment variable. Use the bearer header for account-owned exchange requests. Anonymous demo quotes do not need a secret. For live exchanges, request and submit the quote using the same Bearer key or browser session and include the returned quoteToken.
Authorization: Bearer YOUR_LOCAL_API_KEY
Handle errors deliberately
Read the HTTP status and error message. Correct invalid addresses or amount limits before retrying, wait when rate limited, and inspect an existing order before recreating it.
Error reference