Hashrate IndexAPI DocumentationHashprice

Get Hashprice

GET
/hashprice

/hashprice has rate limitation:

Initially, the API allows for a burst of 20 requests, and afterward, it gradually restores 1 request every 15 seconds until reaching the maximum allowable limit of 20. This limitation is imposed to manage and control the rate at which requests can be made to the API, preventing potential misuse or excessive use of resources.

Hash Price Retrieval

This endpoint provides the current price per hash unit for mining Bitcoin, allowing users to understand the real-time profitability and cost-effectiveness of mining operations. The response includes the price in the specified currency and per the specified hash unit, adjusted for the defined time span and aggregation bucket.

Valid Span-Bucket Combinations with Default Bucket
SpanBucket (Default)
1D15s (Diamond Tier), (5m), 15m
7D(1H)
1M(1H), 2H
3M(1H), 6H
1Y(6H)
5Y(6H), 1D
ALL(7D)

(X) -> default bucket for the span

Authorization

ApiKeyAuth
X-Hi-Api-Key<token>

In: header

Query Parameters

span?string

Time span

Default"1M"

Value in

  • "1D"
  • "7D"
  • "1M"
  • "3M"
  • "1Y"
  • "5Y"
  • "ALL"
bucket?string

Value in

  • "15s"
  • "5m"
  • "15m"
  • "1H"
  • "2H"
  • "6H"
  • "1D"
  • "7D"
currency*string

Currency

Value in

  • "USD"
  • "BTC"
hashunit*string

Currency

Value in

  • "PHS"
  • "THS"

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/hashprice?span=1D&bucket=1H&currency=USD&hashunit=PHS"
{  "$schema": "https://api.hashrateindex.com/v1/hashrateindex/schemas/HashPriceData.json",  "data": [    {      "price": 0.1,      "timestamp": "2019-08-24T14:15:22Z"    }  ]}
{  "$schema": "https://api.hashrateindex.com/v1/hashrateindex/schemas/ErrorModel.json",  "detail": "Property foo is required but is missing.",  "errors": [    {      "location": "string",      "message": "string",      "value": null    }  ],  "instance": "https://example.com/error-log/abc123",  "status": 400,  "title": "Bad Request",  "type": "https://example.com/errors/example"}
{  "$schema": "https://api.hashrateindex.com/v1/hashrateindex/schemas/ErrorModel.json",  "detail": "Property foo is required but is missing.",  "errors": [    {      "location": "string",      "message": "string",      "value": null    }  ],  "instance": "https://example.com/error-log/abc123",  "status": 400,  "title": "Bad Request",  "type": "https://example.com/errors/example"}
{  "$schema": "https://api.hashrateindex.com/v1/hashrateindex/schemas/ErrorModel.json",  "detail": "Property foo is required but is missing.",  "errors": [    {      "location": "string",      "message": "string",      "value": null    }  ],  "instance": "https://example.com/error-log/abc123",  "status": 400,  "title": "Bad Request",  "type": "https://example.com/errors/example"}