canonical: https://jentic.com/apis/nicehash.com/nicehash

# NiceHash API

Jentic publishes the only available OpenAPI specification for NiceHash API, keeping it validated and agent-ready. NiceHash is a crypto-mining marketplace that connects miners selling hashing power to buyers placing hashpower orders against any supported algorithm. The API exposes public market data (active orders, multi-algorithm stats, supported currencies and algorithms), private hashpower marketplace operations (place, refill, cancel, and re-price orders), pool configuration, exchange trading data (trades, candlesticks, order book), and account and wallet operations including withdrawals.

## For AI agents

Place and manage NiceHash hashpower orders, query mining pools, read exchange market data, and move funds between accounts across 31 endpoints under api2.nicehash.com.

## Scope

Does not handle mining-rig configuration, electricity billing, or fiat on-ramps - use for NiceHash hashpower marketplace, exchange, and account operations only.

## Capabilities

- Read live global hashpower stats by algorithm through `/main/api/v2/public/stats/global/current`/
- Place a buyer hashpower order through POST `/main/api/v2/hashpower/order`/
- Refill or update price on an existing hashpower order through `/main/api/v2/hashpower/order/{orderId}/refill`/ and /updatePriceAndLimit/
- Cancel a hashpower order before it expires through DELETE `/main/api/v2/hashpower/order/{orderId}`
- Inspect account balances per currency through `/main/api/v2/accounting/account2/{currency}`
- Initiate a withdrawal to a registered address through POST `/main/api/v2/accounting/withdrawal`/
- Read exchange order book and candlesticks through `/exchange/api/v2/orderbook` and `/exchange/api/v2/candlesticks`

## Use cases

### Programmatic hashpower buying

A buyer can run a strategy that places, re-prices, and cancels hashpower orders based on the live NiceHash order book and external coin profitability feeds. POST `/main/api/v2/hashpower/order`/ creates the order, /updatePriceAndLimit/ adjusts the bid as market depth shifts, and DELETE cancels it once the run completes. The strategy can refill running orders without restarting them.

Example prompt: POST a hashpower order on the SCRYPT algorithm with a price of 0.5 BTC/PH/day for 24 hours, then call /updatePriceAndLimit/ if the order book moves more than 5%.

### Treasury and balance reconciliation

Operations and finance teams need to reconcile NiceHash balances against their internal ledgers. `/main/api/v2/accounting/accounts2`/ returns the full multi-currency balance sheet; `/accounting/account2/{currency}` drills into one asset; POST `/accounting/withdrawal`/ moves funds out to a pre-approved address. The X-Auth API-key header keeps each call scoped to a single account.

Example prompt: Call GET `/main/api/v2/accounting/account2/BTC` and post the available balance to a finance Slack channel each morning.

### Exchange market data ingestion

Quant teams can pull NiceHash exchange trades, candlesticks, and the order book into a market-data warehouse. `/exchange/api/v2/trades` and /candlesticks provide historical fills and OHLC, while /orderbook returns live depth - together enough to build a basic pricing or arbitrage signal.

Example prompt: Call GET `/exchange/api/v2/candlesticks`?market=BTCUSDT&resolution=1440 and store the daily candles in a Postgres table.

### AI agent crypto mining operations

An AI ops agent can monitor active hashpower orders, refill them when they near depletion, and cancel underperforming runs. Through Jentic, the agent searches by intent and Jentic returns the right NiceHash endpoint with its schema. The X-Auth signed key never enters the agent's chat context.

Example prompt: Search Jentic for 'cancel a hashpower order', load the DELETE `/main/api/v2/hashpower/order/{orderId}` schema, and execute it for the order ID returned by /myOrders.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/main/api/v2/hashpower/order/` | Create a new hashpower order |
| DELETE | `/main/api/v2/hashpower/order/{orderId}` | Cancel a hashpower order |
| POST | `/main/api/v2/hashpower/order/{orderId}/refill/` | Refill an existing hashpower order |
| GET | `/main/api/v2/hashpower/myOrders` | List the caller's hashpower orders |
| GET | `/main/api/v2/accounting/accounts2/` | Get balances for every supported currency |
| POST | `/main/api/v2/accounting/withdrawal/` | Create a withdrawal to a registered address |
| GET | `/exchange/api/v2/orderbook` | Get the live exchange order book for a market |
| GET | `/main/api/v2/public/stats/global/current/` | Get current global hashpower stats |

## Key resources

- **Public** — Public market data: global stats, active orders, supported currencies, algorithms, and markets
- **Hashpower** — Place, refill, re-price, cancel, and list buyer hashpower orders
- **Pools** — Create and manage mining pool definitions used by buyer orders
- **Accounting** — Multi-currency balances, withdrawal addresses, and withdrawal creation
- **Exchange** — NiceHash exchange status, trades, candlesticks, and order book

## Why Jentic

- **Setup:** Wiring NiceHash by hand means building its X-Auth signed header, choosing the production or test host, and handling its request signing yourself. Through Jentic you install once, import the NiceHash API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** NiceHash puts the order id in the URL path (`/main/api/v2/hashpower/order/{orderId}/...`), so a rule can pin your agent to one hashpower order: it can refill that order and read it, and nothing else. You choose the operations it may call, so destructive ones like order cancellation or account withdrawal are not included unless you add them.
- **Credential handling:** Your NiceHash API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'place a hashpower order' or 'check my account balances', and Jentic returns the matching NiceHash operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Binance API** — Binance offers a much broader spot and derivatives exchange API, though without the hashpower marketplace component.
- **Kraken API** — Kraken is a regulated spot and futures exchange API used as an alternative venue for moving NiceHash mining proceeds.
- **CoinGecko API** — CoinGecko provides cross-exchange price reference data that complements NiceHash's own order book.
- **CoinMarketCap API** — CoinMarketCap supplies coin market caps and global metrics used to assess mining profitability for NiceHash buyers.

## FAQ

### Why is there no official OpenAPI spec for NiceHash API?

NiceHash does not publish a maintained OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call NiceHash API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the NiceHash API use?

NiceHash uses an apiKey scheme passed in the X-Auth request header. The key is signed against organisation, API key, and timestamp values per NiceHash's signing rules. Through Jentic, the X-Auth key is stored encrypted in the vault and never enters the agent's context.

### Can I cancel a hashpower order via the API?

Yes. Call DELETE `/main/api/v2/hashpower/order/{orderId}` with the order ID returned from `/main/api/v2/hashpower/myOrders.` The order is cancelled immediately and any unspent balance is returned to the buyer's account.

### What are the rate limits for the NiceHash API?

NiceHash applies rate limits per API key and per IP, but does not publish exact thresholds in the OpenAPI spec. Expect HTTP 429 responses if a single key issues sustained heavy traffic; back off and retry after the indicated cooldown.

### How do I place a hashpower order through Jentic?

Run pip install jentic, then search Jentic for 'place a hashpower order'. Load the POST `/main/api/v2/hashpower/order`/ schema, supply algorithm, market, price, and limit fields, and execute. Jentic signs the X-Auth header for you.

### Is the NiceHash API free to use?

API access is free for NiceHash account holders. Trades, hashpower orders, and withdrawals incur the usual NiceHash fees published on the marketplace; the API itself does not add a separate charge.

### Can I limit what my agent is allowed to do with the NiceHash API?

Yes. Because you run Jentic One yourself, your own rules decide which NiceHash operations and credentials your agent may use, so destructive calls like DELETE `/main/api/v2/hashpower/order/{orderId}` or POST `/main/api/v2/accounting/withdrawal`/ are excluded unless you explicitly add them. Since NiceHash puts the order id in the URL path, a rule can pin your agent to a single hashpower order, letting it refill and read that one order through `/main/api/v2/hashpower/order/{orderId}/refill`/ and nothing else. You can also grant read-only access to public and exchange market data such as `/exchange/api/v2/orderbook` while withholding any account or trading endpoint.
