Generate Estimated Gas Fee
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
symbol: 'USDC',
blockchain: 'MATIC',
recipient: {address: '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'}
})
};
fetch('https://sandboxapi.me-cash.com/v1/ramp/gasFee', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/ramp/gasFee \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": {
"address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9"
}
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/gasFee"
payload = {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": { "address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9" }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/gasFee';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
symbol: 'USDC',
blockchain: 'MATIC',
recipient: {address: '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/ramp/gasFee",
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([
'amount' => 5,
'symbol' => 'USDC',
'blockchain' => 'MATIC',
'recipient' => [
'address' => '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
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 \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": ["address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/gasFee")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/gasFee"
payload := strings.NewReader("{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\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))
}{
"status": "success",
"message": "gas fee estimated successfully",
"data": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"gas": {
"LOW": "0.01875321",
"MEDIUM": "0.02923792",
"HIGH": "0.03810231"
}
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"message": "Server failed to process request.",
"status": "failed"
}Get Gas Fee
Estimates the blockchain network gas fee for a crypto transfer.
POST
/
v1
/
ramp
/
gasFee
Generate Estimated Gas Fee
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
symbol: 'USDC',
blockchain: 'MATIC',
recipient: {address: '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'}
})
};
fetch('https://sandboxapi.me-cash.com/v1/ramp/gasFee', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://sandboxapi.me-cash.com/v1/ramp/gasFee \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": {
"address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9"
}
}
'import requests
url = "https://sandboxapi.me-cash.com/v1/ramp/gasFee"
payload = {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": { "address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9" }
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://sandboxapi.me-cash.com/v1/ramp/gasFee';
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 5,
symbol: 'USDC',
blockchain: 'MATIC',
recipient: {address: '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandboxapi.me-cash.com/v1/ramp/gasFee",
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([
'amount' => 5,
'symbol' => 'USDC',
'blockchain' => 'MATIC',
'recipient' => [
'address' => '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'
]
]),
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;
}HttpResponse<String> response = Unirest.post("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
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 \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}"
response = http.request(request)
puts response.read_bodyimport Foundation
let parameters = [
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"recipient": ["address": "0xd62acd62fdb155afaa5d12c6caf01119d413dfd9"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://sandboxapi.me-cash.com/v1/ramp/gasFee")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\n}")
val request = Request.Builder()
.url("https://sandboxapi.me-cash.com/v1/ramp/gasFee")
.post(body)
.addHeader("x-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandboxapi.me-cash.com/v1/ramp/gasFee"
payload := strings.NewReader("{\n \"amount\": 5,\n \"symbol\": \"USDC\",\n \"blockchain\": \"MATIC\",\n \"recipient\": {\n \"address\": \"0xd62acd62fdb155afaa5d12c6caf01119d413dfd9\"\n }\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))
}{
"status": "success",
"message": "gas fee estimated successfully",
"data": {
"amount": 5,
"symbol": "USDC",
"blockchain": "MATIC",
"gas": {
"LOW": "0.01875321",
"MEDIUM": "0.02923792",
"HIGH": "0.03810231"
}
}
}{
"message": "Invalid API key",
"status": "failed"
}{
"message": "Server failed to process request.",
"status": "failed"
}Generate Gas Fee
TheGet Gas Fee endpoint fetches the gas fee required for a cryptocurrency transaction based on source and recipient details.
Endpoint
POST {{baseURL}}/v1/ramp/gasFee
Headers
| Header | Value | Required | Description |
|---|---|---|---|
Content-Type | application/json | Yes | Specifies that the request body is JSON formatted. |
x-api-key | API_KEY_HERE | Yes | API key for authorization. See note below. |
Request Body
curl --location --request POST '{{baseURL}}/v1/ramp/gasFee' \
--header 'x-api-key: API_KEY_HERE' \
--header 'Content-Type: application/json' \
--data '{
"amount": 5000,
"symbol": "POL",
"blockChain": "MATIC",
"recipient": {
"address": "0xa0b86991c6218b36c1d19d4a2exxxxxxxxxxxxxxxxx"
}
}'
const feeDetails = {
amount: 5000,
symbol: "POL",
blockChain: "MATIC",
recipient: {
address: "0xa0b86991c6218b36c1d19d4a2exxxxxxxxxxxxxxxxx"
}
};
fetch('{{baseURL}}/v1/ramp/gasFee', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'API_KEY_HERE'
},
body: JSON.stringify(feeDetails)
})
.then(res => res.json())
.then(console.log)
.catch(console.error);
import requests
url = "{{baseURL}}/v1/ramp/gasFee"
payload = {
"amount": 5000,
"symbol": "POL",
"blockChain": "MATIC",
"recipient": {
"address": "0xa0b86991c6218b36c1d19d4a2exxxxxxxxxxxxxxxxx"
}
}
headers = {
"x-api-key": "API_KEY_HERE",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const axios = require('axios');
const feeDetails = {
amount: 5000,
symbol: "POL",
blockChain: "MATIC",
recipient: {
address: "0xa0b86991c6218b36c1d19d4a2exxxxxxxxxxxxxxxxx"
}
};
axios.post('{{baseURL}}/v1/ramp/gasFee', feeDetails, {
headers: {
'x-api-key': 'API_KEY_HERE',
'Content-Type': 'application/json'
}
}).then(response => {
console.log(response.data);
}).catch(error => {
console.error(error.response.data);
});
Request Breakdown
Source Fields
| Field | Type | Description |
|---|---|---|
| amount | number | Amount of cryptocurrency to transfer. |
| symbol | string | Currency symbol (e.g., POL). |
| blockChain | string | Type of source asset. |
Recipient Fields
| Field | Type | Description |
|---|---|---|
| recipient.address | string | Wallet address of the recipient. |
Successful Response (200 OK)
{
"message": "fetch estimated gas fee successfully",
"status": "success",
"data": {
"feeLevel": [
{
"type": "LOW",
"fee": {
"network": { "name": "Polygon", "blockchain": "MATIC", "amount": 0.01909123 },
"cryptoCurrency": { "name": "Polygon", "symbol": "POL", "amount": 0.01909123 }
}
},
{
"type": "MEDIUM",
"fee": {
"network": { "name": "Polygon", "blockchain": "MATIC", "amount": 0.02109588 },
"cryptoCurrency": { "name": "Polygon", "symbol": "POL", "amount": 0.02109588 }
}
},
{
"type": "HIGH",
"fee": {
"network": { "name": "Polygon", "blockchain": "MATIC", "amount": 0.0373431 },
"cryptoCurrency": { "name": "Polygon", "symbol": "POL", "amount": 0.0373431 }
}
}
]
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
message | string | Description of the request result. |
status | string | Status of the request (success or error). |
data | object | Contains the estimated gas fee levels. |
data.feeLevel | array | List of available gas fee levels. |
data.feeLevel[].type | string | Fee priority level (LOW, MEDIUM, HIGH). |
data.feeLevel[].fee | object | Fee amount data for the given level. |
data.feeLevel[].fee.network | object | Fee details from the network perspective. |
data.feeLevel[].fee.network.name | string | Name of the network (e.g., “Polygon”). |
data.feeLevel[].fee.network.blockchain | string | Name of the blockchain (e.g., “MATIC”). |
data.feeLevel[].fee.network.amount | number | Estimated fee amount in the network. |
data.feeLevel[].fee.cryptoCurrency | object | Fee details from the cryptocurrency perspective. |
data.feeLevel[].fee.cryptoCurrency.name | string | Name of the cryptocurrency (e.g., “Polygon”). |
data.feeLevel[].fee.cryptoCurrency.symbol | string | Symbol of the cryptocurrency (e.g., “POL”). |
data.feeLevel[].fee.cryptoCurrency.amount | number | Estimated fee amount in the cryptocurrency. |
Error
| HTTP Status Code | Error Code | Message | Description |
|---|---|---|---|
| 400 | INVALID_REQUEST | Invalid request payload. | The request body is malformed or missing required fields. |
| 401 | UNAUTHORIZED | Unauthorized access. | The Authorization or x-api-key header is missing or invalid. |
| 403 | FORBIDDEN | Access denied. | You do not have permission to access this resource. |
| 404 | RECIPIENT_NOT_FOUND | Recipient address not found or invalid. | The provided recipient wallet address is invalid or not recognized. |
| 422 | UNSUPPORTED_NETWORK | Unsupported network or currency. | The given source network or currency is not supported for gas estimation. |
| 500 | INTERNAL_ERROR | Internal server error. | An unexpected error occurred on the server side. |
Authorizations
Body
application/json
Was this page helpful?

