Metadata-Version: 2.4
Name: abelfeed-coinglass
Version: 0.1.2
Summary: Python SDK, CLI, and MCP client for CoinGlass crypto derivatives and Bitcoin ETF datasets.
Author: Abelfeed
License-Expression: MIT
Project-URL: Homepage, https://apify.com/abelfeed/coinglass-derivatives-fast-api
Project-URL: Repository, https://github.com/abelfeed/coinglass-derivatives-api
Project-URL: Issues, https://github.com/abelfeed/coinglass-derivatives-api/issues
Keywords: coinglass,crypto,derivatives,funding-rate,open-interest,liquidations,bitcoin-etf,apify,mcp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: apify-client>=1.8.0
Dynamic: license-file

# 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).
