> For the complete documentation index, see [llms.txt](https://ordnull.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ordnull.gitbook.io/api/compatibility-apis/prices.md).

# Prices

## Get Current Bitcoin Price

> Returns the current Bitcoin price in USD along with the timestamp

```json
{"openapi":"3.0.0","info":{"title":"Ordinals & Runes Compatibility API","version":"3.0"},"servers":[{"url":"https://api.ordnull.site/v3","description":"Production server"}],"paths":{"/x/btc/price":{"get":{"summary":"Get Current Bitcoin Price","description":"Returns the current Bitcoin price in USD along with the timestamp","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PriceData"},"block_height":{"type":"integer","description":"Current block height"}}}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"PriceData":{"type":"object","properties":{"time":{"type":"integer","description":"Unix timestamp of the price data"},"price":{"type":"object","properties":{"usd":{"type":"string","description":"The current Bitcoin price in USD"}}}}},"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}}}
```

## Get Historical Bitcoin Prices

> Returns historical Bitcoin prices for a range of blocks starting from a specified block height

```json
{"openapi":"3.0.0","info":{"title":"Ordinals & Runes Compatibility API","version":"3.0"},"servers":[{"url":"https://api.ordnull.site/v3","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-Key"}},"schemas":{"BlockPrice":{"type":"object","properties":{"block_height":{"type":"integer","description":"The block height"},"block_time":{"type":"integer","description":"Unix timestamp of when the block was mined"},"price_usd":{"type":"string","nullable":true,"description":"The Bitcoin price in USD at this block height"}}},"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error message"}}}}},"paths":{"/x/btc/price_history":{"get":{"summary":"Get Historical Bitcoin Prices","description":"Returns historical Bitcoin prices for a range of blocks starting from a specified block height","parameters":[{"name":"start_block_height","in":"query","required":true,"schema":{"type":"integer","minimum":0},"description":"The block height to start retrieving prices from"},{"name":"count","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"The number of block prices to retrieve"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BlockPrice"}},"block_height":{"type":"integer","description":"Current block height"}}}}}},"403":{"description":"Invalid API Key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
