# BTC Lightning Network Statistics

This namespace contains endpoints to retrieve statistics on Lightning Network. We provide certain metrics such as the number of channel, nodes and network capacity from lightning network. For more detailed information, please refer to the description of each metric.

## BTC Lightning Network Statistics

> Lightning Network Statistics contains various metrics which are calculated from lightning network.\
> \
> \<br>\
> \
> \### Supported Stats\
> \| Stas                             | Description                                            |\
> \|----------------------------------|--------------------------------------------------------|\
> \| \`network\_capacity\`               | The total network capacity (sum of balances available across all lightning payment channels) (BTC)  |\
> \| \`network\_capacity\_usd\`           | The total network capacity (sum of balances available across all lightning payment channels) (USD)  |\
> \| \`capacity\_per\_channel\_mean\`      | The average channel capacity (BTC)                                                                  |\
> \| \`capacity\_per\_channel\_mean\_usd\`  | The average channel capacity (USD)                                                                  |\
> \| \`capacity\_per\_node\_mean\`         | The average node capacity (BTC)                                                                     |\
> \| \`capacity\_per\_node\_mean\_usd\`     | The average node capacity (USD)                                                                     |\
> \| \`number\_of\_node\`                 | The total number of available nodes (Number)                                                        |\
> \| \`number\_of\_channel\`              | The total number of available payment channels  (Number)                                            |\
> \| \`channel\_per\_node\_mean\`          | The average number of channels per node    (Number)                                                 |\
> \| \`node\_age\_days\`                  | The average day of duration of nodes (Number)                                                       |\
> \| \`channel\_age\_days\`               | The average day of duration of channels (Number)                                                    |\
> \| \`base\_fee\_median\`                | The median base fee of transactions (Sat)                                                           |\
> \| \`base\_fee\_median\_usd\`            | The median base fee of transactions (USD)                                                           |\
> \| \`fee\_rate\_median\`                | The median fee rates of transactions (Sat)                                                          |\
> \| \`fee\_rate\_median\_usd\`            | The median fee rates of transactions (USD)                                                          |\
> \
> \<br>\
> \
> \### Supported Windows\
> \
> \| Supported Windows |\
> \|-------------------|\
> \| \`hour\`, \`day\*\`    |\
> \
> \> (\*) Default

```json
{"openapi":"3.0.0","info":{"title":"CryptoQuant Data API","version":"1.3.0"},"tags":[{"name":"BTC Lightning Network Statistics","description":"This namespace contains endpoints to retrieve statistics on Lightning Network. We provide certain metrics such as the number of channel, nodes and network capacity from lightning network.\nFor 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":{"window_dh":{"description":"Currently, we support `day` and `hour`.","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":{"responses_stats-in-total":{"description":"BTC Lightning Network Stats","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BTCLightningNetworkStatsInTotalResponse"}}}}},"schemas":{"BTCLightningNetworkStatsInTotalResponse":{"type":"object","required":["status","result"],"properties":{"status":{"$ref":"#/components/schemas/Status"},"result":{"type":"object","required":["window","data"],"properties":{"window":{"$ref":"#/components/schemas/Window_DH"},"data":{"type":"array","items":{"type":"object","required":["date","network_capacity","network_capacity_usd","capacity_per_channel_mean","capacity_per_channel_mean_usd","capacity_per_node_mean","capacity_per_node_mean_usd","number_of_node","number_of_channel","channel_per_node_mean","node_age_days","channel_age_days","base_fee_median","base_fee_median_usd","fee_rate_median","fee_rate_median_usd"],"properties":{"date":{"$ref":"#/components/schemas/Datetime"},"network_capacity":{"type":"decimal","description":"The total network capacity (sum of balances available across all lightning payment channels) (BTC)"},"network_capacity_usd":{"type":"decimal","description":"The total network capacity (sum of balances available across all lightning payment channels) (USD)"},"capacity_per_channel_mean":{"type":"decimal","description":"The average channel capacity (BTC)"},"capacity_per_channel_mean_usd":{"type":"decimal","description":"The average channel capacity (USD)"},"capacity_per_node_mean":{"type":"decimal","description":"The average node capacity (BTC)"},"capacity_per_node_mean_usd":{"type":"decimal","description":"The average node capacity (USD)"},"number_of_node":{"type":"integer","description":"The total number of available nodes (Number)"},"number_of_channel":{"type":"integer","description":"The total number of available payment channels  (Number)"},"channel_per_node_mean":{"type":"decimal","description":"The average number of channels per node    (Number)"},"node_age_days":{"type":"decimal","description":"The average day of duration of nodes (Number)"},"channel_age_days":{"type":"decimal","description":"The average day of duration of channels (Number)"},"base_fee_median":{"type":"decimal","description":"The median base fee of transactions (Sat)"},"base_fee_median_usd":{"type":"decimal","description":"The median base fee of transactions (USD)"},"fee_rate_median":{"type":"decimal","description":"The median fee rates of transactions (Sat)"},"fee_rate_median_usd":{"type":"decimal","description":"The median fee rates of transactions (USD)"}}}}}}}},"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_DH":{"type":"string","description":"The size of window. It can be day or hour, and it depends on the user request."},"Datetime":{"type":"string","description":"The date and time formatted as YYYY-MM-DD HH:MM:SS (UTC time). This field only appears when window=block is used."}}},"paths":{"/btc/lightning-network/stats-in-total":{"get":{"tags":["BTC Lightning Network Statistics"],"summary":"BTC Lightning Network Statistics","description":"Lightning Network Statistics contains various metrics which are calculated from lightning network.\n\n<br>\n\n### Supported Stats\n| Stas                             | Description                                            |\n|----------------------------------|--------------------------------------------------------|\n| `network_capacity`               | The total network capacity (sum of balances available across all lightning payment channels) (BTC)  |\n| `network_capacity_usd`           | The total network capacity (sum of balances available across all lightning payment channels) (USD)  |\n| `capacity_per_channel_mean`      | The average channel capacity (BTC)                                                                  |\n| `capacity_per_channel_mean_usd`  | The average channel capacity (USD)                                                                  |\n| `capacity_per_node_mean`         | The average node capacity (BTC)                                                                     |\n| `capacity_per_node_mean_usd`     | The average node capacity (USD)                                                                     |\n| `number_of_node`                 | The total number of available nodes (Number)                                                        |\n| `number_of_channel`              | The total number of available payment channels  (Number)                                            |\n| `channel_per_node_mean`          | The average number of channels per node    (Number)                                                 |\n| `node_age_days`                  | The average day of duration of nodes (Number)                                                       |\n| `channel_age_days`               | The average day of duration of channels (Number)                                                    |\n| `base_fee_median`                | The median base fee of transactions (Sat)                                                           |\n| `base_fee_median_usd`            | The median base fee of transactions (USD)                                                           |\n| `fee_rate_median`                | The median fee rates of transactions (Sat)                                                          |\n| `fee_rate_median_usd`            | The median fee rates of transactions (USD)                                                          |\n\n<br>\n\n### Supported Windows\n\n| Supported Windows |\n|-------------------|\n| `hour`, `day*`    |\n\n> (*) Default","operationId":"getBTCLightningNetworkStatsInTotal","parameters":[{"$ref":"#/components/parameters/window_dh"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/format"}],"responses":{"200":{"$ref":"#/components/responses/responses_stats-in-total"}}}}}}
```
