> 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"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ordnull.gitbook.io/api/compatibility-apis/prices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
