A+ A A-

NodeCheck API

Introduction

This article explains how to use NodeCheck API.  There are some basics that you need to know first before making requests.

  • Always use POST method
  • API URL: https://nodecheck.io/api/{endpoint}
  • Request header: Content-Type:application/json
  • Request body should be in JSON format
  • Results are returned in JSON format

once you adhere to these points, then everything will work very simply.  Here is an example API call being made via curl:

curl -s -H "Content-Type:application/json" -d  '{"access-token": "xxxxxxx"}' https://nodecheck.io/api/apistats

the above command by default will default to the POST method.  We have scripts already prepared and on NodeCheck Github so you can download and use for testing purposes to save a little time.  You will need to edit the beginning of the script and add your API key - this is explained in the README.md on our github.

API packages can be purchased monthly, bi-monthly, quarterly, yearly, or however your needs fit.  We are very flexible when it comes to that, so you can choose and decide how you want!

Example API calls

Below are some sample API calls being made using our test scripts from above.  Our scripts are all done via curl for the bash script, and done in python code for the python script.  The calls available are as follows:

[email protected]:~$ ./api.sh

You need to provide an API command to run this script.
Examples:

./api.sh <main-command> <parameters>

Display available coins on our site:    ./api.sh ticker
Display coinstats:                      ./api.sh coinstats dash
Display apistats:                       ./api.sh apistats

Add MN to monitor:                      ./api.sh add dash <payee> <txid>
Check MN status:                        ./api.sh status <payee> <txid>
Delete monitored MN:                    ./api.sh delete <payee> <txid>

So, lets go through each of those API calls.

apistats

First off, apistats - this will provide you with information relating to status of your API:

[email protected]:~$ ./api.sh apistats
{
  "success": true,
  "message": {
    "api_call_counter": 825,
    "api_call_counter_limit": 1000000,
    "api_expiry": "2029-07-05"
  }
}

it shows the API was a success, it shows how many API calls we have made so far, and how many we have left.  We can also see the expiry date.  Note that there are two types of expiry.  The first, is if all API calls are used, the second the expiry date.  For example, I can use all of my 1m API calls today, and it will stop working even if the expiry date still has 9 years to go.  The other is that it can expire even if I do not use all my API calls.  This is why it is important to choose the correct API package for your usage needs.

ticker

Now let's check the ticker command:

[email protected]:~$ ./api.sh ticker
{
  "message": {
    "TICKER": {
      "name": "Coin Name"
    }
  },
  "success": true
}

the above shows the format.  I haven't posted the full output, since it outputs all the ticker information for all the coins on our platform.  Now, once we have the ticker information, it is the ticker that we use to make the API calls for coinstats, and also for adding a masternode to our system for monitoring purposes via API.

coinstats

Here is an example for the coinstats command:

[email protected]:~$ ./api.sh coinstats sys
{
  "success": true,
  "message": {
    "SYS": {
      "semantic_version": "4.1.3",
      "last_block": 474186,
      "block_age": 271,
      "statuses": {
        "ENABLED": 1631,
        "NEW_START_REQUIRED": 403,
        "PRE_ENABLED": 1,
        "OUTPOINT_SPENT": 1,
        "SENTINEL_PING_EXPIRED": 1
      },
      "usd_price": 0.02099545794,
      "btc_price": "0.00000278",
      "change_24h": 4.90566,
      "roi": 8.613080024799999,
      "collateral": 100000,
      "payout_sum_daily": "38487.48910023",
      "payout_count_daily": 1481,
      "payout_period": 95150.592,
      "daily_income": {
        "coin": 23.5975,
        "btc": "0.00006560",
        "usd": 0.4954
      },
      "links": {
        "Explorer": "http://explorer.blockchainfoundry.co",
        "WWW": "https://www.syscoin.org",
        "Twitter": "https://twitter.com/syscoin",
        "Discord": "https://discordapp.com/invite/RkK2AXD",
        "Telegram": "https://t.me/joinchat/AAAAAEHzByog3h1qutnjhQ",
        "Reddit": "http://reddit.com/r/syscoin",
        "Bitcointalk": "https://bitcointalk.org/index.php?topic=1466445.0",
        "Github": "https://github.com/syscoin/syscoin"
      }
    }
  }
}

as you can see, quite a lot of statistics being reported that you can integrate into your platform.  It shows the wallet version, last block, sum of masternode statuses, price stats and payout information, daily income and also the links that we hold for that coin (correct at time of writing).

status

This command is used for checking the status of masternodes registered in our system for monitoring via our API.  Here is an example:

[email protected]:~$ ./api.sh status payee txid
{
  "success": true,
  "message": {
    "status": "ENABLED",
    "last_paid_block_time": "2020-04-25 19:07:53",
    "last_payout_coin_value": "3.00000000",
    "lastseen": "2020-04-25 20:14:52",
    "current_version": 70919,
    "ip_address_port": "unavailable",
    "activetime": 11261789
  }
}

as you can see, the status of my node is ENABLED, when it was last paid out and how many coins were paid out.  You can see when it was lastseen on the network, what version and how long it's been active.  Some coins do provide the IP address and port, however in this instance, this is a wallet that doesn't display.  We therefore provide information in this field that it is "unavailable".

add / delete

Both of these commands output the same information, either true or false if it had problems adding it.  Problems are likely to be down to one of two things.  Either the payee address is incorrect, or either the TXID address is incorrect.  Therefore if you get such situation, you need to ensure that these are both correct.  So examples for these:

[email protected]:~$ ./api.sh add ticker payee txid
{
  "success": true
}

and now deleting the monitored node from our system:

[email protected]:~$ ./api.sh delete payee txid
{
  "success": true
}

so when replacing ticker/payee/txid in the first command will allow you to add the node to our system, to delete only requires the payee/txid - just like when making the status checks.

And that is everything related to our API.  We hope you enjoy this how-to and hope it gives a good insight to our API service!