Get a fiat-to-crypto quote
curl --request POST \
--url https://api.hypermid.io/v1/onramp/quote \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fiatAmount": 100,
"fiatCurrency": "USD",
"cryptoToken": "ETH",
"cryptoChain": "ethereum",
"walletAddress": "<string>",
"paymentMode": "card",
"userCountry": "US"
}
'import requests
url = "https://api.hypermid.io/v1/onramp/quote"
payload = {
"fiatAmount": 100,
"fiatCurrency": "USD",
"cryptoToken": "ETH",
"cryptoChain": "ethereum",
"walletAddress": "<string>",
"paymentMode": "card",
"userCountry": "US"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fiatAmount: 100,
fiatCurrency: 'USD',
cryptoToken: 'ETH',
cryptoChain: 'ethereum',
walletAddress: '<string>',
paymentMode: 'card',
userCountry: 'US'
})
};
fetch('https://api.hypermid.io/v1/onramp/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hypermid.io/v1/onramp/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fiatAmount' => 100,
'fiatCurrency' => 'USD',
'cryptoToken' => 'ETH',
'cryptoChain' => 'ethereum',
'walletAddress' => '<string>',
'paymentMode' => 'card',
'userCountry' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hypermid.io/v1/onramp/quote"
payload := strings.NewReader("{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hypermid.io/v1/onramp/quote")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/onramp/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"fiatCurrency": "USD",
"fiatAmount": 100,
"cryptoAsset": "ETH",
"chainId": 1,
"cryptoAmount": "0.029615",
"exchangeRate": 3376.65,
"fees": {
"networkFee": 2.50,
"processingFee": 3.49,
"partnerFee": 0.30,
"totalFee": 6.29
},
"totalFiatAmount": 106.29,
"paymentMethod": "credit_card",
"expiresAt": 1711234877
},
"error": null,
"meta": {
"requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
"timestamp": 1711234577,
"rateLimit": {
"limit": 2000,
"remaining": 1983,
"reset": 1711234627
}
}
}
On-Ramp
Get On-Ramp Quote
Get a fiat-to-crypto conversion quote
POST
/
v1
/
onramp
/
quote
Get a fiat-to-crypto quote
curl --request POST \
--url https://api.hypermid.io/v1/onramp/quote \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"fiatAmount": 100,
"fiatCurrency": "USD",
"cryptoToken": "ETH",
"cryptoChain": "ethereum",
"walletAddress": "<string>",
"paymentMode": "card",
"userCountry": "US"
}
'import requests
url = "https://api.hypermid.io/v1/onramp/quote"
payload = {
"fiatAmount": 100,
"fiatCurrency": "USD",
"cryptoToken": "ETH",
"cryptoChain": "ethereum",
"walletAddress": "<string>",
"paymentMode": "card",
"userCountry": "US"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fiatAmount: 100,
fiatCurrency: 'USD',
cryptoToken: 'ETH',
cryptoChain: 'ethereum',
walletAddress: '<string>',
paymentMode: 'card',
userCountry: 'US'
})
};
fetch('https://api.hypermid.io/v1/onramp/quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hypermid.io/v1/onramp/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'fiatAmount' => 100,
'fiatCurrency' => 'USD',
'cryptoToken' => 'ETH',
'cryptoChain' => 'ethereum',
'walletAddress' => '<string>',
'paymentMode' => 'card',
'userCountry' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hypermid.io/v1/onramp/quote"
payload := strings.NewReader("{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.hypermid.io/v1/onramp/quote")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hypermid.io/v1/onramp/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fiatAmount\": 100,\n \"fiatCurrency\": \"USD\",\n \"cryptoToken\": \"ETH\",\n \"cryptoChain\": \"ethereum\",\n \"walletAddress\": \"<string>\",\n \"paymentMode\": \"card\",\n \"userCountry\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"fiatCurrency": "USD",
"fiatAmount": 100,
"cryptoAsset": "ETH",
"chainId": 1,
"cryptoAmount": "0.029615",
"exchangeRate": 3376.65,
"fees": {
"networkFee": 2.50,
"processingFee": 3.49,
"partnerFee": 0.30,
"totalFee": 6.29
},
"totalFiatAmount": 106.29,
"paymentMethod": "credit_card",
"expiresAt": 1711234877
},
"error": null,
"meta": {
"requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
"timestamp": 1711234577,
"rateLimit": {
"limit": 2000,
"remaining": 1983,
"reset": 1711234627
}
}
}
Returns a price quote for purchasing crypto with fiat currency, including exchange rate, fees, and estimated crypto amount.
The fiat currency code (e.g.,
USD, EUR, GBP).The crypto asset symbol (e.g.,
ETH, USDC, BTC).The chain ID to receive crypto on (e.g.,
1 for Ethereum).The fiat amount to spend.
Payment method:
credit_card, debit_card, or bank_transfer.The wallet address to receive crypto.
{
"data": {
"fiatCurrency": "USD",
"fiatAmount": 100,
"cryptoAsset": "ETH",
"chainId": 1,
"cryptoAmount": "0.029615",
"exchangeRate": 3376.65,
"fees": {
"networkFee": 2.50,
"processingFee": 3.49,
"partnerFee": 0.30,
"totalFee": 6.29
},
"totalFiatAmount": 106.29,
"paymentMethod": "credit_card",
"expiresAt": 1711234877
},
"error": null,
"meta": {
"requestId": "q7f8a9b0-c1d2-3456-0123-567890123456",
"timestamp": 1711234577,
"rateLimit": {
"limit": 2000,
"remaining": 1983,
"reset": 1711234627
}
}
}
const quote = await client.getOnrampQuote({
fiatCurrency: "USD",
cryptoAsset: "ETH",
chainId: 1,
fiatAmount: 100,
paymentMethod: "credit_card",
walletAddress: "0xYourAddress",
});
console.log(`$100 USD = ${quote.data.cryptoAmount} ETH`);
console.log(`Total charge: $${quote.data.totalFiatAmount}`);
console.log(`Fees: $${quote.data.fees.totalFee}`);
curl -X POST "https://api.hypermid.io/v1/onramp/quote" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"fiatCurrency": "USD",
"cryptoAsset": "ETH",
"chainId": 1,
"fiatAmount": 100,
"paymentMethod": "credit_card",
"walletAddress": "0xYourAddress"
}'
body := `{
"fiatCurrency": "USD",
"cryptoAsset": "ETH",
"chainId": 1,
"fiatAmount": 100,
"paymentMethod": "credit_card",
"walletAddress": "0xYourAddress"
}`
req, _ := http.NewRequest("POST",
"https://api.hypermid.io/v1/onramp/quote",
strings.NewReader(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "your-api-key")
resp, _ := http.DefaultClient.Do(req)
Authorizations
Partner API key. Optional for public endpoints, required for /v1/partner/*.
Body
application/json
⌘I