Luxor Documentation Hub Logo

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 | Span | Bucket (Default) | |:------|:---------------------| | 1D | 15s (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

GET
/hashprice

Authorization

X-Hi-Api-Key<token>

In: header

Query Parameters

spanstring

Time span

Default: "1M"Value in: "1D" | "7D" | "1M" | "3M" | "1Y" | "5Y" | "ALL"
bucketstring
Value in: "15s" | "5m" | "15m" | "1H" | "2H" | "6H" | "1D" | "7D"
currencyRequiredstring

Currency

Value in: "USD" | "BTC"
hashunitRequiredstring

Currency

Value in: "PHS" | "THS"
curl -X GET "https://api.hashrateindex.com/v1/hashrateindex/hashprice?span=1D&bucket=1H&currency=USD&hashunit=PHS" \
  -H "X-Hi-Api-Key: <token>"

OK

{
  "$schema": "https://api.hashrateindex.com/v1/hashrateindex/schemas/HashPriceData.json",
  "data": [
    {
      "price": 0.1,
      "timestamp": "2019-08-24T14:15:22Z"
    }
  ]
}