Descarga la App Descargar ahora →
API

Exchange API

Exchange API calculates fiat-to-crypto or crypto-to-fiat amounts with all fees included.

Fiat to Crypto Estimation

This method estimates the amount of cryptocurrency you'll receive for a specific fiat payment, based on current market rates and fully accounting for commissions and all associated fees. In other words, if you pay exactly X in fiat, you'll receive the precise crypto amount displayed, with all costs already factored in.

For instance, if you convert 1,000 EUR, the method could return an approximation of 0.3 ETH.

To call the API, it is essential to include the x-api-key header.

If the paymentMethod parameter is specified, the method returns the cryptoAmount that you will receive after applying all fees, including those specific to the selected payment method. Otherwise, it returns cryptoAmounts for all available payment methods, each reflecting the net amount of crypto you would receive after all applicable fees.

GEThttps://api.ahoracrypto.com/payment/estimate-fiat-to-crypto-exchange

Query parameters

ParameterType
fiatAmountnumber
currencyIsoCodestring
cryptoSymbolstring
paymentMethodstring

Header parameters

ParameterTypeDescription
x-api-keystringAPI key for authentication

Responses

fiatAmountnumber · doublerequired

Amount in fiat currency

currencyIsoCodestringrequired

Fiat currency ISO code (e.g., USD, EUR)

cryptoAmountnumber · doubleoptional

Estimated amount in cryptocurrency (if a payment method is specified)

cryptoAmountsarrayoptional

Estimated amounts in cryptocurrency for each payment method (if no payment method is specified)

cryptoSymbolstringrequired

Cryptocurrency symbol (e.g., USDT, BTC)

400Bad request - Missing required fields or invalid values
401Unauthorized - Missing or invalid API key
500Internal Server Error

HTTP request

http
GET /payment/estimate-fiat-to-crypto-exchange?fiatAmount=1&currencyIsoCode=text&cryptoSymbol=text HTTP/1.1
Host: api.ahoracrypto.com
x-api-key: text
Accept: */*

Response

200 -Estimate crypto amount based on fiat amount

json
{
  "fiatAmount": 1,
  "currencyIsoCode": "text",
  "cryptoAmount": 1,
  "cryptoAmounts": [],
  "cryptoSymbol": "text"
}

Example response when a payment method is specified:

json
{
    "cryptoSymbol": "BTC",
    "cryptoAmount": 0.00090935,
    "fiatAmount": 100,
    "currencyIsoCode": "EUR"
}

Example response when no payment method is specified:

json
{
    "cryptoSymbol": "BTC",
    "cryptoAmounts": {
        "bank-transfer": 0.00091621,
        "apple-pay": 0.0009066,
        "google-pay": 0.0009066,
        "card": 0.0009066
    },
    "fiatAmount": 100,
    "currencyIsoCode": "EUR"
}

Crypto to Fiat Estimation

This method calculates the precise fiat amount required to receive the exact specified amount of cryptocurrency, fully accounting for all fees and commissions. In other words, the fiat amount you see is the total payment needed to cover the exact crypto amount you want, with all costs already included.

For example, if you input a crypto amount such as 0.5 BTC, the method might return an estimate of around 25,000 USD.

It is important to note that the exchange rate already includes any fees that AhoraCrypto may apply, so it reflects the final rate the user will receive.

To call the API, it is essential to include the x-api-key header.

If the paymentMethod parameter is specified, the method returns the fiatAmount you need to pay, including all fees - also those specific to the selected payment method. Otherwise, it returns fiatAmounts for all available payment methods, each reflecting the total amount you'd need to pay with all applicable fees included.

GEThttps://api.ahoracrypto.com/payment/estimate-crypto-to-fiat-exchange

Query parameters

ParameterType
cryptoAmountnumber
cryptoSymbolstring
currencyIsoCodestring
paymentMethodstring

Header parameters

ParameterTypeDescription
x-api-keystringAPI key for authentication

Responses

cryptoAmountnumber · doublerequired

Amount in cryptocurrency

cryptoSymbolstringrequired

Cryptocurrency code (e.g., USDT, BTC)

fiatAmountnumber · doubleoptional

Estimated amount in fiat currency (if a payment method is specified)

fiatAmountsarrayoptional

Estimated amounts in fiat currency for each payment method (if no payment method is specified)

currencyIsoCodestringrequired

Fiat currency ISO code (e.g., USD, EUR)

400Bad request - Missing required fields or invalid values
401Unauthorized - Missing or invalid API key
500Internal Server Error

HTTP request

http
GET /payment/estimate-crypto-to-fiat-exchange?cryptoAmount=1&cryptoSymbol=text&currencyIsoCode=text HTTP/1.1
Host: api.ahoracrypto.com
x-api-key: text
Accept: */*

Response

200 -Estimate fiat amount based on crypto amount

json
{
  "cryptoAmount": 1,
  "cryptoSymbol": "text",
  "fiatAmount": 1,
  "fiatAmounts": [],
  "currencyIsoCode": "text"
}

Example response when a payment method is specified:

json
{
    "cryptoSymbol": "BTC",
    "cryptoAmount": 0.00091734,
    "fiatAmount": 100,
    "currencyIsoCode": "EUR"
}

Example response when no payment method is specified:

json
{
    "cryptoSymbol": "BTC",
    "cryptoAmount": 0.00091734,
    "fiatAmounts": {
        "bank-transfer": 100,
        "apple-pay": 100.95,
        "google-pay": 100.95,
        "card": 100.95
    },
    "currencyIsoCode": "EUR"
}