APIs

All APIs return JSON format. We suggest to wait at least 3 seconds between API calls. Current API version: 1.2.6

  • General
  • Public
  • Private
General

General syntax

https://api.nicehash.com/api?method=methodname&parameter1=parameter1value&parameter2=parameter2value...

Changelog

Changes 1.2.6:
- Method stats.provider.ex reports current profitability for each algorithm
- Added optional parameter from for method stats.provider.ex
- Method stats.provider.workers reports connected location (stratum proxy) for each worker

Changes 1.2.5:
- Method stats.provider does not need location parameter anymore (merged stats)
- Added method stats.provider.ex for detailed statistics (including history)
- Added method stats.provider.workers

Changes 1.2.4:
- Method stats.global.current has optional location parameter

Changes 1.2.3:
- Removed need for parameter location for methods stats.global.current and stats.global.24h
- Methods stats.global.current and stats.global.24h do not return multi-algorithm statistics anymore

Algorithms

Algorithms are marked with following numbers:

0 = Scrypt
1 = SHA256
2 = ScryptNf
3 = X11
4 = X13
5 = Keccak
6 = X15
7 = Nist5
8 = NeoScrypt
9 = Lyra2RE
10 = WhirlpoolX
11 = Qubit
12 = Quark
13 = Axiom
14 = Lyra2REv2
15 = ScryptJaneNf16
16 = Blake256r8
17 = Blake256r14
18 = Blake256r8vnl
19 = Hodl
20 = DaggerHashimoto
21 = Decred
22 = CryptoNight
23 = Lbry
24 = Equihash
25 = Pascal
26 = X11Gost
27 = Sia
28 = Blake2s
29 = Skunk

Orders

Order types are marked with following numbers:

0 = standard order
1 = fixed order

Public

No method

https://api.nicehash.com/api

Get API version. Query this to detect any changes of API.

Parameters:
- None

Returned value:

{"result":{"api_version":"1.0.1"},"method":null}

stats.global.current

https://api.nicehash.com/api?method=stats.global.current

Get current profitability (price) and hashing speed for all algorithms. Refreshed every 30 seconds.

Parameters:
- location: 0 for Europe, 1 for USA. This parameter is optional and method will return combined statistics if not provided.

Returned value:

{"result":{"stats":[{"profitability_above_ltc":"8.27","price":"0.1683","profitability_ltc":"0.1554","algo":0,"speed":"27.0678"},{"price":"0.0117","profitability_btc":"0.0114","profitability_above_btc":"2.39","algo":1,"speed":"1597723.0669"},{"profitability_above_ltc":"89.98","price":"0.5906","profitability_ltc":"0.1554","algo":2,"speed":"0.0038"},{"profitability_above_ltc":"610.26","price":"0.2007","profitability_ltc":"0.1554","algo":3,"speed":"24.9009"},{"profitability_above_ltc":"119.72","price":"0.0854","profitability_ltc":"0.1554","algo":4,"speed":"0.5826"},{"profitability_above_ltc":"190.79","price":"0.0009","profitability_ltc":"0.1554","algo":5,"speed":"2.6436"},{"profitability_above_ltc":"123.75","price":"0.0994","profitability_ltc":"0.1554","algo":6,"speed":"0.0275"},{"profitability_above_ltc":"-100.00","price":"0.0000","profitability_ltc":"0.1554","algo":7,"speed":"0.0000"},{"profitability_above_ltc":"405.27","price":"2.6180","profitability_ltc":"0.1554","algo":8,"speed":"0.1194"},{"profitability_above_ltc":"293.06","price":"0.4888","profitability_ltc":"0.1554","algo":9,"speed":"0.0346"}]},"method":"stats.global.current"}

stats.global.24h

https://api.nicehash.com/api?method=stats.global.24h

Get average profitability (price) and hashing speed for all algorithms in past 24 hours.

Parameters:
- None

Returned value:

{"result":{"stats":[{"price":"0.1962","algo":0,"speed":"23.8031"},{"price":"0.0118","algo":1,"speed":"1576060.6047"},{"price":"0.3759","algo":2,"speed":"0.0041"},{"price":"0.1998","algo":3,"speed":"25.0689"},{"price":"0.2213","algo":4,"speed":"1.5202"},{"price":"0.0008","algo":5,"speed":"2.4735"},{"price":"0.1559","algo":6,"speed":"0.0324"},{"price":"0.0000","algo":7,"speed":"0.0000"},{"price":"2.9811","algo":8,"speed":"0.1268"},{"price":"0.4853","algo":9,"speed":"0.0304"}]},"method":"stats.global.24h"}

stats.provider

https://api.nicehash.com/api?method=stats.provider&addr=1P5PNW6Wd53QiZLdCs9EXNHmuPTX3rD6hW

Get current stats for provider for all algorithms. Refreshed every 30 seconds. It also returns past 56 payments.

Parameters:
- addr - Provider's BTC address.

Returned value:

{"result":{"stats":[{"balance":"0.00010688","rejected_speed":"0.0000","algo":0,"accepted_speed":"0.0820"},{"balance":"0.00000000","rejected_speed":"0.0000","algo":2,"accepted_speed":"0.0000"},{"balance":"0.00000000","rejected_speed":"0.0000","algo":3,"accepted_speed":"0.0000"},{"balance":"0.00000000","rejected_speed":"0.0000","algo":4,"accepted_speed":"0.0000"},{"balance":"0.00000000","rejected_speed":"0.0000","algo":6,"accepted_speed":"0.0000"},{"balance":"0.00000000","rejected_speed":"0.0000","algo":7,"accepted_speed":"0.0000"}],"payments":[{"amount":"0.01604289","fee":"0.00032741","TXID":"e47ce45771b4bb80b52cb787c95eca0bb0779cb5cb7a9af437d1b13e450db7a5","time":"2015-01-22 17:03:27"}],"addr":"16dZdWFr6bhy5bxwsyUyunuWED8zWfQiYA"},"method":"stats.provider"}

stats.provider.ex

https://api.nicehash.com/api?method=stats.provider.ex&addr=17a212wdrvEXWuipCV5gcfxdALfMdhMoqh

Get detailed stats for provider for all algorithms including history data and payments in past 7 days.

Parameters:
- addr - Provider's BTC address;
- from - Get history data from this time (UNIX timestamp). This parameter is optional and is by default considered to be 0 (return complete history).

Returned value (trimmed and with comments for easier understanding):

{"method":"stats.provider.ex",
"result":{
	"addr":"17a212wdrvEXWuipCV5gcfxdALfMdhMoqh",
	"current":[{
		"algo":3, // algorithm number (3 = X11)
		"name":"X11", // algorithm name
		"suffix":"MH", // speed suffix (kH, MH, GH, TH,...)
		"profitability":"0.00045845", // current profitability in BTC/suffix/Day
		"data":[{ // speed object can contain following fields:
			  // a (accepted), rt (rejected target), rs (rejected stale),
			  // rd (rejected duplicate) and ro (rejected other)
			  // if fields are not present, speed is 0
			"a":"23.09", // accepted speed (in MH/s for X11)
			"rs":"0.54", // rejected speed - stale
			},
			"0.0001234" // balance (unpaid)
		]},
		... // other algorithms here
	],
	"past":[{
		"algo":3,
		"data":[
			[4863234, // timestamp; multiply with 300 to get UNIX timestamp
			{"a":"28.6"}, // speed object
			"0" // balance (unpaid)
			],[4863235,{"a":"27.4"},"0.00000345"],
			... // next entries with inc. timestamps
		]},
		... // other algorithms here
	],
	"payments":[{
		"amount":"0.00431400",
		"fee":"0.00023000",
		"TXID":"txidhere",
		"time":1453538732, // UNIX timestamp
		"type":0 // payment type (0 for standard NiceHash payment)
	},
	... // other payments here
	]
	}
}

stats.provider.workers

https://api.nicehash.com/api?method=stats.provider.workers&addr=17a212wdrvEXWuipCV5gcfxdALfMdhMoqh&algo=3

Get detailed stats for provider's workers (rigs).

Parameters:
- addr - Provider's BTC address;
- algo - Algorithm marked with ID.

Returned value (trimmed and with comments for easier understanding):

{
"method":"stats.provider.workers",
"result":{
	"addr":"17a212wdrvEXWuipCV5gcfxdALfMdhMoqh",
	"algo":3,
	"workers":[[
		"rigname", // name of the worker
		{"a":"11.02","rs":"0.54"}, // speed object
		15, // time connected (minutes)
		1, // 1 = xnsub enabled, 0 = xnsub disabled
		"0.1", // difficulty
		0, // connected to location (0 for EU, 1 for US, 2 for HK and 3 for JP)
	],
	... // other workers here	
	]
}
}

orders.get

https://api.nicehash.com/api?method=orders.get&location=0&algo=3

Get all orders for certain algorithm. Refreshed every 30 seconds.

Parameters:
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID.

Returned value:

{"result":{"orders":[{"type":0,"id":5877,"price":"0.0505","algo":1,"alive":true,"limit_speed":"1.0","workers":0,"accepted_speed":0.0}]},"method":"orders.get"}

multialgo.info

https://api.nicehash.com/api?method=multialgo.info

Get information about Mult-Algorithm Mining.

Parameters:
- None

Returned value:

{"result":{"multialgo":[{"default_factor":1.0,"port":4333,"name":"Scrypt","algo":0},{"default_factor":0.5,"port":4335,"name":"Scrypt-A.-Nf.","algo":2},{"default_factor":5.5,"port":4336,"name":"X11","algo":3},{"default_factor":4.0,"port":4337,"name":"X13","algo":4},{"default_factor":500.0,"port":4338,"name":"Keccak","algo":5},{"default_factor":3.5,"port":4339,"name":"X15","algo":6},{"default_factor":16.0,"port":4340,"name":"Nist5","algo":7},{"default_factor":0.3,"port":4341,"name":"NeoScrypt","algo":8},{"default_factor":1.25,"port":4342,"name":"Lyra2RE","algo":9}]},"method":"multialgo.info"}

simplemultialgo.info

https://api.nicehash.com/api?method=simplemultialgo.info

Get information about Simple Multi-Algorithm Mining. Read morehere.

Parameters:
- None

Returned value:

{"result":{"simplemultialgo":[{"paying":"0.147686","port":3333,"name":"scrypt","algo":0},{"paying":"0.00000781","port":3334,"name":"sha256","algo":1},{"paying":"0.001512","port":3335,"name":"scryptnf","algo":2},{"paying":"0.330078","port":3336,"name":"X11","algo":3},{"paying":"0.38065","port":3337,"name":"x13","algo":4},{"paying":"0.001615","port":3338,"name":"keccak","algo":5},{"paying":"0.00121","port":3339,"name":"x15","algo":6},{"paying":"0","port":3340,"name":"nist5","algo":7},{"paying":"6.053761","port":3341,"name":"neoscrypt","algo":8},{"paying":"0.30008","port":3342,"name":"lyra2re","algo":9},{"paying":"0.0063","port":3343,"name":"whirlpoolx","algo":10},{"paying":"0.195998","port":3344,"name":"qubit","algo":11},{"paying":"0.274617","port":3345,"name":"quark","algo":12},{"paying":"424","port":3346,"name":"axiom","algo":13},{"paying":"0.42777","port":3347,"name":"lyra2rev2","algo":14}]},"method":"simplemultialgo.info"}

buy.info

https://api.nicehash.com/api?method=buy.info

Get needed information for buying hashing power using NiceHashBot.

Parameters:
- None

Returned value:

{"result":{"algorithms":[{"down_step":"-0.0010","min_limit":"0.1","speed_text":"GH","name":"Scrypt","algo":0,"multi":"1"},{"down_step":"-0.0001","min_limit":"5","speed_text":"TH","name":"SHA256","algo":1,"multi":"0.001"},{"down_step":"-0.0020","min_limit":"0.01","speed_text":"GH","name":"ScryptNf","algo":2,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.05","speed_text":"GH","name":"X11","algo":3,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.02","speed_text":"GH","name":"X13","algo":4,"multi":"1"},{"down_step":"-0.0001","min_limit":"10","speed_text":"GH","name":"Keccak","algo":5,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.02","speed_text":"GH","name":"X15","algo":6,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.1","speed_text":"GH","name":"Nist5","algo":7,"multi":"1"},{"down_step":"-0.0100","min_limit":"0.01","speed_text":"GH","name":"NeoScrypt","algo":8,"multi":"1"},{"down_step":"-0.0020","min_limit":"0.01","speed_text":"GH","name":"Lyra2RE","algo":9,"multi":"1"},{"down_step":"-0.0001","min_limit":"2","speed_text":"GH","name":"WhirlpoolX","algo":10,"multi":"1"},{"down_step":"-0.0005","min_limit":"0.06","speed_text":"GH","name":"Qubit","algo":11,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.05","speed_text":"GH","name":"Quark","algo":12,"multi":"1"},{"down_step":"-0.0001","min_limit":"1","speed_text":"kH","name":"Axiom","algo":13,"multi":"1000000"},{"down_step":"-0.0010","min_limit":"0.04","speed_text":"GH","name":"Lyra2REv2","algo":14,"multi":"1"},{"down_step":"-0.0010","min_limit":"0.01","speed_text":"MH","name":"ScryptJaneNf16","algo":15,"multi":"1000"}],"down_time":600},"method":"buy.info"}
Private

orders.get&my

https://api.nicehash.com/api?method=orders.get&my&id=8&key=a8dd01d7-a4de-44ad-8e8f-ddaa7a2e0bd4&location=0&algo=0

Get all orders for certain algorithm owned by the customer. Refreshed every 30 seconds.

Parameters:
- id - API ID;
- key - API Key or ReadOnly API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID.

Returned value:

{"result":{"orders":[{"type":0,"btc_avail":"0.01751439","limit_speed":"0.0","pool_user":"worker","pool_port":3333,"alive":false,"workers":0,"pool_pass":"x","accepted_speed":0.0,"id":1879,"algo":0,"price":"1.0000","btc_paid":"0.00000000","pool_host":"testpool.com","end":1413294447421}]},"method":"orders.get"}

orders.create

https://api.nicehash.com/api?method=orders.create&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&amount=0.01&price=2.9&limit=0&pool_host=testpool.com&pool_port=3333&pool_user=worker&pool_pass=x

Create new order. Only standard orders can be created with use of API.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- amount - Pay amount in BTC;
- price - Price in BTC/GH/day or BTC/TH/day;
- limit - Speed limit in GH/s or TH/s (0 for no limit);
- pool_host - Pool hostname or IP;
- pool_port - Pool port;
- pool_user - Pool username;
- pool_pass - Pool password;
- code - This parameter is optional. You have to provide it if you have 2FA enabled. You can use NiceHash2FA Java application to generate codes.

Returned value:

{"result":{"success":"Order #5569 created."},"method":"orders.create"}

orders.refill

https://api.nicehash.com/api?method=orders.refill&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&order=123&amount=0.01

Refill order with extra Bitcoins.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- order - Order ID;
- amount - Refill amount in BTC.

Returned value:

{"result":{"success":"Order #123 refilled."},"method":"orders.refill"}

orders.remove

https://api.nicehash.com/api?method=orders.remove&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&order=1880

Remove existing order.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- order - Order ID/number.

Returned value:

{"result":{"success":"Order removed."},"method":"orders.remove"}

orders.set.price

https://api.nicehash.com/api?method=orders.set.price&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&order=1881&price=2.1

Set new price for the existing order. Only increase is possible.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- order - Order ID/number;
- price - Price in BTC/GH/Day or BTC/TH/Day.

Returned value:

{"result":{"success":"New order price set to: 2.10"},"method":"orders.set.price"}

orders.set.price.decrease

https://api.nicehash.com/api?method=orders.set.price.decrease&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&order=1881

Decrease price for the existing order. Price decrease possible every 10 minutes. Readhelp for more information.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- order - Order ID/number.

Returned value:

{"result":{"success":"New order price set to: 2.10"},"method":"orders.set.price.decrease"}

orders.set.limit

https://api.nicehash.com/api?method=orders.set.limit&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17&location=0&algo=0&order=1881&limit=1.0

Set new limit for the existing order.

Parameters:
- id - API ID;
- key - API Key;
- location - 0 for Europe (NiceHash), 1 for USA (WestHash);
- algo - Algorithm marked with ID;
- order - Order ID/number;
- limit - Speed limit in GH/s or TH/s (0 for no limit).

Returned value:

{"result":{"success":"New order limit set to: 1.00"},"method":"orders.set.limit"}

balance

https://api.nicehash.com/api?method=balance&id=8&key=3583b1df-5e93-4ba0-96d7-7d621fe15a17

Get current confirmed Bitcoin balance.

Parameters:
- id - API ID;
- key - API Key or ReadOnly API Key.

Returned value:

{"result":{"balance_confirmed":"0.00500000","balance_pending":"0.00000000"},"method":"balance"}