Add crypto swaps to your product.
Use EagleSwap to quote a pair, create a swap, and track it through completion. The API uses straightforward JSON over HTTPS and is built for server-to-server integrations.
Base URL
https://eagleswap.to
Authentication
Bearer key
Format
JSON over HTTPS
Quickstart
One swap, start to finish
A typical integration has four calls. Keep the IDs from each response; you will need them in the next step.
- 01
Fetch assets
Store the assetId values returned by the catalog.
- 02
Request a quote
Send the amount as a decimal string: input for float, output for fixed.
- 03
Create the swap
Submit addresses before the quote expires.
- 04
Track the order
Poll by orderId until the status is final.
Quotes last at most 30 seconds; use the returned expiresAt rather than a timer. Be ready with the recipient address. A refund address is optional when the quote does not require one.
Authentication
Keep the API key on your server
Send your key in the Authorization header on every request. API keys can create real swaps, so never put one in browser code, a mobile app, analytics, or public logs.
Authorization: Bearer YOUR_API_KEYCall EagleSwap from a backend you control.
Keep the key in a server-side secret manager. Approved partners can issue a replacement in the partner dashboard after draining active swaps; contact support if access is unavailable.
Rotate keys only after draining active swaps
Rotation revokes the old credential immediately. Quotes and swaps belong to the exact credential that created them, not just to the reseller account, so the new key cannot create a swap from an old quote or read the status of an old swap.
- Stop creating quotes and swaps with the old key.
- Keep polling every swap created with that key until it reaches a terminal status, and persist its final status and transaction IDs.
- Rotate the key only after no swaps are in flight. Save the new key when it is shown, install it in your secret manager, and deploy it immediately.
- Resume quote and swap creation with the new key. Retain your archived records because the old orders are no longer available through the API.
/api/v1/assetsList assets
Returns the assets and networks that are currently available. Fetch this list instead of saving asset IDs in your code. The IDs below are placeholders; this endpoint returns the opaque values to use in a quote.
curl https://eagleswap.to/api/v1/assets \
-H "Authorization: Bearer YOUR_API_KEY"{
"assets": [
{
"assetId": "<btc_asset_id_from_assets>",
"networkId": "<bitcoin_network_id_from_assets>",
"symbol": "BTC",
"decimals": 8,
"networkName": "Bitcoin",
"memoRequired": false
}
]
}Response fields
assetIdThe asset ID to use in quote requests. Copy it exactly as returned.
networkIdThe network ID for this asset. Use it to distinguish the same token on different networks. It is not a quote or swap request field.
symbolThe ticker, such as BTC or USDT. The same symbol can appear on more than one network.
decimalsThe maximum number of decimal places accepted for this asset.
networkNameThe network name to show in your UI.
memoRequiredWhether this network can require a memo or tag. Follow the quote's requirements when creating a swap.
memoNameThe label to show for a memo or tag field. Included only when a label is available.
/api/v1/quotesCreate a quote
Returns the price and requirements for a swap. Select assets by symbol and network name from the catalog, then pass their exact assetId values here. Send amounts as strings to preserve every decimal place.
Request body
originAssetIdThe ID of the asset the customer sends.
destinationAssetIdThe ID of the asset the customer receives.
swapTypeWhich amount to fix. Omit it to use float, which fixes the amount sent. Use fixed to fix the amount received.
amountA value greater than zero, such as "0.01". For float, this is the amount sent. For fixed, this is the amount received.
curl -X POST https://eagleswap.to/api/v1/quotes \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"originAssetId": "<btc_asset_id_from_assets>",
"destinationAssetId": "<eth_asset_id_from_assets>",
"swapType": "float",
"amount": "0.01"
}'curl -X POST https://eagleswap.to/api/v1/quotes \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"originAssetId": "<btc_asset_id_from_assets>",
"destinationAssetId": "<eth_asset_id_from_assets>",
"swapType": "fixed",
"amount": "0.25"
}'{
"quoteId": "<quote_id_from_quotes>",
"swapType": "float",
"input": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.01"
},
"output": {
"assetId": "<eth_asset_id_from_assets>",
"estimatedAmount": "0.2481"
},
"expiresAt": "2026-08-22T12:00:30.000Z",
"requirements": {
"recipientMemoRequired": false,
"refundAddressRequired": true,
"refundMemoRequired": false
}
}{
"quoteId": "<fixed_quote_id_from_quotes>",
"swapType": "fixed",
"input": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.0112"
},
"output": {
"assetId": "<eth_asset_id_from_assets>",
"estimatedAmount": "0.25"
},
"expiresAt": "2026-08-22T12:00:30.000Z",
"requirements": {
"recipientMemoRequired": false,
"refundAddressRequired": true,
"refundMemoRequired": false
}
}These are short-lived estimates, not a locked provider rate. Swap creation obtains a fresh execution quote and may choose another route. A float swap's output estimate or a fixed swap's required input may differ from the quote. Always display the created swap's payment instructions.
/api/v1/swapsCreate a swap
Turns an unexpired quote into payment instructions. Send a stable Idempotency-Key header for each intended order and retain it until the attempt is terminal. The execution price is refreshed, so read the returned payment amount rather than assuming it matches the quote.
Request body
quoteIdThe ID of the quote to use. The quote must not be expired.
recipientAddressThe address that receives the output asset.
refundAddressThe address that receives a refund on the origin network. Send it when requirements.refundAddressRequired is true.
recipientMemoA separate memo or tag for the recipient address. EagleSwap does not require it. If the memo is part of the address format, send the complete address instead.
refundMemoSend it when requirements.refundMemoRequired is true and you provide a refund address. Never send it without refundAddress.
externalOrderIdYour own order reference. If provided, it must be unique within your reseller account.
If a request times out, poll GET /api/v1/order-attempts/{idempotencyKey}. Reusing the key with a different body returns 409 IDEMPOTENCY_CONFLICT.
A new order returns 201, and a completed replay returns the original successful status and body. PROCESSING or RECOVERING returns 202 with Retry-After and Location. Poll that URL instead of repeatedly posting. A safely failed pre-creation attempt is marked FAILED and permits a controlled retry with the same key and body.
Replace the bracketed addresses with complete chain addresses. Bracketed values are placeholders, not valid addresses.
curl -X POST https://eagleswap.to/api/v1/swaps \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: order-9481-attempt-1" \
-H "Content-Type: application/json" \
-d '{
"quoteId": "<quote_id_from_quotes>",
"recipientAddress": "<complete_recipient_address>",
"refundAddress": "<complete_refund_address>",
"externalOrderId": "order-9481"
}'{
"orderId": "7k2m48p3x6",
"externalOrderId": "order-9481",
"swapType": "float",
"status": "AWAITING_PAYMENT",
"input": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.01"
},
"output": {
"assetId": "<eth_asset_id_from_assets>",
"estimatedAmount": "0.2481"
},
"payment": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.01",
"address": "<deposit_address>",
"expiresAt": "2026-08-22T12:30:00.000Z"
},
"fee": {
"totalFeeBps": 40,
"includedInRate": false
},
"createdAt": "2026-08-22T12:00:12.000Z",
"updatedAt": "2026-08-22T12:00:12.000Z"
}Show the payment object as-is
The customer must send the full payment.amount to payment.address by payment.expiresAt when provided. A fixed swap may require more input than its earlier quote showed. If payment.memo is present, show it beside the address—it is part of the deposit instructions.
/api/v1/swaps/{orderId}Check a swap
Poll with the exact API credential that created the swap. Another credential for the same reseller account cannot access it. We recommend every 10–15 seconds while a swap is active. Unknown orders and orders owned by another credential both return the same 404 response.
curl https://eagleswap.to/api/v1/swaps/7k2m48p3x6 \
-H "Authorization: Bearer YOUR_API_KEY"{
"orderId": "7k2m48p3x6",
"externalOrderId": "order-9481",
"swapType": "float",
"status": "PAYMENT_RECEIVED",
"input": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.01"
},
"output": {
"assetId": "<eth_asset_id_from_assets>",
"estimatedAmount": null
},
"payment": {
"assetId": "<btc_asset_id_from_assets>",
"amount": "0.01",
"address": "<deposit_address>",
"expiresAt": "2026-08-22T12:30:00.000Z"
},
"fee": {
"totalFeeBps": 40,
"includedInRate": false
},
"transactions": {
"inputTxId": "<input_transaction_id>"
},
"createdAt": "2026-08-22T12:00:12.000Z",
"updatedAt": "2026-08-22T12:04:00.000Z"
}The full swap object is returned on each check. output.estimatedAmount can temporarily be null after a deposit while the revised output is being calculated; do not show the old estimate as final. transactions and its individual transaction IDs appear only when known. The payment deadline is route-dependent; use the returned payment.expiresAt when present.
/api/v1/order-attempts/{idempotencyKey}Check order creation
Use this endpoint after a create request returns 202 or the connection is lost. Active attempts return 202 and Retry-After; terminal attempts return 200. A completed attempt includes the original API response in response.
curl https://eagleswap.to/api/v1/order-attempts/order-9481-attempt-1 \
-H "Authorization: Bearer YOUR_API_KEY"{
"idempotencyKey": "order-9481-attempt-1",
"internalOrderId": "swap_9b6b15b29e8d4a709db971480e5e994c",
"state": "RECOVERING",
"retryable": false,
"createdAt": "2026-08-22T12:00:12.000Z",
"updatedAt": "2026-08-22T12:00:17.000Z",
"lastRecoveryAttemptAt": "2026-08-22T12:00:17.000Z"
}AWAITING_PAYMENTWaiting for the customer depositPAYMENT_RECEIVEDDeposit seen on-chainINCOMPLETE_DEPOSITDeposit seen, but below the required amountPROCESSINGSwap is being executedCOMPLETEDOutput transaction sentREFUNDEDInput returned to the refund addressFAILEDSwap stopped and could not completeEXPIREDPayment window closedStop polling at COMPLETED, REFUNDED, FAILED, or EXPIRED. Transaction IDs appear in transactions as they become known.
Errors
One predictable error shape
Log the request ID on your server. It gives support a reliable way to trace a failed call without exposing customer data.
{
"error": {
"code": "QUOTE_EXPIRED",
"message": "Quote expired or unavailable",
"requestId": "request_4af127b83c9d46e5a021f79863bc80db"
}
}| HTTP | Code | What it means |
|---|---|---|
| 400 | INVALID_REQUEST | The JSON body, request shape, or identifier format is invalid. |
| 401 | AUTHENTICATION_REQUIRED | No bearer key was provided. |
| 401 | INVALID_API_KEY | The bearer key is not valid. |
| 403 | ACCOUNT_SUSPENDED | The reseller account is not available. |
| 404 | API_DISABLED | The reseller API is not available. |
| 404 | NOT_FOUND | The swap was not found for this credential. |
| 409 | IDEMPOTENCY_CONFLICT | The key or external order ID was already used. |
| 410 | QUOTE_EXPIRED | The quote expired or does not belong to this credential. |
| 422 | INVALID_REQUEST | A quote amount is invalid, out of range, or has too many decimal places. |
| 422 | INVALID_ASSET | The asset or pair is not supported. |
| 422 | INVALID_ADDRESS | A recipient or refund address is invalid. |
| 422 | INVALID_MEMO | A required memo is missing or cannot be used. |
| 429 | RATE_LIMITED | The request limit was reached. |
| 500 | INTERNAL_ERROR | The request failed unexpectedly. |
| 503 | INTERNAL_ERROR | A required internal service is temporarily unavailable. |
| 503 | QUOTE_UNAVAILABLE | A quote could not be produced right now. |
| 503 | SWAP_UNAVAILABLE | The swap could not be created right now. |
| 503 | STATUS_UNAVAILABLE | The latest swap status could not be fetched. |
Rate limits
Per-credential limits, per minute
Shared global and concurrency limits may also return 429 before your credential reaches its allowance. A 429 response includes a Retry-After header in seconds. Back off for that long before trying again.
Ready to build?
API access is available to approved reseller accounts.