Allways Access / Developersv1Get your API key
Endpoints

GET/v1/rates

What one received amount costs in every currency, in one call. Open: no key needed. A rate is not a lock; create locks it.

Request

GET /v1/rates with the currency you receive and how much of it.

NameRequiredRule
toyesCurrency id to receive
toAmountyesDesired net decimal amount in to units
fromnoComma-separated currency ids to price, at most the number that pay into to. Omit it to price every currency that pays into to
Requestcurl
curl "$API/v1/rates?to=tao&toAmount=0.1"

Response

One entry per currency. Each entry has a quote or an error, never both. A quote is the GET /v1/rate response for from, to and toAmount. An error is the body GET /v1/rate returns for that pair.

FieldMeaning
fromThe currency priced
quoteWhat you send in from to receive toAmount, or null
errorWhy from cannot pay toAmount right now, or null
Responsejson
[
  {
    "from": "sol",
    "quote": {
      "from": "sol",
      "to": "tao",
      "fromAmount": "0.0128",
      "toAmount": "0.1",
      "rate": "7.824",
      "minFromAmount": "0.01",
      "maxFromAmount": "40",
      "levels": [{ "rate": "7.824", "maxFromAmount": "40" }]
    },
    "error": null
  },
  {
    "from": "btc",
    "quote": null,
    "error": {
      "code": "amount_too_low",
      "message": "the minimum is 0.0001 BTC",
      "minFromAmount": "0.0001",
      "maxFromAmount": "0.5"
    }
  }
]

Errors

These fail the whole call. A miss for one currency is an entry error instead.

HTTPCodeExtra fieldsWhen
400invalid_pair—to is missing, or nothing pays into it
400invalid_amount—toAmount is not a positive decimal string
400validationfieldfrom lists more currencies than pay into to
429rate_limitedretryAfterOver the limit; see Rate limits

Notes

  • Use it to show a price beside every currency a payer can pick, as the Checkout widget does. Call GET /v1/rate for one pair as the payer types.
  • A currency in from that does not pair with to gets an invalid_pair entry error.
  • The receive currency itself is not listed: paying in it costs toAmount.