Bancor provides public API methods which take HTTPS requests and return JSON.
Please note that making more than 6 calls per second to the public API, or repeatedly and needlessly fetching excessive amounts of data, can result in your IP being banned.
What is the “Conversion Path” API?
At the heart of the Bancor Protocol is Bancor's conversion functionality. This unique feature allows you to convert any token to any token in a single and simple action.
When building a "quickConvert" transaction directly on the blockchain, you will need to pass an array of addresses that indicate the path between two defined tokens. For ease of use, the conversionPath API will allow you to check the array to use instead of identifying this from the blockchain.
Basic URL format:
This API call requires you to pass the two tokens you would like to convert in the following way:
Indicate the FromToken in the following ways:
- fromCurrencyCode - Pass the code of the token in our system. Example: ETH, BNT, DAI, EOS
- fromCurrencyID - Pass the bancor identifier of the token. Example: 5c9a078447a87f2e3cf108b1
Indicate the ToToken in the following ways:
- toCurrencyCode - Pass the code of the token in our system. Example: ETH, BNT, DAI, EOS
- toCurrencyID - Pass the bancor identifier of the token. Example: 5c9a078447a87f2e3cf108b1
How to use this response data?
Use the response data (array of addresses) when following the process outlined here.