Metadata-Version: 2.4
Name: abelfeed-clickbank
Version: 0.1.2
Summary: Python SDK, CLI, and MCP client for ClickBank Marketplace offers and affiliate metrics.
Author: Abelfeed
License-Expression: MIT
Project-URL: Homepage, https://apify.com/abelfeed/clickbank-marketplace-fast-api
Project-URL: Repository, https://github.com/abelfeed/clickbank-marketplace-api
Project-URL: Issues, https://github.com/abelfeed/clickbank-marketplace-api/issues
Keywords: clickbank,affiliate-marketing,marketplace,gravity,epc,offers,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

# ClickBank Marketplace API (Python SDK, CLI & MCP)

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

Open-source Python client, CLI (`clickbank-fetch`), and Model Context Protocol (MCP) manifest for querying ClickBank Marketplace offers (Gravity, BI Gravity, Net/Initial/Future EPC, Avg $/Sale, Rebill, Conversion Rate, and Return Rate).

## Supported Sort Fields

`rank` · `gravity` · `bi_gravity` · `popularity` · `average_epc` · `initial_epc` · `future_epc` · `net_epc` · `conversion_rate`

## Installation

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

## Python Usage

```python
from abelfeed_clickbank import ClickBankClient

client = ClickBankClient()
offers = client.fetch(
    sort_field="net_epc",
    sort_descending=True,
    rebill_only=True,
    min_gravity=10,
    max_results=50,
)
print(offers[0]["vendorId"], offers[0]["gravity"], offers[0]["netEPC"])
```

## CLI Usage

```bash
clickbank-fetch --sort-field gravity --sort-descending --max-results 50
```

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

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

```json
{
  "mcpServers": {
    "abelfeed-clickbank": {
      "url": "https://mcp.apify.com/?tools=abelfeed/clickbank-marketplace-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/clickbank-marketplace-fast-api`](https://apify.com/abelfeed/clickbank-marketplace-fast-api). See [SECURITY.md](SECURITY.md) for vulnerability disclosure and OIDC Trusted Publishing details.

## License

MIT - see [LICENSE](LICENSE).
