Appearance
Get Token Amount
POST
/v5/onramp/token-amount
Estimate token output for a given EUR amount in Card API onramp.
Authorizations
ApiKeyAuth
Type
API Key (header: X-Api-Key)
Request Body
application/json
JSON
{
"fromToken": "string",
"EURAmount": "string",
"network": "string"
}
Responses
OK
application/json
JSON
{
"status": "ok",
"payload": {
"tokenAmount": "10",
"EURAmount": "18032.06"
}
}
Code examples
bash
curl -X POST https://api.brrr.network/v5/onramp/token-amount \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fromToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"EURAmount": "100",
"network": "ethereum"
}'javascript
const response = await fetch('https://api.brrr.network/v5/onramp/token-amount', {
method: 'POST',
headers: {
'X-Api-Key': process.env.BRRR_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
'fromToken': '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'EURAmount': '100',
'network': 'ethereum'
}),
});
if (!response.ok) {
const error = await response.json();
throw new Error(`Request failed: ${error.errorCode}`);
}
const data = await response.json();
console.log(data.payload);python
import os
import httpx
response = httpx.post(
'https://api.brrr.network/v5/onramp/token-amount',
headers={
'X-Api-Key': os.environ['BRRR_API_KEY'],
'Content-Type': 'application/json',
},
json={
"fromToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"EURAmount": "100",
"network": "ethereum"
},
)
response.raise_for_status()
print(response.json()['payload'])