ETH: $
(%)
network iconEthereum

Owlracle API documentation

Owlracle API provides endpoints for easy integration with your app. Providing your users with Owlracle's data will ensure they never get stuck transactions again or overpay for gas, whether minting a fresh NFT, performing a swap at a DEX, lending, or borrowing assets.

Note that the first time you log in with your API key, you will be asked to confirm your email address. To be able to enjoy the free request limit, you need to provide provide your email first. Do not worry though, you will only be sent emails regarding Owlracle's new features and updates.

When you access our endpoints, it is reccomended that you use an API key. You can request our data up to 100 times per hour for free. After reaching that limit, you can continue to make requests either waiting a few minutes or using your api credit. You can also make requests without an api key for testing purposes, up to 10 times per hour. API keys without a bound email address cannot enjoy the increased free limit.

API keys

To create your API key and be able to make requests to our endpoints, go to the header section of this page, and click New API key on the dropdown option. On the New API key window, fill the required fields and click the Create API key button. Copy your key and secret, and keep them safe. The API key will be required to make requests to our endpoints, and the secret will be used if you want to change any information about your key.

Security tip: When using your key, keep in mind that front-end code is publicly readable, even if obfuscated. Thus, writing your key in the source-code will expose it.

API Credit

After reaching the free request limit (100 requests in the last hour), each new request will subtract $0.00005 USD from your API account.

Any time you want to recharge your API credit, you can use the header to open the Recharge key tab. You will be asked to connect your wallet using Metamask extension. This window will let you transfer to Owlracle's wallet any amount of ETH while using the Ethereum network. The amount transferred will be converted to USD and credited in your account. After the transfer confirmation, our server will update your API credit automatically. Keep in mind that the amount credited may vary depending of the token exchange rate.

Quick Start Integration Guide

It is very straightforward to use Owlracle API in your application. Whether you are building a website, a bot, or any other kind of software, the best-around gas price information can be fetched with a simple request.

Node
Python
PHP
Java
const fetch = require('node-fetch');
const network = 'eth'; // could be any supported network
const key = 'YOUR_API_KEY'; // fill your api key here
const res = await fetch(`https://api.owlracle.info/v4/${ network }/gas?apikey=${ key }`);
const data = await res.json();
console.log(data);
import requests
network = 'eth'; # could be any supported network
key = 'YOUR_API_KEY'; # fill your api key here
res = requests.get('https://api.owlracle.info/v4/{}/gas?apikey={}'.format(network, key))
data = res.json()
print(data)
$network = 'eth'; // could be any supported network
$key = 'YOUR_API_KEY'; // fill your api key here
$url = "https://api.owlracle.info/v4/$network/gas?apikey=$key";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$resp = curl_exec($curl);
curl_close($curl);
var_dump($resp);
import java.net.*;
import java.io.*;

class Main {
    public static void main(String[] args) throws Exception {
        String network = "eth"; // could be any supported network
        String key = "YOUR_API_KEY"; // fill your api key here
        URL url = new URL(String.format("https://api.owlracle.info/v4/%s/gas?apikey=%s", network, key));
        URLConnection conn = url.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String inputLine;

        while ((inputLine = in.readLine()) != null) 
            System.out.println(inputLine);
        in.close();
    }
}

Suppose you are building a web3 app and want to use Owlracle's estimations into a smart contract interaction. In that case, it is just a matter of using the gas price information returned by your previous request in the gasPrice argument.

Javascript
Node
// Interaction using user's browser through Metamask extension. Check their docs here:
// https://docs.metamask.io/guide/sending-transactions.html#example
const txHash = await ethereum.request({
    method: 'eth_sendTransaction',
    params: {
        from: ethereum.selectedAddress, // Metamask's selected address
        to: '0x0000', // contract address
        gasPrice: 1000000000 * OWLRACLE_GAS, // this is where you will set the gas price received from Owlracle. The multiplication converts Gwei to Wei.
    },
});
// This sample code send 1 BUSD from your address to Owlracle's address on the BNB chain.
const Web3 = require('web3');
const web3 = new Web3('https://bsc-dataseed.binance.org'); // this is a BNB Chain RPC. You can use any other.

// huge info. get it from https://github.com/paxosglobal/busd-contract/blob/master/BUSD.abi
const ERC20TransferABI = 'CONTRACT_ABI_HERE';

const BUSD_ADDRESS = "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56";
const busdToken = new web3.eth.Contract(ERC20TransferABI, BUSD_ADDRESS);

const privateKey = 'YOUR_ADDRESS_PRIVATE_KEY';
web3.eth.accounts.wallet.add(privateKey);
const senderAddress = "YOUR_ADDRESS";

const receiverAddress = "0xA6E126a5bA7aE209A92b16fcf464E502f27fb658"; // Owlracle address

// get token balance
busdToken.methods.balanceOf(senderAddress).call(function (err, res) {
    if (err) {
        console.log("An error occured", err);
        return;
    }
    console.log("The balance is: ", res);
});

// send 1 BUSD from your address to Owlracle
busdToken.methods.transfer(receiverAddress, web3.utils.toWei('1', 'ether')).send({
    from: senderAddress,
    gasPrice: web3.utils.toWei(OWLRACLE_DATA, 'gwei'), // here you insert owlracle gas price
    gas: web3.utils.toHex('320000'), // gas limit
}, function (err, res) {
    if (err) {
        console.log("An error occured", err);
        return;
    }
    console.log("Hash of the transaction: " + res)
});

Owlracle's API endpoitns

All public API endpoints are detailed below. After the endpoint description, you should see a table explaining every endpoint's arguments, response fields, and the sandbox. There you can visually build your own requests, customizing argument values to your desire. Owlracle sandbox will teach you what the request URL should look like.

Gas fee estimation

Retrieve gas for Ethereum network. You can use any of the following as the alias for this network: . If you prefer another network, replace it for the corresponding network alias. Check our header for the supported network list.

Owlracle scans recent past blocks (blocks param) to build an estimative of required gas fee to be paid. It looks for the minimum gas accepted on a transaction for every scanned block (based on the chosen percentile). Then it shows you the minimum gas you should pay to be accepted on a percentage of your choice (accept param) of those blocks.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
version
param
API version.
v4
network
param
Network you will request information from.
eth
apikey
query
You API key. Check API keys section to learn how to generate and use one.
none
blocks
query
Number of past blocks you want Owlracle to scan to build the estimation. Maximum 1000.
200
percentile
query
Block gas percentile. For every analyzed block, Owlracle calculates the minimum gas needed to be accepted on that block. Taking an array with asceding gas from the block's txs, the percentile argument tells Owlracle the array's index to be considered the first element, essentially discarding lower gas txs from the minimum accepted gas calculations. The value must be between 0.01 and 0.99 indicating a percentage from the array's position, or an integer >= 1 indicating directly the tx index in the array.
0.3
accept
query
Acceptance threshold of transactions. The percentage of blocks you want the transaction to be accepted, based on the past mined blocks. Higher acceptance means more speedy transactions. You can provide a single value or a comma separated list of values, representing multiple speeds.
35,60,90,100
feeinusd
query
If set to false, the estimatedFee response value will be reported in native token (ETH, BNB, MATIC, etc), instead of the default reporting in USD.
true
eip1559
query
If false, the response will be reported as legacy gas type transaction (e.g., gasPrice instead of maxFeePerGas and maxPriorityFeePerGas). Valid only for networks supporting EIP-1559.
true
reportwei
query
If true, the response fields gasPrice, maxFeePerGas, maxPriorityFeePerGas and baseFee will be reported in Wei instead of Gwei, and the value will also be a string instead of float.
false
calcfrom
query
When 'priorityFee', the calculation of the maxPriorityFeePerGas parameter will be based on the scanned blocks, instead of using the default calculation (maxFeePerGas - baseFee. Consequently, the calculation of maxFeePerGas will be based on the sum of baseFee and maxPriorityFeePerGas, rather than relying on the scanned blocks as done by default.
maxFee
gasused
query
When feeinusd is set enabled, this will be the gas used for the transaction estimation. If not informed, the value will be the average gas used in the scanned blocks. You can use SW3 /estimate endpoint to get the gas used for a specific transaction.
none
Field
Description
timestamp
An ISO 8601 compliant date for when the API returned the result.
lastBlock
Number of the last block Owlracle scanned.
avgTime
Average time between each block confirmation.
avgTx
Average number of transactions in the blocks.
avgGas
Average gas used on transactions in the scanned blocks.
speeds
Array containing information of every speed requested in the accept param.
acceptance
Ratio of blocks accepting transactions with the suggested gas fee. This value will always be >= the requested speed from the accept argument.
baseFee
Maximum Base Fee reported from the network in the lower accept% of scanned blocks. This field is only available if the network is EIP-1559 compliant and eip1559 argument is set to true.
maxFeePerGas
Suggested maximum gas price (in GWei) you are willing to pay to have your tx accepted in at least accept% of blocks. This field will not be available when the eip1559 argument is set to false.
maxPriorityFeePerGas
Suggested gas price (in GWei) you are willing to give to the miners for them to process your transaction in at least accept% of blocks. This field will not be available when the eip1559 argument is set to false.
gasPrice
Suggested gas price (in GWei) to have your tx accepted in at least accept% of blocks. This field is only available when eip1559 argument is set to false.
estimatedFee
Estimated fee (in USD) you should pay when using the suggested gas price. This fee is calculated using the current token price and avgGas value.
{
"timestamp": "0000-00-00T00:00:00.000Z",
"lastBlock": 0,
"avgTime": 0,
"avgTx": 0,
"avgGas": 0,
"speeds": [
{
"acceptance": 0,
"maxFeePerGas": 0,
"maxPriorityFeePerGas": 0,
"baseFee": 0,
"estimatedFee": 0
}
]
}
/v4/eth/gas
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/v4/eth/gas`;
const data = await fetch(url).then(res => res.json());
console.log(data);

Gas history

Retrieve the price history for gas, token price and fee for Ethereum network. If you prefer another network, replace eth for the corresponding network symbol. Check our header for the supported network list.

The API will return an array of candlesticks built from aggregate data of the requested timeframe. The array is ordered from decreasing timestamps.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
version
param
API version.
v4
network
param
Network you will request information from.
eth
apikey
query
You API key. Check API keys section to learn how to generate and use one.
none
from
query
Unix timestamp representing the time where your search will start from.
0
to
query
Unix timestamp representing the time where to finish your search.
Current timestamp
candles
query
How many results (maximum) you wish the search to retrieve. Maximum 1000.
100
page
query
If the time range of your search returns more than candles values, you must inform the page of the search you wish to retrieve.
1
timeframe
query
The time you wish to aggregate results to form candles. The allowed values are 10m, 30m, 1h, 2h, 4h or 1d. You could also inform these values in minutes (10, 30, 60, 120, 240, or 1440).
30
tokenprice
query
Whether you want or not to receive the native network token price history in the request.
false
txfee
query
Whether you want or not to receive in the request the historical average value (in USD) paid for txs.
false
Field
Description
timestamp
An ISO 8601 compliant date for the candlestick time.
samples
Number of samples composing the candle.
avgGas
Average gas limit set for transactions in the blocks composing the candle.
gasPrice
Object containing information about gas price paid in the blocks composing the candle.
tokenPrice
Object containing information about network's native token price at the time. Only present if tokenprice argument is set to true
txFee
Object containing information about average gas fee paid (in USD) for submitting a transaction at the time. Only present if txfee argument is set to true
open
The data reported on the first moment of the candle.
close
The data reported on the last moment of the candle.
low
The lowest data reported on the entire candle.
high
The highest data reported on the entire candle.
{
"candles": [
{
"timestamp": "0000-00-00T00:00:00.000Z",
"samples": 0,
"avgGas": 0,
"gasPrice": {
"open": 0,
"close": 0,
"low": 0,
"high": 0
},
"tokenPrice": {
"open": 0,
"close": 0,
"low": 0,
"high": 0
},
"txFee": {
"open": 0,
"close": 0,
"low": 0,
"high": 0
}
}
]
}
/v4/eth/history
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/v4/eth/history`;
const data = await fetch(url).then(res => res.json());
console.log(data);

API key information

Request information about your API key.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
version
param
API version.
v4
apikey
param
You API key. Check API keys section to learn how to generate and use one.
none
Field
Description
apiKey
Your API key.
creation
An ISO 8601 compliant date for the time the API key was created.
credit
The amount of your unspent credit (in USD).
origin
Your requests will only be processed if the request's origin match your API key origin field. This field will not be present if you did not fill an origin when creating the API key.
note
A personal informative note about the key. This field will only be present if you filled a note when creating your key.
usage
The API key Usage.
usage.ip1h
Requests made using your IP address in the last hour.
usage.total1h
Requests made using your API key in the last hour.
usage.charged1h
Requests beyond the free limit in the last hour.
{
"apiKey": "00000000000000000000000000000000",
"creation": "0000-00-00T00:00:00.000Z",
"credit": "0.000000000",
"origin": "domain.com",
"note": "note to myself",
"usage": {
"ip1h": 0,
"total1h": 0,
"charged1h": 0
}
}
/v4/keys/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/v4/keys/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

API key credit recharge history

Get information about every api recharge.

On a success, the result will be a JSON containing message and results fields. The results field is an array containing information about each API recharge transaction, where each element is an Object with the following fields:

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
version
param
API version.
v4
apikey
param
You API key. Check API keys section to learn how to generate and use one.
none
Field
Description
network
Network the transaction was sent. Possible values: Symbol for any supported network (e.g. "bsc", "poly", "ftm", "avax", "eth")
tx
The transaction hash of your deposit. You can check the network's block explorer for details about the transaction.
timestamp
An ISO 8601 compliant date for the time of the transaction.
value
Credit deposited in ETH in Gwei (1 Gwei = 0.000000001 ETH).
price
ETH/USDT price at the time of the transaction.
fromWallet
The wallet that sent the credit to your API wallet.
{
"recharges": [
{
"network": "xxx",
"tx": "0x0000000000000000000000000000000000000000000000000000000000000000",
"timestamp": "2000-00-00T00:00:00.000Z",
"value": "0",
"price": "0",
"fromWallet": "0x0000000000000000000000000000000000000000"
}
]
}
/v4/credit/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/v4/credit/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

API key usage log

Get information about your API key usage.

You can pass the optional arguments fromtime and totimeto set the time range of your search.

Arguments
Response
Sandbox
Code
Field
Type
Description
Default
version
param
API version.
v4
apikey
param
You API key. Check API keys section to learn how to generate and use one.
none
fromtime
query
The time (unix timestamp) you want to start your search.
One hour in the past
totime
query
The time (unix timestamp) you want to end your search.
Current timestamp
limit
query
The maximum number of log entries you want to receive.
1000
Field
Description
ip
The ip address of the request. null if the request was made from a private ip.
origin
The origin of the request. This is the domain (the website name) that originates the request. null if the request did not originate from a website (or called from the client browser).
timestamp
An ISO 8601 compliant date for the time of the transaction.
endpoint
The endpoint requested. Possible values: "gas", "history".
network
Network of the information requested. Possible values: Symbol for any supported network (e.g. "bsc", "poly", "ftm", "avax", "eth").
{
"logs": [
{
"ip": "255.255.255.255",
"origin": "domain.com",
"timestamp": "0000-00-00T00:00:00.000Z",
"endpoint": "xxx",
"network": "xxx"
}
]
}
/v4/logs/
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/v4/logs/`;
const data = await fetch(url).then(res => res.json());
console.log(data);

RPC endpoint

Get information about the RPCs used by Owlracle.

Response
Sandbox
Code
Field
Description
network
Network the RPC is connected to.
rpc
The RPC URL.
lastTime
The last time the RPC reported a new block.
timeDiff
The difference between the last time the RPC reported a new block and the last time the RPC was checked.
healthy
Whether the RPC is healthy or not (timeDiff < 60 seconds).
[
{
"network": "xxx",
"rpc": "https://urltotherpc.com",
"lastTime": 0,
"timeDiff": 0,
"healthy": true
}
]
/rpc
const fetch = require('node-fetch');
const url = `https://api.owlracle.info/rpc`;
const data = await fetch(url).then(res => res.json());
console.log(data);

SW3 API

With the Seamless Web3 API, you can easily onboard your users to the blockchain. It is a very powerful API that allows you to create wallets, send transactions, and more. All your users need to interact with the blockchain is a username and password while navigating your app.

Check out the SW3 API documentation for more information.

Proxy Node

We also provide a Proxy Node service that dynamically routes your requests to the fastest available RPC. To use it, you can simply replace your existing RPC URL in your wallet with our URL.

Check out the Proxy Node documentation for more information.