# Lightning

## Lightning Network Base Fee (Median)

> \*\*Definition.\*\* The median base fee in the Lightning Network in Satoshi, derived from the channel graph.\n\n\*\*Technical.\*\* Base fees are paid for each payment routed through a channel. Payments between two peers that share a direct channel connection incur no fee.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.BaseFeeMedian?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/base_fee_median":{"get":{"summary":"Lightning Network Base Fee (Median)","description":"**Definition.** The median base fee in the Lightning Network in Satoshi, derived from the channel graph.\\n\\n**Technical.** Base fees are paid for each payment routed through a channel. Payments between two peers that share a direct channel connection incur no fee.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.BaseFeeMedian?a=BTC)\n","operationId":"lightning.BaseFeeMedian","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"c","in":"query","required":false,"description":"currency - NATIVE, USD","schema":{"type":"string"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Capacity

> \*\*Definition.\*\* The total amount locked in the Lightning Network.\n\n\*\*Technical.\*\* The Bitcoin Lightning Network is a Layer 2 payment protocol built on top of the Bitcoin blockchain, designed to provide faster, cheaper, and more scalable transactions than traditional on-chain Bitcoin transactions. Only public channels announced to the routing graph are counted, so BTC held in private channels is excluded.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.NetworkCapacitySum?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/network_capacity_sum":{"get":{"summary":"Lightning Network Capacity","description":"**Definition.** The total amount locked in the Lightning Network.\\n\\n**Technical.** The Bitcoin Lightning Network is a Layer 2 payment protocol built on top of the Bitcoin blockchain, designed to provide faster, cheaper, and more scalable transactions than traditional on-chain Bitcoin transactions. Only public channels announced to the routing graph are counted, so BTC held in private channels is excluded.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.NetworkCapacitySum?a=BTC)\n","operationId":"lightning.NetworkCapacitySum","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"c","in":"query","required":false,"description":"currency - NATIVE, USD","schema":{"type":"string"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Channel Size (Mean)

> \*\*Definition.\*\* The mean BTC size of public Lightning Network channels.\n\n\*\*Technical.\*\* The Lightning Network works by creating payment channels between two parties, where multiple transactions can be made without the need for each individual transaction to be recorded on the Bitcoin blockchain. These transactions are instead recorded off-chain, which makes them faster and cheaper.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.ChannelSizeMean?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/channel_size_mean":{"get":{"summary":"Lightning Network Channel Size (Mean)","description":"**Definition.** The mean BTC size of public Lightning Network channels.\\n\\n**Technical.** The Lightning Network works by creating payment channels between two parties, where multiple transactions can be made without the need for each individual transaction to be recorded on the Bitcoin blockchain. These transactions are instead recorded off-chain, which makes them faster and cheaper.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.ChannelSizeMean?a=BTC)\n","operationId":"lightning.ChannelSizeMean","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"c","in":"query","required":false,"description":"currency - NATIVE, USD","schema":{"type":"string"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Channel Size (Median)

> \*\*Definition.\*\* The median size of public Lightning Network channels.\n\n\*\*Technical.\*\* The Lightning Network creates bilateral payment channels between two parties, allowing multiple transactions to settle off-chain without each individual transaction being recorded on the Bitcoin blockchain, which makes them faster and cheaper.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.ChannelSizeMedian?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/channel_size_median":{"get":{"summary":"Lightning Network Channel Size (Median)","description":"**Definition.** The median size of public Lightning Network channels.\\n\\n**Technical.** The Lightning Network creates bilateral payment channels between two parties, allowing multiple transactions to settle off-chain without each individual transaction being recorded on the Bitcoin blockchain, which makes them faster and cheaper.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.ChannelSizeMedian?a=BTC)\n","operationId":"lightning.ChannelSizeMedian","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"c","in":"query","required":false,"description":"currency - NATIVE, USD","schema":{"type":"string"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Fee Rate (Median)

> \*\*Definition.\*\* The median fee rate in the Lightning Network, derived from the channel graph and expressed in units of sat / BTC. A value of 1000 indicates that a fee of 1000 Satoshi is required to transfer 1 BTC.\n\n\*\*Technical.\*\* On top of a base fee, payment fees are proportional to the transferred amount.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.FeeRateMedian?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/fee_rate_median":{"get":{"summary":"Lightning Network Fee Rate (Median)","description":"**Definition.** The median fee rate in the Lightning Network, derived from the channel graph and expressed in units of sat / BTC. A value of 1000 indicates that a fee of 1000 Satoshi is required to transfer 1 BTC.\\n\\n**Technical.** On top of a base fee, payment fees are proportional to the transferred amount.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.FeeRateMedian?a=BTC)\n","operationId":"lightning.FeeRateMedian","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Gini Capacity Distribution

> \*\*Definition.\*\* Lightning Network Gini Coefficient (Capacity Distribution) is a statistical measure of how Bitcoin capacity is distributed across nodes on the Lightning Network, used to monitor the degree of centralization and the potential risks associated with highly concentrated capacity.\n\n\*\*Technical.\*\* The coefficient is computed by comparing the actual distribution of Bitcoin capacity across nodes to a hypothetical uniform distribution. It ranges from 0 to 1, with 0 representing perfect equality and 1 representing maximum inequality.\n\n\*\*Interpretation.\*\* A higher Gini coefficient indicates a more unequal distribution of Bitcoin capacity across nodes, while a lower coefficient indicates a more even distribution.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.GiniCapacityDistribution?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/gini_capacity_distribution":{"get":{"summary":"Lightning Network Gini Capacity Distribution","description":"**Definition.** Lightning Network Gini Coefficient (Capacity Distribution) is a statistical measure of how Bitcoin capacity is distributed across nodes on the Lightning Network, used to monitor the degree of centralization and the potential risks associated with highly concentrated capacity.\\n\\n**Technical.** The coefficient is computed by comparing the actual distribution of Bitcoin capacity across nodes to a hypothetical uniform distribution. It ranges from 0 to 1, with 0 representing perfect equality and 1 representing maximum inequality.\\n\\n**Interpretation.** A higher Gini coefficient indicates a more unequal distribution of Bitcoin capacity across nodes, while a lower coefficient indicates a more even distribution.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.GiniCapacityDistribution?a=BTC)\n","operationId":"lightning.GiniCapacityDistribution","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Gini Channel Distribution

> \*\*Definition.\*\* Lightning Network Gini Coefficient (Channel Distribution) is a statistical measure of how channel counts are distributed across nodes on the Lightning Network, used to monitor the degree of centralization and the potential risks associated with highly concentrated node influence.\n\n\*\*Technical.\*\* The coefficient is computed by comparing the actual distribution of channels across nodes to a hypothetical uniform distribution. It ranges from 0 to 1, with 0 representing perfect equality and 1 representing maximum inequality.\n\n\*\*Interpretation.\*\* A higher Gini coefficient indicates a more unequal distribution of channel counts across nodes, while a lower coefficient indicates a more even distribution.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.GiniChannelDistribution?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/gini_channel_distribution":{"get":{"summary":"Lightning Network Gini Channel Distribution","description":"**Definition.** Lightning Network Gini Coefficient (Channel Distribution) is a statistical measure of how channel counts are distributed across nodes on the Lightning Network, used to monitor the degree of centralization and the potential risks associated with highly concentrated node influence.\\n\\n**Technical.** The coefficient is computed by comparing the actual distribution of channels across nodes to a hypothetical uniform distribution. It ranges from 0 to 1, with 0 representing perfect equality and 1 representing maximum inequality.\\n\\n**Interpretation.** A higher Gini coefficient indicates a more unequal distribution of channel counts across nodes, while a lower coefficient indicates a more even distribution.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.GiniChannelDistribution?a=BTC)\n","operationId":"lightning.GiniChannelDistribution","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Node Connectivity

> \*\*Definition.\*\* The number of nodes in the Lightning Network connected via IP, TOR, or both.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.NodeConnectivity?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/node_connectivity":{"get":{"summary":"Lightning Network Node Connectivity","description":"**Definition.** The number of nodes in the Lightning Network connected via IP, TOR, or both.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.NodeConnectivity?a=BTC)\n","operationId":"lightning.NodeConnectivity","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Number of Channels

> \*\*Definition.\*\* The number of public Lightning Network channels. The Lightning Network works by creating payment channels between two parties, where multiple transactions can be made without each individual transaction being recorded on the Bitcoin blockchain. These transactions are instead recorded off-chain, which makes them faster and cheaper.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.ChannelsCount?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/channels_count":{"get":{"summary":"Lightning Network Number of Channels","description":"**Definition.** The number of public Lightning Network channels. The Lightning Network works by creating payment channels between two parties, where multiple transactions can be made without each individual transaction being recorded on the Bitcoin blockchain. These transactions are instead recorded off-chain, which makes them faster and cheaper.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.ChannelsCount?a=BTC)\n","operationId":"lightning.ChannelsCount","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Lightning Network Number of Nodes

> \*\*Definition.\*\* The number of Lightning Network nodes.\n\n\*\*Technical.\*\* Only nodes gossiping on the public routing graph are counted.\n\
> \
> \[View in Studio]\(<https://studio.glassnode.com/charts/lightning.NodesCount?a=BTC>)<br>

```json
{"openapi":"3.0.3","info":{"title":"Glassnode API - lightning","version":"1.0.0"},"servers":[{"url":"https://api.glassnode.com","description":"Production API server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"query","name":"api_key","description":"Your Glassnode API key"}},"schemas":{"TimeSeriesResponse":{"type":"array","items":{"$ref":"#/components/schemas/TimeSeriesDataPoint"}},"TimeSeriesDataPoint":{"type":"object","properties":{"t":{"type":"integer","format":"int64","description":"Unix timestamp"},"v":{"oneOf":[{"type":"number"},{"type":"object"},{"type":"array"}],"description":"Metric value (can be number, object, or array depending on the metric)"},"o":{"type":"object","description":"Object containing multiple metric values (when applicable)","additionalProperties":true}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/metrics/lightning/nodes_count":{"get":{"summary":"Lightning Network Number of Nodes","description":"**Definition.** The number of Lightning Network nodes.\\n\\n**Technical.** Only nodes gossiping on the public routing graph are counted.\\n\n\n[View in Studio](https://studio.glassnode.com/charts/lightning.NodesCount?a=BTC)\n","operationId":"lightning.NodesCount","parameters":[{"name":"a","in":"query","required":true,"description":"asset id - (see metadata (metadata/metric) page for more details)}","schema":{"type":"string"},"style":"form","explode":false},{"name":"s","in":"query","required":false,"description":"since, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"u","in":"query","required":false,"description":"until, unix timestamp","schema":{"type":"integer"},"style":"form","explode":false},{"name":"i","in":"query","required":false,"description":"frequency interval - 10m, 1h, 24h","schema":{"type":"string"},"style":"form","explode":false},{"name":"f","in":"query","required":false,"description":"format - csv, json","schema":{"type":"string","enum":["csv","json"],"default":"json"},"style":"form","explode":false},{"name":"timestamp_format","in":"query","required":false,"description":"timestamp format - unix or humanized (RFC 3339)","schema":{"type":"string","enum":["unix","humanized"],"default":"unix"},"style":"form","explode":false}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeSeriesResponse"}}}},"400":{"description":"Bad Request - Invalid parameters or unsupported asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Invalid or missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# 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://docs.glassnode.com/basic-api/endpoints/lightning.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.
