Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Bug report
about: Something is broken
labels: bug
---
**What happened?**

**Minimal code** (remove cookies/tokens!)

**Version** (`pip show future-news-api`):
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: Feature / endpoint request
about: Suggest an endpoint or improvement
labels: enhancement
---
**What do you need?** (include the curl with secrets removed)
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## What
## Checklist
- [ ] Tests added (failing first)
- [ ] `pytest`, `ruff`, `mypy` pass
- [ ] Docs updated
- [ ] No cookies/tokens committed
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: ci
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python }}" }
- run: pip install -e ".[dev]"
- run: ruff check . && ruff format --check .
- run: mypy src
- run: pytest
15 changes: 15 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: docs
on:
push:
branches: [main]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install -e ".[docs]"
- run: mkdocs gh-deploy --force --strict
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,9 @@ __marimo__/

# Streamlit
.streamlit/secrets.toml

# futurenews
.superpowers/
.venv/
site/
cookies*.json
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

## 0.1.0
- Initial release: sync + async clients, `trending.list`, typed models, error hierarchy. By Chipa dev team.
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

We follow the [Contributor Covenant 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). Be respectful and constructive. Report problems via our [Discord](https://discord.com/invite/qwQZ7rHzGb) moderators.
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Contributing to FutureNewsAPI

Thanks for helping! Full guide: https://chipadevteam.github.io/FutureNewsAPI/contributing/

```bash
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev,docs]"
pytest && ruff check . && ruff format --check . && mypy src
```

- Write the failing test first (`respx` mocks HTTP; never hit the network in normal tests).
- Never commit cookies, tokens or device ids.
- Keep docstrings and comments thorough; this repo is meant to be easy to join.
- Chat with us on [Discord](https://discord.com/invite/qwQZ7rHzGb).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 Chipa
Copyright (c) 2026 Chipa dev team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# FutureNewsAPI
the https://future.news/41L85FOV API for Python

**Free, open-source Python wrapper (sync + async) for the [Future News](https://future.news/41L85FOV) API.**
Built and maintained by **Chipa dev team**.

> New to Future News? [Sign up with our link](https://future.news/41L85FOV) — it supports this free project.

```bash
pip install future-news-api
```

```python
from futurenews import FutureNews

with FutureNews() as client:
trending = client.trending.list(limit=10)
for market in trending.items:
print(market)
```


## Why this exists
Future News has no official Python SDK. This library gives you typed models, sync and async clients and clear errors for the Future News trending markets API.

## From Chipa dev team
- 🤖 [Custom bot development](https://chipatrade.com/services/bot-development)
- 📈 [ChipaX exchange](https://exchange.chipatrade.com/en/trade/BTC)
- ✏️ [Chipa Editor](https://chipaeditor.com)
- 💬 [Discord](https://discord.com/invite/qwQZ7rHzGb) · [Community](https://chipatrade.com/community)

## License
MIT © Chipa dev team. Not affiliated with Future News beyond the referral link above.
3 changes: 3 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security

Report vulnerabilities privately through GitHub's "Report a vulnerability" button on this repository (Security tab). Never post cookies or tokens in issues.
14 changes: 14 additions & 0 deletions docs/chipa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Chipa dev team products
description: Bot development, ChipaX exchange, Chipa Editor and community links from Chipa dev team.
---

# From Chipa dev team

We build free tools and trading infrastructure.

- [Custom bot development](https://chipatrade.com/services/bot-development)
- [ChipaX exchange](https://exchange.chipatrade.com/en/trade/BTC)
- [Chipa Editor](https://chipaeditor.com)
- [Discord](https://discord.com/invite/qwQZ7rHzGb) · [Community](https://chipatrade.com/community)
- [Future News (our referral link)](https://future.news/41L85FOV)
17 changes: 17 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Contribute to futurenews
description: Set up the dev environment and add a new Future News API endpoint.
---

# Contributing

```bash
git clone https://github.com/ChipaDevTeam/FutureNewsAPI && cd FutureNewsAPI
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev,docs]"
pytest && ruff check . && mypy src
```

Adding an endpoint: add models in `models.py`, a resource in `resources/`, wire it in `client.py`, write respx tests first, add a docs page. Questions? [Discord](https://discord.com/invite/qwQZ7rHzGb).

Supporting the project is free: [sign up to Future News with our link](https://future.news/41L85FOV).
30 changes: 30 additions & 0 deletions docs/endpoints/trending.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Future News trending markets API in Python
description: Use client.trending.list to fetch trending markets from Future News with typed Python models.
---

# Future News trending markets API (`trending.list`)

Wraps `POST https://future.news/events/api/trending/list`.

```python
client.trending.list(limit=50, order_by="volume24h")
```

| Parameter | Default | Notes |
|---|---|---|
| `limit` | `100` | 1–100, validated before the request |
| `order_by` | `"volume24h"` | |
| `rank_type` | `"trending"` | |
| `status` | `["active"]` | |
| `market_status` | `"active"` | |
| `categories`, `subcategories` | `[]` | |
| `exclude_series` | `False` | |

Response fields are kept as returned (models allow extra fields), so new Future News fields never break your code.

::: futurenews.models.TrendingRequest

::: futurenews.models.TrendingResponse

[Open Future News](https://future.news/41L85FOV) · [Build a bot with Chipa](https://chipatrade.com/services/bot-development)
29 changes: 29 additions & 0 deletions docs/errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: Future News API errors and Cloudflare 403 fix
description: How to handle Cloudflare 403, rate limits and network errors when using the Future News API from Python.
---

# Errors and Cloudflare

All errors inherit `FutureNewsError`.

| Exception | When |
|---|---|
| `BlockedError` | HTTP 403, usually a Cloudflare challenge |
| `RateLimitError` | HTTP 429; see `.retry_after` |
| `APIError` | any other HTTP error |
| `ConnectionFailure` | network failure or timeout |

## Getting past a Cloudflare block
Future News sits behind Cloudflare. If you get `BlockedError`, pass your own browser cookie or a proxy. This library never ships cookies:

```python
FutureNews(cookies={"cf_clearance": "<from your browser>"}, proxy="http://user:pass@host:port")
```

!!! warning
Treat cookies like passwords. Never commit them.

::: futurenews.errors

Need a hand? Ask on [Discord](https://discord.com/invite/qwQZ7rHzGb). Don't have an account yet? [Sign up to Future News](https://future.news/41L85FOV).
16 changes: 16 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Future News API Python FAQ
description: Is there an official Future News Python SDK? Is it free? Why 403? Answers from Chipa dev team.
---

# FAQ

**Is there an official Future News Python SDK?** Not that we know of; this is a community library by Chipa dev team.

**Is it free?** Yes, MIT-licensed.

**Is it affiliated with Future News?** No, other than the [referral link](https://future.news/41L85FOV).

**Why do I get 403?** See [Errors & Cloudflare](errors.md).

**Can you build me a bot?** Yes: [Chipa bot development](https://chipatrade.com/services/bot-development).
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Future News API for Python – free open-source wrapper
description: futurenews is a free Python library for the Future News API (future.news). Sync and async, typed, by Chipa dev team.
---

# Future News API for Python

**futurenews** is a free, open-source Python wrapper for the [Future News](https://future.news/41L85FOV) API: sync and async clients, typed Pydantic models and clear errors for the trending markets endpoint.

```bash
pip install future-news-api
```

```python
from futurenews import FutureNews

with FutureNews() as client:
print(client.trending.list(limit=10).items)
```

!!! tip "Support the project"
[Create your Future News account with our link](https://future.news/41L85FOV). It costs you nothing and funds this library.

!!! info "More from Chipa dev team"
Need a trading bot? [Custom bot development](https://chipatrade.com/services/bot-development) · [ChipaX exchange](https://exchange.chipatrade.com/en/trade/BTC) · [Chipa Editor](https://chipaeditor.com) · [Discord](https://discord.com/invite/qwQZ7rHzGb)
15 changes: 15 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Install the Future News Python library
description: pip install future-news-api. Requires Python 3.9+. Free and open source.
---

# Install the Future News Python library

```bash
pip install future-news-api
```

Requires Python 3.9+. Dependencies: `httpx`, `pydantic>=2`.

!!! note
Don't have a Future News account yet? [Sign up here](https://future.news/41L85FOV).
37 changes: 37 additions & 0 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Future News API Python quickstart (sync and async)
description: Call the Future News API from Python in a few lines with the free futurenews library by Chipa dev team.
---

# Quickstart: call the Future News API from Python

## Sync
```python
from futurenews import FutureNews

with FutureNews() as client:
res = client.trending.list(limit=10)
for item in res.items:
print(item.model_dump())
```

## Async
```python
import asyncio
from futurenews import AsyncFutureNews


async def main():
async with AsyncFutureNews() as client:
print((await client.trending.list(limit=10)).items)


asyncio.run(main())
```

Blocked by Cloudflare? See [Errors & Cloudflare](errors.md).

!!! info "Automate it"
Want a bot built on this data? [Chipa bot development](https://chipatrade.com/services/bot-development).

New here? [Create your Future News account](https://future.news/41L85FOV) first.
3 changes: 3 additions & 0 deletions docs/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
User-agent: *
Allow: /
Sitemap: https://chipadevteam.github.io/FutureNewsAPI/sitemap.xml
Loading
Loading