This section explains the process of integration of the SimpleSwap API and how it works.
API, or Application Programming Interface, is one of the tools of the SimpleSwap Affiliate Program. Our Partners can integrate this application into their websites (for example, crypto services, payment systems, etc.).
They receive rewards in USDT for crypto and fiat exchanges done through the API.
The process of integrating our API into your website is simple, just follow these steps:
Create an account with our Affiliate Program.
Choose API / DeFi API in the Web Tools section in your account.
Create a key by clicking on the Add New button. You can create several keys and customize your profit for crypto exchanges by choosing the fee. It is 0.4% by default, but you can make it higher. Please note that it will affect the exchange rate. Find out more in the customizable reward guide.
Embed your API key to your website's backend:
curl -X 'GET' \ 'https://api.simpleswap.io/v3/currencies/btc/btc' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
Please note that API keys for fiat and crypto exchanges differ, and the fee for fiat exchanges (0.4%) cannot be customized.
After you get SimpleSwap API up and running, you can check the statistics related to its performance in your Affiliate account.
Once your reward for finished exchanges made by the users of your website surpasses 300 USDT, you can go to the Payouts section and click the Withdraw button.
Through our API, a person who visits your website can swap crypto or fiat currencies on the spot, without having to visit our website.
What is more, you can also make requests to our service through API commands to do the following:
Get currency information:
a. Information about a specific currency. In your request, send the currency, specifying ticker and network in path-parameters: curl -X 'GET' \ 'https://api.simpleswap.io/v3/currencies/btc/btc' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
b. List of all available currencies: curl -X 'GET' \ 'https://api.simpleswap.io/v3/currencies' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
Get the information on pairs
a. List of all available pairs for a specific currency: curl -X 'GET' \ 'https://api.simpleswap.io/v3/pairs/btc/btc?fixed=false' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
b. List of all available pairs: curl -X 'GET' \ 'https://api.simpleswap.io/v3/pairs?fixed=false' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
Get an estimated exchange amount. To receive an estimate, send a request with the currencies you’d like to send and receive as query parameters. Specify the following: tickers, networks, and the exchange amount (the amount you want to send). The API will return the estimated amount you’ll receive: curl -X 'GET' \ 'https://api.simpleswap.io/v3/estimates?fixed=false&tickerFrom=btc&tickerTo=eth&networkFrom=btc&networkTo=eth&reverse=false&amount=0.2' \ -H 'accept: application/json' \ -H 'x-api-key: 470560ec-2a89-47f3-bb7d-156d79f0e824'
Get the minimum and maximum exchange amounts. To see the exchange limits for a given pair, specify the currencies in the query parameters by including their tickers and networks: curl -X 'GET' \ 'https://api.simpleswap.io/v3/ranges?fixed=false&tickerFrom=btc&tickerTo=eth&networkFrom=btc&networkTo=eth&reverse=false' \ -H 'accept: application/json' \ -H 'x-api-key: 470560ec-2a89-47f3-bb7d-156d79f0e824'
Get the information about all exchanges made using your API-key (the type, currencies, amount, status, etc.) curl -X 'GET' \ 'https://api.simpleswap.io/v3/exchanges?limit=100&offset=0&startDate=2025-03-19T12%3A44%3A25.679Z&finishDate=2025-03-26T12%3A44%3A25.680Z' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f'
Get the information about a specific exchange by including its public identifier in the request: curl -X 'GET' \ 'https://api.simpleswap.io/v3/exchanges/1' \ -H 'accept: application/json' \ -H 'x-api-key: 470560ec-2a89-47f3-bb7d-156d79f0e824'
Check if it is possible to create an exchange with the given parameters. In the request, include the currencies you’d like to send and receive as query parameters. Specify their tickers, networks, and the exchange amount: curl -X 'GET' \ 'https://api.simpleswap.io/v3/exchanges/check?fixed=false&tickerFrom=btc&tickerTo=eth&amount=0.2&networkFrom=btc&networkTo=eth&reverse=false' \ -H 'accept: application/json' \ -H 'x-api-key: 470560ec-2a89-47f3-bb7d-156d79f0e824'
Create an exchange: curl -X 'POST' \ 'https://api.simpleswap.io/v3/exchanges' \ -H 'accept: application/json' \ -H 'x-api-key: a485207e-b456-4621-b01b-81eb2554904f' \
-H 'Content-Type: application/json' \
-d '{
"fixed": false,
"tickerFrom": "btc",
"tickerTo": "eth",
"amount": "0.2",
"networkFrom": "btc",
"networkTo": "eth",
"reverse": false,
"addressTo": "string",
"extraIdTo": "",
"userRefundAddress": "string",
"userRefundExtraId": "string",
"rateId": null,
"customFee": null
}'
You can find more about the requests, necessary parameters, and possible errors in our API documentation. To find detailed information about what each key from the answer means, click the Schema button in the upper left corner.
Let's look into a hypothetical example.
John has a popular blog about cryptocurrencies. He wants to provide his readers with a seamless way to swap cryptocurrencies directly on his website. Additionally, he is looking for a passive income stream. To achieve both goals, he decides to integrate the SimpleSwap API into his blog.
John begins by signing up for the SimpleSwap Affiliate Program.
After logging into his Affiliate account, John navigates to the Web Tools section and selects the API option. Here, he clicks on the Add New button to generate a unique API key.
John decides to customize the profit margin for crypto exchanges. He calculated that with a monthly volume of about 80,000 USDT, his profit on the default setting of a 0.4% fee would be 320 USDT per month. However, if he increases the fee to 0.6%, his potential income would increase to 480 USDT.
With the API key ready, John proceeds to embed it into his website's backend.
John decided to check the available fixed-rate pairs for Ethereum. He types in his API key, chooses "true" for the "fixed" parameter, types ETH in the "ticker" field and in the "network" field. However, he sees the 401 error. To see what it means, John opens up the API documentation, clicks on the Pairs section, then finds the meaning of this error (wrong API key). He comes back to check the API key field and sees that he did not copy the last two digits of the key. After fixing the request, he receives the list of all available pairs for Ethereum with a fixed rate.
Find out more about the errors you may encounter when working with API in this guide.
Share on: