Skip to main content
Glama
io.github.abelfeed/coinglass-derivatives

io.github.abelfeed/coinglass-derivatives

README.md
# CoinGlass Derivatives API (Python SDK, CLI & MCP)

[![CI](https://github.com/abelfeed/coinglass-derivatives-api/actions/workflows/ci.yml/badge.svg)](https://github.com/abelfeed/coinglass-derivatives-api/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/abelfeed-coinglass.svg)](https://pypi.org/project/abelfeed-coinglass/)
[![Python](https://img.shields.io/pypi/pyversions/abelfeed-coinglass.svg)](https://pypi.org/project/abelfeed-coinglass/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Open-source Python client, CLI (`coinglass-fetch`), and Model Context Protocol (MCP) manifest for querying CoinGlass public crypto derivatives and Bitcoin ETF datasets.

## Supported Datasets

`futures_markets` · `funding_rates` · `open_interest` · `liquidations` · `long_short_ratio` · `spot_rsi` · `btc_etf_list` · `btc_etf_history` · `btc_etf_inflows` · `global_stats`

## Installation

```bash
pip install abelfeed-coinglass
export APIFY_TOKEN="your_apify_token"
```

## Python Usage

```python
from abelfeed_coinglass import CoinGlassClient

client = CoinGlassClient()
rows = client.fetch(
    dataset="open_interest",
    symbols=["BTC", "ETH", "SOL"],
    max_results=50,
)
print(rows[0])
```

## CLI Usage

```bash
# Funding rates across major perpetual exchanges
coinglass-fetch --dataset funding_rates --max-results 50

# BTC, ETH, and SOL liquidations
coinglass-fetch --dataset liquidations --symbols BTC,ETH,SOL --time-type 1 --max-results 50
```

## MCP Server (Claude Desktop / Cursor / VS Code)

Registered on the Official MCP Registry as `io.github.abelfeed/coinglass-derivatives` (see [server.json](server.json)):

```json
{
  "mcpServers": {
    "abelfeed-coinglass": {
      "url": "https://mcp.apify.com/?tools=abelfeed/coinglass-derivatives-fast-api",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

## Development & Testing

```bash
pip install -e . pytest
pytest -v
```

## Hosted Backend & Security

This package is a thin MIT-licensed wrapper around the hosted Apify Actor [`abelfeed/coinglass-derivatives-fast-api`](https://apify.com/abelfeed/coinglass-derivatives-fast-api). See [SECURITY.md](SECURITY.md) for vulnerability disclosure and OIDC Trusted Publishing details.

## License

MIT - see [LICENSE](LICENSE).