# BTC Miner Data

This namespace contains endpoints to retrieve statistics on Bitcoin miners. We provide certain metrics such as rewards from coinbase or miners, the number of production reported from miners, the number of transaction and the number of address For more detailed information, please refer to the description of each metric.

## Companies

> This endpoint returns BTC mining company data.\
> Company data consists of statistical metrics based on rewards and production data for each mining company.\
> \`coinbase\_rewards\`, The daily amount of Bitcoin mined directly from a coinbase transaction. And \`coinbase\_rewards\` will only be added to \`mara\`.\
> \`other\_mining\_rewards\`, The daily amount of Bitcoin received as payment from a mining pool. Tipically, mining pools pay miners with Bitcoin from a coinbase transaction.\
> \`total\_rewards\`, The daily sum of coinbase rewards and other mining rewards (in number of Bitcoin).\
> \`accumulated\_monthly\_rewards\`, The daily running sum of total rewards in each month (in number of Bitcoin).\
> \`unique\_txn\`, The total number of Bitcoin transactions involving a mining reward.\
> \`active\_address\_count\`, The number of addresses from a company that received a block reward each day.\
> \`reported\_production\`, The company's reported total monthly production (in number of Bitcoin).\
> \`report\_accuracy\`, The ratio of accumulated monthly rewards to reported production times 100. It represents the % of total reported production captured by On-chain transactions.\
> \`closing\_usd\`, The daily closing price of Bitcoin in USD.\
> \`total\_daily\_rewards\_closing\_usd\`, Daily total rewards in USD using the closing usd price.\
> \`accumulated\_monthly\_rewards\_closing\_usd\`, accumulated monthly rewards in usd using the closing usd price.\
> \| Name         |   Miner    |\
> \|--------------|--------------|\
> \| MARA         |   \`mara\`   |\
> \| RIOT         |   \`riot\`   |\
> \| CORE         |   \`core\`   |\
> \| HIVE         |   \`hive\`   |\
> \| CLSK         |   \`clsk\`   |\
> \| BITF         |   \`bitf\`   |\
> \| CIPHER       |   \`cipher\` |\
> \| WULF         |   \`wulf\`   |\
> \| IREN         |   \`iren\`   |

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Miner Data","description":"This namespace contains endpoints to retrieve statistics on Bitcoin miners. We provide certain metrics such as rewards from coinbase or miners, the number of production reported from miners, the number of transaction and the number of address\n For more detailed information, please refer to the description of each metric."}],"servers":[{"url":"https://api.cryptoquant.com/v1/","description":"Default server"}],"security":[{"Access Token":[]}],"components":{"securitySchemes":{"Access Token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"For each API request, include this HTTP header:\n`Authorization` with the `Bearer {access_token}`. Bearer access token is the type of HTTP Authorization.  You have to include access token to the HTTP header and note that leading bearer is required.\nYou must include your access token in HTTP header in every request you make. The token is unique, issued for each client, and regularly changed(once a year). To obtain an access token, please [upgrade your plan](https://cryptoquant.com/pricing) to Professional or Premium plan. You'll be able to see your access token on the [API tab](https://cryptoquant.com/settings/api) of your profile page after the subscription."}},"parameters":{"miner_company":{"description":"A mining company from the table that we support. [See here](#tag/BTC-Miner-Data).","explode":false,"in":"query","name":"miner","required":true,"schema":{"type":"string"},"style":"form"},"window_dbh":{"description":"Currently we support `day`, `hour`, and `block`.","explode":false,"in":"query","name":"window","schema":{"type":"string","default":"day"},"style":"form"},"from":{"description":"This defines the starting time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the earliest time.","explode":false,"in":"query","name":"from","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"to":{"description":"This defines the ending time for which data will be gathered, formatted as YYYYMMDDTHHMMSS (indicating YYYY-MM-DDTHH:MM:SS, UTC time). If window=day is used, it can also be formatted as YYYYMMDD (date). If window=block is used, you can also specify the exact block height (e.g. 510000). If this field is not specified, response will include data from the latest time.","explode":false,"in":"query","name":"to","required":false,"schema":{"YYYYMMDDTHHMMSS":{"type":"string"}},"style":"form"},"limit":{"description":"The maximum number of entries to return before the latest data point (or before `to` if specified). This field ranges from 1 to 100,000.","explode":false,"in":"query","name":"limit","required":false,"schema":{"type":"integer","default":100,"minimum":1,"maximum":100000},"style":"form"},"format":{"description":"A format type about return message type. Supported formats are json, csv.","explode":false,"in":"query","name":"format","required":false,"schema":{"type":"string","default":"json"},"style":"form"}},"responses":{"Companies":{"description":"Company Data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompaniesResponse"}}}}},"schemas":{"CompaniesResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["data","window"],"properties":{"window":{"$ref":"#/components/schemas/Window_DBH"},"data":{"type":"array","items":{"type":"object","required":["block_bytes","coinbase_rewards","other_mining_rewards","total_rewards","accumulated_monthly_rewards","unique_txn","active_address_count","reported_production","report_accuracy","closing_usd","total_daily_rewards_closing_usd","accumulated_monthly_rewards_closing_usd"],"properties":{"date":{"$ref":"#/components/schemas/Date"},"coinbase_rewards":{"type":"decimal","description":"The daily amount of Bitcoin mined directly from a coinbase transaction."},"other_mining_rewards":{"type":"decimal","description":"The daily amount of Bitcoin received as payment from a mining pool. Tipically, mining pools pay miners with Bitcoin from a coinbase transaction."},"total_rewards":{"type":"decimal","description":"The daily sum of coinbase_rewards and Other Mining Rewards (in number of Bitcoin)."},"accumulated_monthly_rewards":{"type":"decimal","description":"The daily running sum of total_rewards in each month (in number of Bitcoin)."},"unique_txn":{"type":"decimal","description":"The total number of Bitcoin transactions involving a mining reward."},"active_address_count":{"type":"decimal","description":"The number of addresses from a company that received a block reward each day."},"reported_production":{"type":"decimal","description":"The company's reported total monthly production (in number of Bitcoin)."},"report_accuracy":{"type":"decimal","description":"The ratio of accumulated_monthly_rewards to reported_production times 100. It represents the % of total reported production captured by On-chain transactions."},"closing_usd":{"type":"decimal","description":"The daily closing price of Bitcoin in USD."},"total_daily_rewards_closing_usd":{"type":"decimal","description":"Daily total_rewards in USD using the closing_usd price."},"accumulated_monthly_rewards_closing_usd":{"type":"decimal","description":"accumulated_monthly_rewards in USD using the closing_usd price."}}}}}}}},"Status":{"type":"object","description":"The status object is return with most of requests and indicates if the request was successful. If it is not successful, error information is included.","properties":{"code":{"type":"integer","format":"int32","description":"HTTP status code"},"message":{"type":"string","description":"Text description of the error or success."}},"required":["code","message"]},"Window_DBH":{"type":"string","description":"The size of window. It can be day, hour, or block, and it depends on the user request."},"Date":{"type":"string","description":"The date in YYYY-DD-MM. This optional field only appears when window=day is used."}}},"paths":{"/btc/miner-data/companies":{"get":{"tags":["BTC Miner Data"],"summary":"Companies","operationId":"getCompanies","description":"This endpoint returns BTC mining company data.\nCompany data consists of statistical metrics based on rewards and production data for each mining company.\n`coinbase_rewards`, The daily amount of Bitcoin mined directly from a coinbase transaction. And `coinbase_rewards` will only be added to `mara`.\n`other_mining_rewards`, The daily amount of Bitcoin received as payment from a mining pool. Tipically, mining pools pay miners with Bitcoin from a coinbase transaction.\n`total_rewards`, The daily sum of coinbase rewards and other mining rewards (in number of Bitcoin).\n`accumulated_monthly_rewards`, The daily running sum of total rewards in each month (in number of Bitcoin).\n`unique_txn`, The total number of Bitcoin transactions involving a mining reward.\n`active_address_count`, The number of addresses from a company that received a block reward each day.\n`reported_production`, The company's reported total monthly production (in number of Bitcoin).\n`report_accuracy`, The ratio of accumulated monthly rewards to reported production times 100. It represents the % of total reported production captured by On-chain transactions.\n`closing_usd`, The daily closing price of Bitcoin in USD.\n`total_daily_rewards_closing_usd`, Daily total rewards in USD using the closing usd price.\n`accumulated_monthly_rewards_closing_usd`, accumulated monthly rewards in usd using the closing usd price.\n| Name         |   Miner    |\n|--------------|--------------|\n| MARA         |   `mara`   |\n| RIOT         |   `riot`   |\n| CORE         |   `core`   |\n| HIVE         |   `hive`   |\n| CLSK         |   `clsk`   |\n| BITF         |   `bitf`   |\n| CIPHER       |   `cipher` |\n| WULF         |   `wulf`   |\n| IREN         |   `iren`   |","parameters":[{"$ref":"#/components/parameters/miner_company"},{"$ref":"#/components/parameters/window_dbh"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/Companies"}}}}}}
```
