Complete API docs can be found here
Some sample code is available on GitHub
List of public API methods for new NiceHash platform
GET https://api2.nicehash.com/main/api/v2/public/apiVersion
returns current api version
params: none
response: 2.0GET https://api2.nicehash.com/main/api/v2/public/simplemultialgo/info
returns current paying prices and speed for algorithms
params: none
response:
{
"miningAlgorithms":[
{
"algorithm":"SCRYPT", //algo
"title":"Scrypt", //algo title
"speed":"564155.85754444", //speed
"paying":"0.0000286" //paying (sat/[H/Sol/G]/day)
},...
]
}usage example https://docs.google.com/spreadsheets/d/17vBfvOrDrIqB9YYXkxzyWzfxl1QMjp4wh-XrHRxNGw0/edit#gid=0GET https://api2.nicehash.com/main/api/v2/mining/algorithms
returns various settings for algorithms
params: none
response:
{
"miningAlgorithms":[
{
"algorithm":"SCRYPT",
"title":"Scrypt",
"enabled":true,
"order":0, //in stats/global/current and stats/global/24h
"displayMiningFactor":"MH",
"miningFactor":"1000000",
"displayMarketFactor":"TH",
"marketFactor":"1000000000000", //multiply speeds and paying to get base unit value
"minimalOrderAmount":"0.005",
"minSpeedLimit":"0.01",
"maxSpeedLimit":"10000",
"priceDownStep":"-0.001",
"minimalPoolDifficulty":"500000",
"port":3333,
"color":"#afafaf",
"ordersEnabled":true
},...
]
}GET https://api2.nicehash.com/main/api/v2/public/buy/info
returns various settings for buying hashrate
params: none
response:
{
"miningAlgorithms":[
{
"down_step":-0.001, //maximal price decrease
"min_diff_working":1000000,
"min_limit":0.0100, //minimal hashing speed
"max_limit":10000.00, //maximal hashing speed
"speed_text":"TH",
"min_diff_initial":500000,
"name":"Scrypt", //algo title
"algo":0, //algo id
"multi":0.0010, //multiplication factor
"min_price":0.0001, //minimal order price btc/unit/day
"max_price":100, //maximal order price btc/unit/day
"min_amount":0.005 //minimal order amount
},...
]
}GET https://api2.nicehash.com/main/api/v2/public/stats/global/current
returns compact output for 5min avg paying prices and speed for algorithms
params: none
response:
{
"algos":[
{
"a":0, //algo id
"p":2.8610988402508662E-5, //paying (sat/[H/Sol/G]/day)
"s":5.391889057281688E11, //speed
"r":1200, //rigs
"o":16, //orders
},...
]
}GET https://api2.nicehash.com/main/api/v2/public/stats/global/24h
returns compact output for 24h avg paying prices and speed for algorithms
params: none
response:
{
"algos":[
{
"a":0, //algo id
"p":2.8567227636210757E-5, //paying (sat/[H/Sol/G]/day)
"s":5.4664173399627893E11, //speed
"r":1311, //rigs
"o":32, //orders
},
...]
}
}GET https://api2.nicehash.com/main/api/v2/public/orders/active2?algorithm=SCRYPT
returns all active orders for the SCRYPT
params:
algorithm: SCRYPT | SHA256 | SCRYPTNF | X11 | X13 | KECCAK | X15 | NIST5 | NEOSCRYPT | LYRA2RE | WHIRLPOOLX | QUBIT | QUARK | AXIOM | LYRA2REV2 | SCRYPTJANENF16 | BLAKE256R8 | BLAKE256R14 | BLAKE256R8VNL | HODL | DAGGERHASHIMOTO | DECRED | CRYPTONIGHT | LBRY | EQUIHASH | PASCAL | X11GOST | SIA | BLAKE2S | SKUNK | CRYPTONIGHTV7 | CRYPTONIGHTHEAVY | LYRA2Z | X16R | CRYPTONIGHTV8 | SHA256ASICBOOST | ZHASH | BEAM | GRINCUCKAROO29 | GRINCUCKATOO31 | LYRA2REV3 | CRYPTONIGHTR | CUCKOOCYCLE
response:
{
"list": [
{
"id": "b8b185a1-0781-4183-87d0-6b77e0f3256a", //order id
"type": "STANDARD", //order type: STANDARD | FIXED
"market": "EU", //order market: EU | USA
"algorithm": "SCRYPT" //algo
"price": "0.2912", //order price
"speedLimit": "0.01", //order speed limit
"alive": true, //alive true | false
"acceptedCurrentSpeed": "0.01076605", //current accepted speed
"rigsCount": 149 //order rigs
},
...]
}
}GET https://api2.nicehash.com/main/api/v2/public/orders?algorithm={ALGO}&market={MARKET}&op={OP}×tamp={TIMESTAMP}&page={PAGE}
returns all system orders
params:
algorithm: SCRYPT | SHA256 | SCRYPTNF | X11 | X13 | KECCAK | X15 | NIST5 | NEOSCRYPT | LYRA2RE | WHIRLPOOLX | QUBIT | QUARK | AXIOM | LYRA2REV2 | SCRYPTJANENF16 | BLAKE256R8 | BLAKE256R14 | BLAKE256R8VNL | HODL | DAGGERHASHIMOTO | DECRED | CRYPTONIGHT | LBRY | EQUIHASH | PASCAL | X11GOST | SIA | BLAKE2S | SKUNK | CRYPTONIGHTV7 | CRYPTONIGHTHEAVY | LYRA2Z | X16R | CRYPTONIGHTV8 | SHA256ASICBOOST | ZHASH | BEAM | GRINCUCKAROO29 | GRINCUCKATOO31 | LYRA2REV3 | CRYPTONIGHTR | CUCKOOCYCLE
market: EU | US
op: GT | GE | LT | LE than timestamp
timestamp: timestamp (now)
page: int (0)
size: int (100)
response:
{
"list": [
{
"id": "b8b185a1-0781-4183-87d0-6b77e0f3256a", //order id
"estimateDurationInSeconds": 0, //estimated order duration
"type": { //order type: standard | fixed
"code": "STANDARD",
"description": "Standard"
},
"market": "EU", //order market: EU | USA
"algorithm": {
"algorithm": "SCRYPT", //algo
"title": "Scrypt", --
"enabled": true, --
"order": 0 --
},
"price": "0.2912", //order price
"limit": "0.01", //order speed limit
"alive": true, //alive true | false
"acceptedCurrentSpeed": "0.01076605", //current accepted speed
"rigsCount": 149 //order rigs
},
...]
}
}GET https://api2.nicehash.com/main/api/v2/public/service/fee/info
returns current fees per gateway/coin
params: none
response:
{
"deposit": {
"BITGO": {
"rules": {
"BTC": {
"coin": "BTC",
"intervals": [
{
"start": 0,
"end": 0.005,
"element": {
"value": 0.0001,
"type": "ABSOLUTE"
}
},
{
"start": 0.005,
"end": null,
"element": {
"value": 0,
"type": "ABSOLUTE"
}
}
]
},
},...
},...
}
},
"withdrawal": {
"BITGO": {
"rules": {
"BTC": {
"coin": "BTC",
"intervals": [
{
"start": 0.001,
"end": null,
"element": {
"value": 0.003509173567772093,
"type": "PERCENTAGE"
}
}
]
},...
},...
}
}
}
}GET https://api2.nicehash.com/main/api/v2/public/service/minconfirmations/info
returns required deposit confirmations per coin
params: none
response:
{
"COINBASE": {
"rules": {
"BTC": {
"coin": "BTC",
"intervals": [
{
"start": 0,
"end": null,
"element": 3
}
],...
}
},
"PAYEER": {
"rules": {
"BTC": {
"coin": "BTC",
"intervals": [
{
"start": 0,
"end": null,
"element": 3
}
],...
}
}
}GET https://api2.nicehash.com/main/api/v2/public/algo/history?algorithm={ALGO}
returns algo history pricing in 15min intervals
params:
algorithm: SCRYPT | SHA256 | SCRYPTNF | X11 | X13 | KECCAK | X15 | NIST5 | NEOSCRYPT | LYRA2RE | WHIRLPOOLX | QUBIT | QUARK | AXIOM | LYRA2REV2 | SCRYPTJANENF16 | BLAKE256R8 | BLAKE256R14 | BLAKE256R8VNL | HODL | DAGGERHASHIMOTO | DECRED | CRYPTONIGHT | LBRY | EQUIHASH | PASCAL | X11GOST | SIA | BLAKE2S | SKUNK | CRYPTONIGHTV7 | CRYPTONIGHTHEAVY | LYRA2Z | X16R | CRYPTONIGHTV8 | SHA256ASICBOOST | ZHASH | BEAM | GRINCUCKAROO29 | GRINCUCKATOO31 | LYRA2REV3 | CRYPTONIGHTR | CUCKOOCYCLE
response:
[
[
1562913900, //time
144835201288.80908, //speed
0.000022842510670099434 //paying
],...
]API rate limiting
NiceHash uses API rate limiting. For registered users rate limit is per organization. When hit rate limit system will respond with HTTP 429 and two additional headers (so you can optimize your API behaviour):
- Retry-After: time_window_in_seconds
- X-RateLimit-Limit: current limit for your organization
NiceHash Simple Multi-Algorithm Mining
We have designed Simple Multi-Algorithm Mining for two reasons:
- To remove the unnecessary connection overhead with previous Multi-Algorithm mining.
- To transfer control of the algorithm selection process to miner.
- Miner's discretion on which algorithm to mine (and no longer ours).
- Using standard 3xxx ports.
- Already made and simple to use open source C function, which tells your miner which algorithm is currently the most profitable.
- Reduced connection overhead. Miner uses only one connection to our service and periodically queries HTTP API for information.
- Opportunity to upgrade mining software with better algorithm switching with no added overhead.
- No more dealing with messy huge config files.
- Query our HTTP API https://api2.nicehash.com/main/api/v2/public/simplemultialgo/info to get information about profitability.
- Decide which algorithm is the most profitable.
- If already mining the most profitable algorithm, wait 60 seconds and go to 1.
- Establish a connection for mining the most profitable algorithm and wait for work (job).
- Unload previous work (old algorithm) and prepare for the new algorithm (new job).
- Mine the new algorithm (new job).
- Go to 1.
C function to get information about profitability and decide on the most profitable algorithm can be found in our GitHub repository.
Mining software needs to use the appropriate NiceHash stratum URL when switching the algorithm. URLs follow the scheme stratum+tcp://{algo}.auto.nicehash.com:9200 or stratum+ssl://{algo}.auto.nicehash.com:443 as you can see here. Use the name of the algorithm in lower case.
We recommend the mining software to perform a benchmark of algorithms to detect the appropriate factors (speeds), thus relieving miners from setting factors manually.
Support for subscribe.extranonce: GitHub
Other relevant and important stuff: GitHub