[ API reference ]
Trader swaps
Returns a trader's recent open and closed swaps with entry, exit, transfer and profit-and-loss information.
GET
/api/users/{handle}/swapsThis endpoint requires an API key using X-API-Key or Bearer authorization.
01
Request
curl
curl "https://getfomoapi.fun/api/users/{handle}/swaps" \
-H "X-API-Key: YOUR_API_KEY"02
Parameters
NameLocationTypeDescription
handlepathstringPublic Fomo trader handle. The leading @ character is optional.limitqueryintegerMaximum number of swaps to return. Accepted range is 1 to 150.03
Response fields
FieldTypeDescription
availablebooleanWhether captured position history is available for the trader.swapsarrayRecent open and closed swaps.swaps[].tradeIdstringUnique Fomo trade identifier.swaps[].tokenobjectToken symbol and address.swaps[].statusstringPosition status: open or closed.swaps[].amountnumberToken amount held or traded.swaps[].avgEntryPricenumber | nullAverage token entry price.swaps[].avgExitPricenumber | nullAverage token exit price.swaps[].realizedPnlUsdnumberRealized PnL in USD.swaps[].unrealizedPnlUsdnumberUnrealized PnL in USD.swaps[].costBasisUsdnumberPosition cost basis in USD.swaps[].boughtAmountnumberToken amount acquired by swaps.swaps[].soldAmountnumberToken amount sold through swaps.swaps[].transferredInAmountnumberToken amount received without a purchase.swaps[].transferredOutAmountnumberToken amount sent without a sale.swaps[].avgTransferInPricenumber | nullAverage token price when transferred in.swaps[].avgTransferOutPricenumber | nullAverage token price when transferred out.swaps[].priceUsdnumberCurrent token price in USD.swaps[].createdAtstringPosition creation time.swaps[].closedAtstring | nullPosition closing time, or null when open.04
JSON response
A successful request returns the following response structure.
response.json
{
"available": true,
"swaps": [
{
"tradeId": "9e994c1a-0ec5-47ae-a8df-f0c5cb6ad123",
"token": {
"symbol": "SOL",
"address": "So11111111111111111111111111111111111111112"
},
"status": "open",
"amount": 125.42,
"avgEntryPrice": 145.32,
"avgExitPrice": null,
"realizedPnlUsd": 0,
"unrealizedPnlUsd": 6387.64,
"costBasisUsd": 18225.03,
"boughtAmount": 120,
"soldAmount": 0,
"transferredInAmount": 5.42,
"transferredOutAmount": 0,
"avgTransferInPrice": 151.20,
"avgTransferOutPrice": null,
"priceUsd": 196.25,
"createdAt": "2026-07-12T14:20:00Z",
"closedAt": null
}
]
}Rate limits and retry
Pro keys allow 5 requests per second. On a 429 response, wait for the Retry-After value before retrying.