API Documentation

This document details how to use our API system and provides examples for all requests. All methods could be used both via the clearnet link trocador.app or via the onion address. All methods are GET, and you just need to include your api_key or referral code to get responses from the server. Follow these steps to start using it:


  • Download the list of all coins from the server using the COINS method. You only need to do this once. You'll need to use both the ticker and the network of each coin to make the other requests, because there are coins on different networks that have the same ticker (e.g. Matic ERC20 and Polygon). Save these coins in your database.
  • Generate new quotes by sending the parameters along the GET method NEW_RATE. You need to specify both coins' tickers and networks to successfully generate rates, as well as the amount.
  • Use the rate ID provided along the rates to create a new transaction using the NEW_TRADE method. You must inform the chosen exchange and rate type (floating or fixed). In case you want to create a fixed rate payment, send also that variable via API request.
  • Pass the data to the user, so he can send his coins to the provider address.
  • Endpoints:
    • Regular: https://trocador.app/api/
    • Onion: http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/
    • I2P: trocador.i2p/api/
  • This method returns all coins listed in our database, with their names, tickers, networks and minimum and maximum amounts. You can use this method to populate your database, and you must use these tickers and networks when creating transactions.


    • Parameters:
      - api_key: your api key (Mandatory);

    • Examples:
      - https://trocador.app/api/coins
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/coins
      - trocador.i2p/api/coins

    • Results:
      - name: name of the coin;
      - ticker: ticker of the coin;
      - network: network of the coin;
      - memo: whether the coin uses memo/ExtraID. True or False;
      - image: icon of the coin;
      - minimum: minimum amount that can be traded;
      - maximum: maximum amount that can be traded;
  • This method returns all data from the coins that have the specified name or ticker. In case multiple coins have the same ticker, the method returns a list with all of them. At least one ticker or name is mandatory.


    • Parameters:
      - ticker: the ticker of the coin you want to retrieve, e.g. btc (Optional);
      - name: the name of the coin you want to retrieve, e.g. Bitcoin (Optional);
      - api_key: your api key (Mandatory);

    • Examples:
      - https://trocador.app/api/coin?ticker=btc
      - https://trocador.app/api/coin?name=Bitcoin
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/coin?ticker=btc
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/coin?name=Bitcoin
      - trocador.i2p/api/coin?ticker=btc
      - trocador.i2p/api/coin?name=Bitcoin

    • Results:
      - name: name of the coin;
      - ticker: ticker of the coin;
      - network: network of the coin;
      - memo: whether the coin uses memo/ExtraID. True or False;
      - image: icon of the coin;
      - minimum: minimum amount to be traded;
      - maximum: maximum amount to be traded;
  • This method returns all non-deleted trades from the partner on our database, or an specific transaction that has the ID provided on the request. This can be used to show the user the updated transaction status. This is only possible if the transaction data is still stored in our database. After 14 days, or on user request, transaction data is deleted to protect the user's privacy.


    • Parameters:
      - id: the transaction identification string or number (Optional);
      - api_key: your api key (Mandatory);

    • Examples:
      - https://trocador.app/api/trade?api_key=APIKEY
      - https://trocador.app/api/trade?api_key=APIKEY&id=ID
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/trade?api_key=APIKEY
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/trade?api_key=APIKEY&id=ID
      - trocador.i2p/api/trade?api_key=APIKEY
      - trocador.i2p/api/trade?api_key=APIKEY&id=ID

    • Results:
      - trade_id: the trade ID with us;
      - date: date and time of creation;
      - ticker_from: ticker of the coin to be sold;
      - ticker_to: ticker of the coin to be bought;
      - coin_from: name of coin to be sold;
      - coin_to: name of coin to be bought;
      - network_from: network of coin to be sold;
      - network_to: network of coin to be bought;
      - amount_from: amount of coin to be sold;
      - amount_to: amount of coin to be bought;
      - provider: chosen exchange;
      - fixed: True if fixed rate or False if floating rate;
      - status: status of the trade;
      - address_provider: address of the exchange;
      - address_provider_memo: memo/ExtraID of the address of the exchange;
      - address_user: address to receive the coins bought;
      - address_user_memo: memo/ExtraID of the address to receive the coins bought;
      - refund_address: address in which to receive a refund if needed;
      - refund_address_memo: memo/ExtraID of the address in which to receive a refund if needed;
      - password: password used together with the id_provider in order to see the transaction on the exchange's website, only used by some providers;
      - id_provider: the trade ID with the provider;
      - quotes:
       support: support data of the exchange;
       expiresAt: time and date when the swap expires;
      - details:
       hashout: hash of the payment transaction. Only available when the trade is finished;
      - payment: True or False, depending if it is a standard swap or payment;
  • This method checks if a given address can be used with a certain coin. If you don't want to check every address there's no need to, since the system always performs this check before creating a transaction. This function returns True or False depending on if the provided address fits the given coin and network.


    • Parameters:
      - ticker: the ticker of the coin you want to test, e.g. btc (Mandatory);
      - network: the network of the coin you want to test, e.g. Mainnet (Mandatory);
      - address: the address of the coin you want to test (Mandatory);
      - api_key: your api key (Mandatory);

    • Examples:
      - https://trocador.app/api/validateaddress?api_key=&ticker=&network=&address=
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/validateaddress?api_key=&ticker=&network=&address=
      - trocador.i2p/api/validateaddress?api_key=&ticker=&network=&address=

    • Results:
      - result: True if the address is valid or False if not;
  • This method generates a list of rates from all providers and organizes them from best to worst rate. Along with the rates goes the KYC Score of each exchange, from A (no KYC) to D (may hold user's funds indefinitely until verification). This method returns a unique ID that you must use if you want to create a transaction.


    • Parameters:
      - ticker_from: the ticker of the coin you want to sell, e.g. btc (Mandatory);
      - network_from: the network of the coin you want to sell, e.g. Mainnet (Mandatory);
      - ticker_to: the ticker of the coin you want to buy, e.g. xmr (Mandatory);
      - network_to: the network of the coin you want to buy, e.g. Mainnet (Mandatory);
      - amount_from or amount_to: the amount of the coin you want to sell or receive (amount_from is Mandatory for standard swaps, while amount_to is Mandatory for payments);
      - api_key: your api key (Mandatory);
      - payment: True or False, depending if you want to create a fixed rate payment or standard swap (Optional);
      - min_kycrating: if you want to rate a coin only on exchanges with a minimum of A, B, C or D KYC rating, please provide this parameter (Optional);
      - min_logpolicy: if you want to rate a coin only on exchanges with a minimum of A, B or C log policy rating, please provide this parameter (Optional);
      - markup: we allow partners to specify their own commission, in percentage (Optional); it must be either 0, 1, 1.85 or 3 (as a %); if the partner provide markup=0 or doesnt provide this parameter at all, then Trocador will share half of its commission with the partner; be aware that by setting markup > 0 the final user will be offered higher rates, so prices will increase from those offered on Trocador;
      - best_only: if you only want to know the best rate for the provided parameters, provide True (Optional);

    • Examples:
      - https://trocador.app/api/new_rate?api_key=&ticker_from=&ticker_to=&network_from=&network_to=&amount_from=
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/new_rate?api_key=&ticker_from=&ticker_to=&network_from=&network_to=&amount_from=
      - trocador.i2p/api/new_rate?api_key=&ticker_from=&ticker_to=&network_from=&network_to=&amount_from=

    • Results:
      - trade_id: the trade ID with us;
      - date: date and time of creation;
      - ticker_from: ticker of the coin to be sold;
      - ticker_to: ticker of the coin to be bought;
      - coin_from: name of coin to be sold;
      - coin_to: name of coin to be bought;
      - network_from: network of coin to be sold;
      - network_to: network of coin to be bought;
      - amount_from: amount of coin to be sold;
      - amount_to: amount of coin to be bought;
      - provider: exchange with the best rate;
      - fixed: rate type for the best rate, True for fixed and False for floating;
      - status: status of the trade;
      - quotes: list of all the other quotes generated, with their KYC rating and waste(spread) in percentage;
      - payment: True or False, depending if it is a standard swap or payment;
  • This method creates a transaction with the provided ID, on the selected exchange and rate type. It returns the address from the provider exchange, where the user must send his coins in order to receive the requested amount.


    • Parameters:
      - id: the ID number of the previously generated rate (Optional); if the partner does not provide ID of a previously generated new_rate method, then the transaction will be generated with the best rate found among the remaining parameters, as if it was created with the best_only parameter of the new_rate method;
      - ticker_from: the ticker of the coin you want to sell, e.g. btc (Mandatory);
      - network_from: the network of the coin you want to sell, e.g. Mainnet (Mandatory);
      - ticker_to: the ticker of the coin you want to buy, e.g. xmr (Mandatory);
      - network_to: the network of the coin you want to buy, e.g. Mainnet (Mandatory);
      - amount_from or amount_to: the amount of the coin you want to sell or receive (amount_from is Mandatory for standard swaps, while amount_to is Mandatory for payments);
      - address: the address where the user wants to receive his coins (Mandatory);
      - address_memo: the memo/ExtraID of the address where the user wants to receive his coins (Mandatory if the coin received uses memo/ExtraID - Use '0' for no memo);
      - refund: the address where the user wants to receive back his coins in case a problem occurs (Optional);
      - refund_memo: the memo/ExtraID of the address where the user wants to receive back his coins in case a problem occurs (Mandatory if refund is used and the coin sent uses memo/ExtraID - Use '0' for no memo);
      - provider: the desired exchange (Mandatory);
      - fixed: True for fixed rate or False for floating rate (Mandatory);
      - api_key: your api key (Mandatory);
      - payment: True or False, depending if you want to create a fixed rate payment or standard swap (Optional);
      - min_kycrating: if you want to rate a coin only on exchanges with a minimum of A, B, C or D KYC rating, please provide this parameter (Optional);
      - min_logpolicy: if you want to rate a coin only on exchanges with a minimum of A, B or C log policy rating, please provide this parameter (Optional);
      - webhook: if you provide an URL on this parameter, every time the status of the transaction changes, you will receive on this URL a POST request sending you the transaction data; this avoids having to call so many times our server to check the transaction status (Optional);
      - markup: we allow partners to specify their own commission, in percentage (Optional); it must be either 0, 1, 2 or 3%; if the partner provides markup=0 or doesn't provide this parameter at all, then Trocador will share half of its commission with the partner; be aware that by setting markup > 0 the final user will be offered higher rates, so prices will increase when compared to those offered on Trocador;

    • Examples:
      - https://trocador.app/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=
      - https://trocador.app/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=&refund=
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=
      - http://trocadorfyhlu27aefre5u7zri66gudtzdyelymftvr4yjwcxhfaqsid.onion/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=&refund=
      - trocador.i2p/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=
      - trocador.i2p/api/new_trade?api_key=&id=&ticker_from=&ticker_to=&network_to=&network_from=&amount_from=&address=&provider=&fixed=&refund=

    • Results:
      - trade_id: the trade ID with us;
      - date: date of creation;
      - ticker_from: ticker of the coin to be sold;
      - ticker_to: ticker of the coin to be bought;
      - coin_from: name of coin to be sold;
      - coin_to: name of coin to be bought;
      - network_from: network of coin to be sold;
      - network_to: network of coin to be bought;
      - amount_from: amount of coin to be sold;
      - amount_to: amount of coin to be bought;
      - provider: chosen exchange;
      - fixed: True if fixed rate or False if floating rate;
      - status: status of the trade;
      - address_provider: address of the exchange;
      - address_provider_memo: memo/ExtraID of the address of the exchange;
      - address_user: address to receive the coins bought;
      - address_user_memo: memo/ExtraID of the address to receive the coins bought;
      - refund_address: the address where the user wants to receive back his coins in case a problem occurs;
      - refund_address_memo: memo/ExtraID of the the address where the user wants to receive back his coins in case a problem occurs;
      - password: password used together with the id_provider in order to see the transaction on the exchange's website, only used by some providers;
      - id_provider: the trade ID with the provider;
      - payment: True or False, depending if it is a standard swap or payment;
  • These are all possible swap statuses you will find when calling Trocador API system.


    • - new: you have rates, but did not create the swap yet;
      - waiting: you created the swap but no deposit was detected;
      - confirming: deposit was detected and is yet to be confirmed;
      - sending: deposit confirmed and provider is sending the coins;
      - finished: there is already a payment hash to the user;
      - failed: something might have happened to the swap, please contact support;
      - expired: payment time expired;
      - halted: some issue happened with the swap, please contact support;
      - refunded: exchange claims to have refunded the user;