Metadata-Version: 2.5
Name: web-traffic-api
Version: 1.0.0
Summary: Top website / web traffic leaderboard via the Trends API live feeds. Competitive intel as JSON.
Project-URL: Homepage, https://trendsapi.ai
Project-URL: Documentation, https://trendsapi.ai/#quickstart
Project-URL: Repository, https://github.com/trendsapi-ai/web-traffic-api
Project-URL: Bug Tracker, https://github.com/trendsapi-ai/web-traffic-api/issues
Project-URL: Get API key, https://trendsapi.ai/#get-key
Author-email: Trends API <hello@trendsapi.ai>
License-Expression: MIT
License-File: LICENSE
Keywords: competitive-intelligence,trendsapi,web-traffic,website-rank
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: trendsapi>=1.0.0
Description-Content-Type: text/markdown

# Website traffic-rank API

Top website / web traffic leaderboard via the Trends API live feeds. Competitive intel as JSON.

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![PyPI](https://img.shields.io/pypi/v/web-traffic-api.svg)](https://pypi.org/project/web-traffic-api/)

Key: [trendsapi.ai/#get-key](https://trendsapi.ai/#get-key). Full contract: [trendsapi-ai/trendsapi](https://github.com/trendsapi-ai/trendsapi).

JS: [`web-traffic-api`](https://www.npmjs.com/package/web-traffic-api).

## Install

```bash
pip install web-traffic-api
```

```python
from web_traffic_api import TrendsAPI

client = TrendsAPI()  # TRENDSAPI_KEY
sites = client.get_top_websites(limit=25)
```

`get_top_websites()` presets `type: "Top Websites"`. Override `source=` for any other platform. Official full client: [`trendsapi`](https://pypi.org/project/trendsapi/).

## Call

| Field | Value |
|---|---|
| Endpoint | `POST https://api.trendsapi.ai/api` |
| Auth | `Authorization: Bearer $TRENDSAPI_KEY` |
| Mode | `get_top_trends` |
| `type` | `Top Websites` (exact capitalization) |
| Optional | `category`, `limit`, `offset` |

```bash
curl -sS -X POST https://api.trendsapi.ai/api \
  -H "Authorization: Bearer $TRENDSAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mode":"get_top_trends","type":"Top Websites","limit":25}'
```

There is no `source: web traffic` (that string is 400).

Parsed `data` is `[rank, hostname]` pairs.

This is third-party rank estimation, not Google Analytics.

Site: [https://trendsapi.ai/trends/web-traffic](https://trendsapi.ai/trends/web-traffic). GitHub: [trendsapi-ai/web-traffic-api](https://github.com/trendsapi-ai/web-traffic-api).

## License

MIT. See [LICENSE](LICENSE).
