Wiki

Clone wiki

Yuri / Home

Welcome

Welcome to Astronaut's public API, powered by our intelligent bot Yuri. The API is a tool for developers to access important market data that can be used in cryptocurrency applications. Below you can find instructions on how to authenticate with the API as well as details on all of the endpoints we offer.

Rate Limits

Due to the processing power required to gather a lot of our data, we limit the number of requests a user can make each day. Users registered through our cryptocurrency trading application automatically receive 100 free requests per day. In order to increase rate limits, one must purchase access here. You can view your usage and daily limit via Moon Base.

Accessing the API.

To access the API, one must have an API Key with Astronaut. If you do not have one, you can get a personal key by visiting this link. To authenticate with the API, you must add the following header to your request:

'API-Key': <your-api-key>
Where <your-api-key> is replaced by the API key provided on Moon Base. That's all!

Endpoints

We have a wide variety of endpoints that can get you all the cryptocurrency data you need. The base URL for all of these endpoints will be:

https://api.astronaut.gg/api/public

Coin Data

Data Path: /coin (GET)
Parameters:
symbol (required) - The symbol which you want data for. eg. XLM
exchange (optional) - The exchange you want to pull data from. Default: Binance
Description: Returns relevant information about a given symbol and returns data based on the market used.
Response Example:

#!js
{
    "symbol": "XLM/BTC",       //Symbol/Pairing
    "price": "0.00001156",     //Current Price (BTC), if BTC/XBT - USD price
    "usd": "0.13",             //Current Price (USD), if BTC/XBT same as above
    "high": "0.00001187",      //High of the Day
    "low": "0.00001150",       //Low of the Day
    "open": "0.00001176",      //Opening Price
    "close": "0.00001156",     //Closing Price
    "percent": -1.7,           //24 Hour Percent Change
    "volume": 37979360,        //24 Hour Trade Volume (BTC)
    "bid": 165253,             //Amount of Coins in Highest Bid
    "ask": 202783              //Amount of Coins in Lowest Ask
}

Order Book Depth

Data Path: /depth (GET)
Parameters:
symbol (required) - The symbol which you want data for. eg. BNB
exchange (optional) - The exchange you want to pull data from. Default: Binance
Description: Returns up to 15 entries for both bids and asks on a given exchange. This is used to visualize the order books and market depths of a coin, particularly useful for trading bots and algorithms.
Response Example:

#!js
{
    "bids": [
        {
            "symbol": "BNB/BTC",          //Symbol and Pairing
            "price": 0.0032137,           //Price Level
            "contracts": 736.64,          //Contracts (Symbol) at Price Level
            "currency": "BTC"             //Currency Traded Against
        },
        ........................          //Omitted due to length (about 15 bids)
        {
            "symbol": "BNB/BTC",
            "price": 0.0032203,
            "contracts": 80.39,
            "currency": "BTC"
        }
    ],
    "asks": [
        {
            "symbol": "BNB/BTC",         //Symbol and Pairing
            "price": 0.003247,           //Price Level
            "contracts": 1456.36,        //Contracts (Symbol) at Price Level
            "currency": "BTC"            //Currency Traded Against
        },
        .......................          //Omitted due to length (about 15 asks)
        {
            "symbol": "BNB/BTC",
            "price": 0.0032344,
            "contracts": 93.86,
            "currency": "BTC"
        }
    ]
}

Data Path: /analysis (GET)
Parameters:
pairing (required) - The symbol and pairing to conduct analysis on. Format: SYMBOLPAIRING, eg. ADABTC or BTCUSDT
timeframe (required) - The timeframe in which you want to analyze data. Options: 30m, 1h, 4h, and 1d
Description: Returns a variety of information that is useful in the technical analysis of a coin. This is available for the top 100 pairings on Binance, which includes pairings of ETH, USDT, BTC, etc. Information returned includes popular indicator values, analysis upon the indicator values, trends that are forming, candlestick patterns, and much more. This is your best friend for a cryptocurrency trading application or bot.
Response Example:

#!js
{
    "symbol": "BNBBTC",                     //The pairing being analyzed.
    "timeframe": "1h",                      //The timeframe conducted on.
    "bullish": false,                       //AI prediction of whether the pairing is bullish.
    "bearish": false,                       //AI prediction of whether the pairing is bearish.
    "rsi": "18.3800000000",                 //Most recent RSI value.
    "rsiReading": "Oversold",               //Analysis of the RSI value.
    "bbUpper": "0.0032705322",              //Bollinger Bands upper band value.
    "bbLower": "0.0029839106",              //Bollinger Bands lower band value.
    "bbPb": "0.0603212276",                 //Bollinger Bands percent band value.
    "bbReading": "Volatile (Oversold)",     //Analysis of the BB values, including previous band readings.
    "macdValue": "-0.0000758513",           //MACD 'MACD' line value.
    "macdSignal": "-0.0000641157",          //MACD Signal line value.
    "macdHistogram": "-0.0000117356",       //MACD Histogram value.
    "macdReading": "Bearish Crossover",     //Analysis of the MACD values, based on current and historical data.
    "double": "Neither",                    //Double Bottom, Double Top, or Neither.
    "hs": "Neither",                        //Head and Shoulders, Inverse Head and Shoulders, or Neither.
    "trend": "Neither"                      //Trending Up, Trending Down, or Neither.
}

Recent Trades

Data Path: /trades (GET)
Parameters:
symbol (required) - The symbol which you want data for. eg. BNB
exchange (optional) - The exchange you want to pull data from. Default: Binance
Description: Returns the most recent 100+ trades for a given pairing on an exchange. The time zone for the trades is relative to the server's timezone.
Response Example:

#!js
[
    {
        "symbol": "BNB/BTC",                    //Symbol and pairing for trades.
        "time": "June 26, 2019 10:02 PM",       //Date and time of the trade (server's timezone).
        "trade_id": "44620199",                 //ID of the trade for the exchange.
        "type": "sell",                         //Type of trade (buy or sell).
        "price": 0.0027931,                     //Price of the trade.
        "amount": 8.02,                         //Amount of symbol traded.
        "total_cost": 0.022400662000000002      //Total trade cost (price * amount).
    },
    ..........................................  //Omitted due to long length.
    {
        "symbol": "BNB/BTC",
        "time": "June 26, 2019 10:07 PM",
        "trade_id": "44620698",
        "type": "buy",
        "price": 0.0027988,
        "amount": 4.28,
        "total_cost": 0.011978864
    }
]

Updated