A C++ API wrapper for the NiceHash cloud cryptomining service.
-
cURL libs (e.g. Fedora: libcurl-devel, Ubuntu/Debian: libcurl-dev)
-
CMake >= 3.1
See example CMakeLists.txt in the examples/ folder that uses ExternalProject to integrate nicehash-api-cpp with an existing CMake project.
Alternatively, manually build the library as below, then link libnicehash-api-cpp.so.
git clone https://github.com/4iar/nicehash-api-cpp.git && cd nicehash-api-cpp
mkdir build && cd build
cmake ..
make
Offline documentation can be built using doxygen
make doc
#include <nicehash-api.hpp>
...
// Initialise client
NiceHashApi niceHashApi;
// Run a query
// (see docs below for all API functions)
std::string algorithm_name = "equihash";
std::string stats = niceHashApi.getOrdersByAlgorithm(algorithm_name, 0)
Official documentation @ NiceHash.com
niceHashApi.getApiVersion()
Get current profitability (price) and hashing speed for all algorithms. Refreshed every 30 seconds.
niceHashApi.getAverageGlobalStats()
Get average profitability (price) and hashing speed for all algorithms in past 24 hours.
niceHashApi.getCurrentGlobalStats()
Get current stats for provider for all algorithms. Refreshed every 30 seconds. It also returns past 56 payments.
niceHashApi.getProviderStats (std::string address)
Get detailed stats for provider for all algorithms including history data and past 56 payments.
niceHashApi.getDetailedProviderStats (std::string address)
Get detailed stats for provider's workers (rigs).
niceHashApi.getProviderWorkerStats (std::string address, int algorithm_id)
or
niceHashApi.getProviderWorkerStats (std::string address, std::string algorithm_name)
Get all orders for certain algorithm. Refreshed every 30 seconds.
niceHashApi.getOrdersByAlgorithm (int algorithm_id, int location_id)
or
niceHashApi.getOrdersByAlgorithm (std::string algorithm_name, int location_id)
Get information about Multi-Algorithm Mining.
Get information about Simple Multi-Algorithm Mining.