API Documentation
ShapeShift is primarily intended to be used as an API.
For any of the api calls if there is a problem the error message will be returned as the following JSON:
{error:"Error message"}
Many of the requests require a 'coin pair'. A coin pair is of the format deposit_withdrawal. Example: 'btc_ltc'. Valid pairs are any combination of the below listed valid coins.* The list will grow as we add more:
btc, ltc, ppc, drk, doge, nmc, ftc, blk, nxt, btcd, qrk, rdd, nbt, bts, bitusd, xcp, xmr
* If a particular coin goes offline any pairs using it will return a message stating that pair is temporarily unavailable.
All requests are only available via HTTPS, in the interest of security best practices we do not support API calls over HTTP.
Get Requests
Gets the current rate offered by Shapeshift. This is an estimate because the rate can occasionally change rapidly depending on the markets. The rate is also a 'use-able' rate not a direct market rate. Meaning multiplying your input coin amount times the rate should give you a close approximation of what will be sent out. This rate does not include the transaction (miner) fee taken off every transaction.
url: shapeshift.io/rate/[pair]
method: GET
[pair] is any valid coin pair such as btc_ltc or ltc_btc
Success Output:
{
"pair" : "btc_ltc",
"rate" : "70.1234"
}
url: shapeshift.io/limit/[pair]
method: GET
[pair] is any valid coin pair such as btc_ltc or ltc_btc
Success Output:
{
"pair" : "btc_ltc",
"limit" : "1.2345"
}
url: shapeshift.io/marketinfo/[pair]
method: GET
[pair] (OPTIONAL) is any valid coin pair such as btc_ltc or ltc_btc.
The pair is not required and if not specified will return an array of all market infos.
Success Output:
{
"pair" : "btc_ltc",
"rate" : 130.12345678,
"limit" : 1.2345,
"min" : 0.02621232,
"minerFee" : 0.0001
}
url: shapeshift.io/recenttx/[max]
method: GET
[max] is an optional maximum number of transactions to return.
If [max] is not specified this will return 5 transactions.
Also, [max] must be a number between 1 and 50 (inclusive).
Success Output:
[
{
curIn : [currency input],
curOut: [currency output],
amount: [amount],
timestamp: [time stamp] //in seconds
},
...
]
url: shapeshift.io/txStat/[address]
method: GET
[address] is the deposit address to look up.
Success Output: (various depending on status)
Status: No Deposits Received
{
status:"no_deposits",
address:[address] //matches address submitted
}
Status: Received (we see a new deposit but have not finished processing it)
{
status:"received",
address:[address] //matches address submitted
}
Status: Complete
{
status : "complete",
address: [address],
withdraw: [withdrawal address],
incomingCoin: [amount deposited],
incomingType: [coin type of deposit],
outgoingCoin: [amount sent to withdrawal address],
outgoingType: [coin type of withdrawal],
transaction: [transaction id of coin sent to withdrawal address]
}
Status: Failed
{
status : "failed",
error: [Text describing failure]
}
//Note: this can still get the normal style error returned. For example if request is made without an address.
url: shapeshift.io/timeremaining/[address]
method: GET
[address] is the deposit address to look up.
Success Output:
{
status:"pending",
seconds_remaining: 600
}
The status can be either "pending" or "expired".
If the status is expired then seconds_remaining will show 0.
url: shapeshift.io/getcoins
method: GET
Success Output:
{
"SYMBOL1" :
{
name: ["Currency Formal Name"],
symbol: <"SYMBOL1">,
image: ["https://shapeshift.io/images/coins/coinName.png"],
status: [available / unavailable]
}
(one listing per supported currency)
}
The status can be either "available" or "unavailable". Sometimes coins become temporarily unavailable during updates or
unexpected service issues.
url: shapeshift.io/txbyapikey/[apiKey]
method: GET
[apiKey] is the affiliate's PRIVATE api key.
[
{
inputTXID: [Transaction ID of the input coin going into shapeshift],
inputAddress: [Address that the input coin was paid to for this shift],
inputCurrency: [Currency type of the input coin],
inputAmount: [Amount of input coin that was paid in on this shift],
outputTXID: [Transaction ID of the output coin going out to user],
outputAddress: [Address that the output coin was sent to for this shift],
outputCurrency: [Currency type of the output coin],
outputAmount: [Amount of output coin that was paid out on this shift],
shiftRate: [The effective rate the user got on this shift.],
status: [status of the shift]
}
(one listing per transaction returned)
]
The status can be "received", "complete", "returned", "failed".
url: shapeshift.io/txbyaddress/[address]/[apiKey]
method: GET
[address] the address that output coin was sent to for the shift
[apiKey] is the affiliate's PRIVATE api key.
Success Output:
[
{
inputTXID: [Transaction ID of the input coin going into shapeshift],
inputAddress: [Address that the input coin was paid to for this shift],
inputCurrency: [Currency type of the input coin],
inputAmount: [Amount of input coin that was paid in on this shift],
outputTXID: [Transaction ID of the output coin going out to user],
outputAddress: [Address that the output coin was sent to for this shift],
outputCurrency: [Currency type of the output coin],
outputAmount: [Amount of output coin that was paid out on this shift],
shiftRate: [The effective rate the user got on this shift.],
status: [status of the shift]
}
(one listing per transaction returned)
]
The status can be "received", "complete", "returned", "failed".
url: shapeshift.io/validateAddress/[address]/[coinSymbol]
method: GET
[address] the address that the user wishes to validate
[coinSymbol] the currency symbol of the coin
Success Output:
{
isValid: [true / false],
error: [(if isvalid is false, there will be an error message)]
}
isValid will either be true or false. If isvalid returns false, an error parameter will be present and will contain a descriptive error message.
Post Requests
url: shapeshift.io/shift
method: POST
data type: JSON
data required:
withdrawal = the address for resulting coin to be sent to
pair = what coins are being exchanged in the form [input coin]_[output coin] ie btc_ltc
returnAddress = (Optional) address to return deposit to if anything goes wrong with exchange
destTag = (Optional) Destination tag that you want appended to a Ripple payment to you
rsAddress = (Optional) For new NXT accounts to be funded, you supply this on NXT payment to you
apiKey = (Optional) Your affiliate PUBLIC KEY, for volume tracking, affiliate payments, split-shifts, etc...
example data: {"withdrawal":"AAAAAAAAAAAAA", "pair":"btc_ltc", returnAddress:"BBBBBBBBBBB"}
Success Output:
{
deposit: [Deposit Address (or memo field if input coin is BTS / BITUSD)],
depositType: [Deposit Type (input coin symbol)],
withdrawal: [Withdrawal Address], //-- will match address submitted in post
withdrawalType: [Withdrawal Type (output coin symbol)],
public: [NXT RS-Address pubkey (if input coin is NXT)],
xrpDestTag : [xrpDestTag (if input coin is XRP)],
apiPubKey: [public API attached to this shift, if one was given]
}
url: shapeshift.io/mail
method: POST
data type: JSON
data required:
email = the address for receipt email to be sent to
txid = the transaction id of the transaction TO the user (ie the txid for the withdrawal NOT the deposit)
example data {"email":"[email protected]", "txid":"123ABC"}
Success Output:
{"email":
{
"status":"success",
"message":"Email receipt sent"
}
}
url: shapeshift.io/sendamount
method: POST
data type: JSON
//1. Send amount request
Data required:
amount = the amount to be sent to the withdrawal address
depositAmount = the amount to be sent to the deposit address
withdrawal = the address for coin to be sent to
pair = what coins are being exchanged in the form [input coin]_[output coin] ie ltc_btc
returnAddress = (Optional) address to return deposit to if anything goes wrong with exchange
destTag = (Optional) Destination tag that you want appended to a Ripple payment to you
rsAddress = (Optional) For new NXT accounts to be funded, supply this on NXT payment to you
apiKey = (Optional) Your affiliate PUBLIC KEY, for volume tracking, affiliate payments, split-shifts, etc...
example data {"amount":123, "withdrawal":"123ABC", "pair":"ltc_btc", returnAddress:"BBBBBBB"}
Success Output:
{
success:
{
pair: [pair],
withdrawal: [Withdrawal Address], //-- will match address submitted in post
withdrawalAmount: [Withdrawal Amount], // Amount of the output coin you will receive
deposit: [Deposit Address (or memo field if input coin is BTS / BITUSD)],
depositAmount: [Deposit Amount], // Exact amount of input coin to send in
expiration: [timestamp when this will expire],
quotedRate: [the exchange rate to be honored]
apiPubKey: [public API attached to this shift, if one was given]
}
}
//2. Quoted Price request
//Note : This request will only return information about a quoted rate
// This request will NOT generate the deposit address.
Data required:
amount = the amount to be sent to the withdrawal address
pair = what coins are being exchanged in the form [input coin]_[output coin] ie ltc_btc
example data {"amount":123, "pair":"ltc_btc"}
Success Output:
{
success:
{
pair: [pair],
withdrawalAmount: [Withdrawal Amount], // Amount of the output coin you will receive
depositAmount: [Deposit Amount], // Exact amount of input coin to send in
expiration: [timestamp when this will expire],
quotedRate: [the exchange rate to be honored]
minerFee: [miner fee for this transaction]
}
}
url: shapeshift.io/cancelpending
method: POST
data type: JSON
data required: address = The deposit address associated with the pending transaction
Example data : {address : "1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v"}
Success Output:
{ success : " Pending Transaction cancelled " }
Error Output:
{ error : {errorMessage} }