NAV Navbar
javascript shell
  • Moneeda API
  • Authentication
  • Public endpoints
  • Errors
  • Moneeda API

    Introduction

    Welcome to the Moneeda API documentation!

    API Limits

    We are testing everything, so no limits for now. Act responsibly and please don't DDOS.

    Disclaimer

    Use this API carefully as real money is being moved.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    

    Make sure to replace MY_MONEEDA_TOKEN with your token

    Moneeda uses a token to allow access to the API. You can register a new user and retrieve a new token at our developer portal.

    Moneeda expects for the token to be included in all API requests to the server in a header that looks like the following:

    Authorization: Bearer MY_MONEEDA_TOKEN

    Public endpoints

    All public endpoints do not require any specific API key. If you are going to heavily call the endpoint, consider using a Websocket instead.

    Public client instance

    Create a new instance of the public client

    // there is no real differentiation in the url between public/authenticated endpoints
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    const publicClient = moneeda.public();
    
    // An exchange can be passed optionally
    const publicClient2 = moneeda.public('BTX');
    
    // or set
    publicClient.setExchange('BTX');
    

    If you are using the provided moneeda libraries, you can easily get an instance of the public client

    Exchanges

    Moneeda will use the defined exchange of the public instance by default.

    To set an exchange you can pass it as a parameter to the constructor or just set it as needed (great to make multiple calls to different exchanges).

    Available Exchanges

    Moneeda suports currently the following exchanges

    Products

    Returns all the products of an exchange

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/products"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    moneeda.public(EXCHANGE)
          .products()
          .then((products) => console.log(products));
    
    // or with async/await
    const products = await moneeda.public(EXCHANGE).products()
    
    

    The above command returns JSON structured like this:

    [
      {
        "id": "BTC-USD",
        "originalId": "btcusd",
        "base_currency": "BTC",
        "quote_currency": "USD",
        "base_min_size": "0.002",
        "base_max_size": "2000",
        "quote_increment": "5"
      },
      {
        "id": "LTC-USD",
        "originalId": "ltcusd",
        "base_currency": "LTC",
        "quote_currency": "USD",
        "base_min_size": "0.002",
        "base_max_size": "2000",
        "quote_increment": "5"
      }
    ]
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a Promise that resolves all products available for the defined exchange.

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/products

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Ticker

    Returns a product ticker

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/ticker?product=MY-PRODUCT"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    moneeda.public(EXCHANGE)
          .ticker(MY-PRODUCT)
          .then((ticker) => console.log(ticker));
    
    // or with async/await
    const ticker = await moneeda.public(EXCHANGE).ticker('BTC-USD')
    
    

    The above command returns JSON structured like this:

    {
        "price": 16940,
        "size": 134.16484512,
        "bid": 16930,
        "ask": 16939,
        "volume": 52005.64483952
    }
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a promise that resolves the ticker for an specific product

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/ticker

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Query Parameters

    Parameter Default Description
    product - The id of any product returned by the products endpoint

    Tickers

    Returns all the products' tickers

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/alltickers"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    moneeda.public(EXCHANGE)
          .allTickers()
          .then((tickers) => console.log(tickers));
    
    // or with async/await
    const tickers = await moneeda.public(EXCHANGE).allTickers()
    
    

    The above command returns JSON structured like this:

    [
      {
        "product": "BTC-ETC",
        "price": 0.00174066,
        "high": 0.00194,
        "low": 0.00158393,
        "bid": 0.00174068,
        "ask": 0.00174982,
        "volume": 3345.87474393
      },
      {
        "product": "BTC-ETH",
        "price": 0.03795013,
        "high": 0.03945476,
        "low": 0.02975,
        "bid": 0.03795013,
        "ask": 0.03799998,
        "volume": 14772.50221729
      }
    ]
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a promise that resolves the tickers of all the available products

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/alltickers

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Candles

    Returns the candles for a specific product

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/candles?product=MY-PRODUCT&period=30m"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    moneeda.public(EXCHANGE)
          .candles(PRODUCT, PERIOD)
          .then((candles) => console.log(candles));
    
    // or with async/await
    const candles = await moneeda.public(EXCHANGE).candles('BTC-USD', '30m')
    
    

    The above command returns JSON structured like this:

    [
      {
        "T": 1513126200,
        "O": 17840.01,
        "C": 17840.01,
        "H": 17840.01,
        "L": 17840,
        "V": 5.50505191
      },
      {
        "T": 1513125780,
        "O": 17872,
        "C": 17871,
        "H": 17872.01,
        "L": 17871,
        "V": 19.252282129999994
      },
      ...
    ]
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a promise that resolves the candles of a defined product for a specific period

    Each candle contains the following information:

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/candles

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Query Parameters

    Parameter Default Description
    product - The id of any product returned by the products endpoint
    period 30m The period desired. Should be one of the following: 1m, 5m, 15m, 30m

    Trades

    Returns the trades for a specific product

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/trades?product=MY-PRODUCT"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    // optional params
    const params =  {
      from: 12314124,
      to: 12341555,
      limit: 100
    }
    moneeda.public(EXCHANGE)
          .trades(PRODUCT, params)
          .then((trades) => console.log(trades));
    
    // or with async/await
    const trades = await moneeda.public(EXCHANGE).trades('BTC-USD', params)
    
    

    The above command returns JSON structured like this:

    [
      {
          "tradeId": 2744695,
          "time": 1513182321868,
          "size": "0.69000000",
          "price": "0.00283100",
          "side": "buy"
      },
      {
          "tradeId": 2744696,
          "time": 1513182321869,
          "size": "75.55000000",
          "price": "0.00283100",
          "side": "sell"
      },
      ...
    ]
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a promise that resolves the trades of a defined product

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/trades

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Query Parameters

    Parameter Default Description
    product - The id of any product returned by the products endpoint
    limit - Limit the amount of results
    from - From date timestamp
    to - To date timestamp

    Order Book

    Returns the order book for a specific product

    curl "https://api.moneeda.com/api/exchanges/EXCHANGE/book?product=MY-PRODUCT"
      -H "Authorization: Bearer MY_MONEEDA_TOKEN"
    
    const Moneeda = require('moneeda-node');
    const moneeda = new Moneeda('MY_MONEEDA_TOKEN');
    
    // optional params
    
    moneeda.public(EXCHANGE)
          .orderBook(PRODUCT)
          .then((orderBook) => console.log(orderBook));
    
    // or with async/await
    const orderBook = await moneeda.public(EXCHANGE).orderBook('BTC-USD')
    
    

    The above command returns JSON structured like this:

    {
      "bids": [
        {
            "price": "0.00283300",
            "amount": "251.51000000"
        },
        ...
      ],
      "asks" : [
        {
            "price": "0.00286900",
            "amount": "1.68000000"
        },
        ...
      ]
    }
    

    Make sure to replace EXCHANGE with your desired exchange

    Returns a promise that resolves the order book of a defined product

    HTTP Request

    GET https://api.moneeda.com/api/exchanges/EXCHANGE/book

    Parameters

    Parameter Description
    EXCHANGE The desired exchange to retrieve the products.

    Query Parameters

    Parameter Default Description
    product - The id of any product returned by the products endpoint
    level - Deepness of the orderbook. Only for GDX.

    Errors

    The Moneeda API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request sucks.
    401 Unauthorized -- Your API key is wrong or you didn't provide it.
    403 Forbidden -- Unsupported endpoint.
    404 Not Found -- The specified endpoint is not found or the exchange doesn't support this endpoint.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    429 Too Many Requests -- You're requesting too many times! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.