NAV Navbar
shell javascript
  • Introduction
  • Authentication
  • Wallets
  • Wallet by Id
  • Transactions
  • Transaction by id
  • Ticker
  • Order
  • OHLCV Data
  • Errors
  • Introduction

    Welcome to the Xtremcoin API! You can use our API to access Xtremcoin API endpoints, which can get information on various Wallets, transactions, create new wallets and open orders etc in our database.

    We have language bindings in Shell and JavaScript You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    Authentication

    To authorize, use this code:

        curl -X POST --data "appid=bdd720-d9a1-11e8-9f11-b16c26db851f&secretkey=vS6hWXOexH07jij0ar8DXpfYg/pq926Qg!=" http://xtremcoin.com/api/auth/token
    
    
    const request = require('request');
    
    request.post({url:'www.xtremcoin.com/api/auth/token', form: {appid:'bdd720-d9a1-11e8-9f11-b16c26db851f'},{secretkey:'vS6hWXOexH07jij0ar8DXpfYg/pq926Qg!='}}, function(err,httpResponse,body)
    {
     /* ... */ 
    })
    

    The above command returns JSON structured like this:

        {
        "error": false,
        "description": "Token Created",
        "data": {
            "token": "eyJhbGciOiJIUzI1NiIsInR5cCIkpXVCJ9.eyJlbWFpbCI6InN0ZXB3aXRobGF4bWFuOTB1haWwuY29tIiwiZXhwaXJlc0luIjoiOWQiLCJpYXQiOjE1Mzk2NjczMDF9.1tCaKbzkCxsCyV9tw4QXx6gjbCzkJ3eg-aw-AFCcM",
            "token_type": "Bearer"
        }
    }
    

    Xtremcoin uses Bearer Token as for Authorization to allow access to the API. You can register a new Xtremcoin API key at our Wallet API.

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

    Authorization: <Bearer Token>

    Wallets

    To get wallets, use this code:

    
    curl -X GET -H "Authorization: Bearer eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo" www.xtremcoin.com/api/wallets
    
    
    
    const request = require('request');
    
    request.get('www.xtremcoin.com/api/wallets', {
      'auth': {
        'bearer': 'eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo'
      }
    });
    
    

    The above command returns JSON structured like this:

        {
        "error": false,
        "description": "User Wallets",
        "data": [
            {
                "_id": "5a5ebsadsa5a425a17392",
                "email": "xtremcoinUser@xyz.com",
                "wallet_id": "5018f3e073075611db02bd92fb1",
                "address": "Y37PELvsXQ39x7UVuzJCh4ACDF3453P",
                "addressId": "sag2233ba88e6718449896",
                "index": 04,
                "chain": 0,
                "currency": "BTC",
                "label": "BTC",
                "__v": 0,
                "updatedAt": "2017-08-30T14:37:46.982Z",
                "isHide": 0,
                "balance": 0
            },
        {},
        {}...]
    }
    

    Xtremcoin's wallet api uses Bearer Token as for Authorization to allow access to the API.

    Xtremcoin expects the Bearer Token to be included in header and API requests to the server to fetch wallets.

    Wallet by Id

    To get wallet, use this code:

    
    curl -X GET -H "Authorization: Bearer eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo" www.xtremcoin.com/api/wallets/5018f3e073075611db02bd92fb1
    
    
    
    const request = require('request');
    
    request.get('www.xtremcoin.com/api/wallets/5018f3e073075611db02bd92fb1', {
      'auth': {
        'bearer': 'eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo'
      }
    });
    
    

    The above command returns JSON structured like this:

        {
        "error": false,
        "description": "User Wallet",
        "data": [
            {
                "_id": "5a5ebsadsa5a425a17392",
                "email": "xtremcoinUser@xyz.com",
                "wallet_id": "5018f3e073075611db02bd92fb1",
                "address": "Y37PELvsXQ39x7UVuzJCh4ACDF3453P",
                "addressId": "sag2233ba88e6718449896",
                "index": 04,
                "chain": 0,
                "currency": "BTC",
                "label": "BTC",
                "__v": 0,
                "updatedAt": "2017-08-30T14:37:46.982Z",
                "isHide": 0,
                "balance": 0
            }]
    }
    

    Xtremcoin's wallet api uses Bearer Token as for Authorization to allow access to the API.

    Xtremcoin expects the Bearer Token to be included in header and path parameter as wallet_id with url. API requests to the server to fetch wallet by wallet_id.

    Transactions

    To get wallets, use this code:

    
    curl -X GET -H "Authorization: Bearer eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo" www.xtremcoin.com/api/transactions
    
    
    
    const request = require('request');
    
    request.get('www.xtremcoin.com/api/transactions', {
      'auth': {
        'bearer': 'eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo'
      }
    });
    
    

    The above command returns JSON structured like this:

        {
        "error": false,
        "description": "All Transactions",
        "data": [
            {
                "_id": "5a5ebsadsa5a425a17392",
                "email": "xtremcoinUser@xyz.com",
                "atAddress": "Buy",
                "atWallet": "Y37PELvsXQ39x7UVuzJCh4ACDF3453P",
                "transactionId": "sag2233ba88e6718449896",
                "currency": "TRY",
                "status": "Completed",
                "exchangeCurrency": "USD",
                "__v": 0,
                "createdAt": "2017-08-30T14:37:46.982Z",
                "multi": false,
                "executedPrice": 0,
                "exchangeRate": 0.32,
                "exchangeFee": 0.05,
                "exchnageValue": .5,
                "internal": false,
                "sendOrReceive": "Buy",
                "gasPrice": 0,
                "gasLimit": 0,
                "instantFee": 0,
                "isInstant": false,
                "transactionType": "LimitOrder",
                "balance": 0,
                "sentAmount": 0,
                "networkFixedFee": 0,
                "fee": 0,
                "amount": 100
            },
        {},
        {}... {}]
    }
    

    Xtremcoin's transactions API uses Bearer Token as for Authorization to allow access to the API.

    Xtremcoin transactions API expects the Bearer Token to be included in header and API requests to the server to fetch last 100 transactions.

    Transaction by id

    To get transaction, use this code:

    
    curl -X GET -H "Authorization: Bearer eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo" www.xtremcoin.com/api/transaction/5018f3e073075611db02bd92fb1
    
    
    
    const request = require('request');
    
    request.get('www.xtremcoin.com/api/transaction/5018f3e073075611db02bd92fb1', {
      'auth': {
        'bearer': 'eyWFpbCI6InN0ZXB3aXROiJIUzI1Ni.eyJlbobGF4bWFuOTIsInR5cCI6IkpXVCJ9wiZXhwaTbIuaduqQFXJlc0luIjoiOWQiLCJpYl9.W3gQkjJXQiOjE1Mzk2OTEzMj-KTbIuaduqQFUwY2RjXo'
      }
    });
    
    

    The above command returns JSON structured like this:

        {
        "error": false,
        "description": "User transaction",
        "data": [
            {
                "_id": "5a5ebsadsa5a425a17392",
                "email": "xtremcoinUser@xyz.com",
                "atAddress": "Buy",
                "atWallet": "Y37PELvsXQ39x7UVuzJCh4ACDF3453P",
                "transactionId": "sag2233ba88e6718449896",
                "currency": "TRY",
                "status": "Completed",
                "exchangeCurrency": "USD",
                "__v": 0,
                "createdAt": "2017-08-30T14:37:46.982Z",
                "multi": false,
                "executedPrice": 0,
                "exchangeRate": 0.32,
                "exchangeFee": 0.05,
                "exchnageValue": .5,
                "internal": false,
                "sendOrReceive": "Buy",
                "gasPrice": 0,
                "gasLimit": 0,
                "instantFee": 0,
                "isInstant": false,
                "transactionType": "LimitOrder",
                "balance": 0,
                "sentAmount": 0,
                "networkFixedFee": 0,
                "fee": 0,
                "amount": 100
            }]
    }
    

    Xtremcoin's transaction API uses Bearer Token as for Authorization to allow access to the API.

    Xtremcoin transaction by id API expects the Bearer Token to be included in header and path parameter as transaction_id with url. API requests to the server to fetch transaction by transaction_id.

    Ticker

    Per Symbol

    This will return json of ticker in a data

        curl "https://www.xtremcoin.com/api/ticker/btcusd"
        -H "Content-Type: application/json"
    

    The above command returns JSON structured like this:

        {
            "high":6180.71,
            "low":6028.02,
            "last":6111.84,
            "bid":6110.15,
            "ask":6112.61,
            "volume":63443.78678197,
            "vwap":6115.92,
            "open":6138.67,
            "timestamp":1530162424,
            "display_timestamp":"2018-06-28 05:07:04"
        }
    

    HTTP Request

    GET https://www.xtremcoin.com/api/ticker/<currency_pair>

    Query Parameters

    Parameter Default Requered Description
    currency_pair --- Yes supported currencies: btcusd, bchusd, xrpusd, ethusd, ltcusd, btctry, bchtry, xrptry, ethtry, ltctry, btceur, bcheur, xrpeur, etheur, ltceur, xrpbtc, bchbtc, ethbtc, ltcbtc).

    This endpoint retrieves a specific ticker.

    Order

    Order Book

    Returns a JSON dictionary with "bids" and "asks". Each is a list of open orders and each order is represented as a list holding the price and the amount.

        curl "https://www.xtremcoin.com/api/order_book/btcusd"
        -H "Content-Type: application/json"
    

    The above command returns JSON structured like this:

        {
            "timestamp":1530162424,
                    "bid": [
                            0: [
                                    0: 0.0004,
                                    1: 27411.52
                            ]
                    ],
                    "ask": [
                            0: [
                                    0: 0.0004,
                                    1: 31390.93
                            ]
                    ]
    
        }
    

    HTTP Request

    GET https://www.xtremcoin.com/api/order_book/<currency_pair>

    Query Parameters

    Parameter Default Requered Description
    currency_pair --- Yes supported currencies: btcusd, bchusd, xrpusd, ethusd, ltcusd, btctry, bchtry, xrptry, ethtry, ltctry, btceur, bcheur, xrpeur, etheur, ltceur, xrpbtc, bchbtc, ethbtc, ltcbtc).

    This endpoint returns a JSON dictionary like the ticker call, with the calculated values being from within an hour.

    OHLCV Data

    By websocket/Pusher

    Returns a JSON dictionary with "open", "high", "low", "close" and "volume" data. Each data set is a calculation based on trades and can help building Full Candle or hollow candle charts.

    First, run npm install pusher Use our pusher APP_KEY = c72c404f12b7eceb7180 channel xtremcoin-price-channel event xtremcoin-{fiat currency}-event

    //include js.pusher.com/4.3/pusher.min.js
        var pusher = new Pusher('APP_KEY', {
          cluster: 'eu'
        });
    // subscribe to a channel
        var channel = pusher.subscribe('xtremcoin-price-channel');
        // bind events
        channel.bind('xtremcoin-try-event', function(data) {
          alert('An event was triggered with message: ' + data.message);
        });
    

    Errors

    The Kittn API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The kitten requested is hidden for administrators only.
    404 Not Found -- The specified kitten could not be found.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The kitten requested has been removed from our servers.
    418 I'm a teapot.
    429 Too Many Requests -- You're requesting too many kittens! 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.