API docs for embedded crypto swaps
Authenticate with an API key, request a quote, assemble the transaction, and keep your own UI and wallet flow.
Check service health and version.
Inspect the authenticated partner account, environments, launch readiness, and API settings.
Request a monetized quote with partner attribution and fee logic applied.
Build the transaction payload for the returned path ID.
Use your own UI, call the quote and assemble endpoints, and control the full experience.
Start from a ready-made swap module and reskin it into your product quickly.
Use a branded external swap page while your engineering team finishes the deeper integration.
Begin from templates tailored to AI agents, trading tools, rebalance apps, and treasury workflows.
curl "https://www.swapifie.com/api/v1/account" \
-H "x-api-key: sk_swapifie_your_key_here"curl -X POST "https://www.swapifie.com/api/v1/quote" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_swapifie_your_key_here" \
-d '{
"chainId": 8453,
"userAddr": "0xYourUserWallet",
"slippageLimitPercent": 0.5,
"inputTokens": [
{ "tokenAddress": "0x0000000000000000000000000000000000000000", "amount": "10000000000000000" }
],
"outputTokens": [
{ "tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "proportion": 1 }
]
}'curl -X POST "https://www.swapifie.com/api/v1/assemble" \
-H "Content-Type: application/json" \
-H "x-api-key: sk_swapifie_your_key_here" \
-d '{
"userAddr": "0xYourUserWallet",
"pathId": "quote_path_id_here",
"simulate": false
}'import { SwapifieClient } from "@/lib/swapifie-client";
const client = new SwapifieClient({
apiKey: process.env.SWAPIFIE_API_KEY!,
baseUrl: "https://www.swapifie.com",
});
const { quote, monetization } = await client.quote({
chainId: 8453,
userAddr: "0xYourUserWallet",
slippageLimitPercent: 0.5,
inputTokens: [
{ tokenAddress: "0x0000000000000000000000000000000000000000", amount: "10000000000000000" }
],
outputTokens: [
{ tokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", proportion: 1 }
]
});
const assembled = await client.assemble({
userAddr: "0xYourUserWallet",
pathId: quote.pathId,
simulate: false,
});import requests
headers = {
"Content-Type": "application/json",
"x-api-key": "sk_swapifie_your_key_here",
}
payload = {
"chainId": 8453,
"userAddr": "0xYourUserWallet",
"slippageLimitPercent": 0.5,
"inputTokens": [
{"tokenAddress": "0x0000000000000000000000000000000000000000", "amount": "10000000000000000"}
],
"outputTokens": [
{"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "proportion": 1}
],
}
quote = requests.post(
"https://www.swapifie.com/api/v1/quote",
json=payload,
headers=headers,
).json()$headers = @{
"Content-Type" = "application/json"
"x-api-key" = "sk_swapifie_your_key_here"
}
$body = @'
{
"chainId": 8453,
"userAddr": "0xYourUserWallet",
"slippageLimitPercent": 0.5,
"inputTokens": [
{
"tokenAddress": "0x0000000000000000000000000000000000000000",
"amount": "10000000000000000"
}
],
"outputTokens": [
{
"tokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"proportion": 1
}
]
}
'@
$quote = Invoke-RestMethod -Uri "https://www.swapifie.com/api/v1/quote" -Method POST -Headers $headers -Body $body
$quote.quote.pathId- Use your own UI and wallet orchestration. Swapifie is the quote and transaction layer underneath.
- Fee settings and rev-share configuration are applied server-side from the partner account.
- Use sandbox and production keys separately so testing, analytics, and revokes stay organized.
- Always persist your own client-side correlation IDs if you want to match product events to API calls.
- Use `/api/v1/account` to confirm the API key and partner configuration in your integration tests.
- Raw API keys are only shown once when they are generated. Copy them immediately and store them in your secret manager.
- The portal stores only a hashed version of each key, so Swapifie cannot re-display a raw key later.
- If a key is lost, rotate or generate a new one instead of trying to recover it.
See a simple embedded example using the same quote and assemble endpoints you would call from your own app.
Use these links for API directories, Postman imports, and programmatic developer discovery.
- Run the SQL in
supabase/schema.sqlinside Supabase SQL Editor to move platform persistence onto the free hosted Postgres tier. - Add
SUPABASE_URLandSUPABASE_SERVICE_ROLE_KEYto.env.local. If they are not set, Swapifie falls back to local JSON storage for development. - Add
NEXT_PUBLIC_TURNSTILE_SITE_KEYandTURNSTILE_SECRET_KEYto enable Cloudflare Turnstile on email auth forms.