Request examples

Here you can find /routes and /quote cURL request examples for Bitcoin

Routes Request

Ethereum to Bitcoin

curl --request POST \
     --url https://li.quest/v1/advanced/routes \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "toTokenAddress": "bitcoin",
  "fromTokenAddress": "0x0000000000000000000000000000000000000000",
  "fromChainId": 1,
  "fromAmount": "500000000000000000",
  "toChainId": 20000000000001,
  "fromAddress": "YOUR_EVM_WALLET",
  "toAddress": "YOUR_BTC_WALLET"
}
'

Bitcoin to Etherum

curl --request POST \
     --url https://li.quest/v1/advanced/routes \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "toTokenAddress": "0x0000000000000000000000000000000000000000",
  "fromTokenAddress": "bitcoin",
  "fromChainId": 20000000000001,
  "fromAmount": "10000000",
  "toChainId": 1,
  "fromAddress": "YOUR_BTC_WALLET",
  "toAddress": "YOUR_EVM_WALLET"
}
'

Bitcoin to Binance Smart Chain

curl --request POST \
     --url https://li.quest/v1/advanced/routes \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "toTokenAddress": "0x0000000000000000000000000000000000000000",
  "fromTokenAddress": "bitcoin",
  "fromChainId": 20000000000001,
  "fromAmount": "500000",
  "toChainId": 56,
  "fromAddress": "YOUR_BTC_WALLET",
  "toAddress": "YOUR_EVM_WALLET"
}'

Quote Request

Ethereum to Bitcoin

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=1&toChain=20000000000001&fromToken=0x0000000000000000000000000000000000000000&toToken=bitcoin&fromAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&toAddress=bc1qmdpxhzarlxrygtvlxrkkl0eqguszkzqdgg4py5&fromAmount=500000000000000000' \
     --header 'accept: application/json'

Bitcoin to Etherum

curl --request GET \
     --url 'https://li.quest/v1/quote?fromAddress=bc1qmdpxhzarlxrygtvlxrkkl0eqguszkzqdgg4py5&fromAmount=500000&fromChain=BTC&fromToken=bitcoin&toAddress=0x39333638696578786b61393361726b63717a6773&toChain=1&toToken=0x0000000000000000000000000000000000000000' \
     --header 'accept: application/json'

Bitcoin to Binance Smart Chain

curl --request GET \
     --url 'https://li.quest/v1/quote?fromChain=20000000000001&toChain=56&fromToken=bitcoin&toToken=0x0000000000000000000000000000000000000000&fromAddress=bc1qmdpxhzarlxrygtvlxrkkl0eqguszkzqdgg4py5&toAddress=0x552008c0f6870c2f77e5cC1d2eb9bdff03e30Ea0&fromAmount=500000' \
     --header 'accept: application/json'

Last updated