currentsapi-python
The official Python SDK for the Currents API.
Installation
Install the package from PyPI. The distribution name is currentsapi (this
repository is currentsapi-python, and the Python import name is also
currentsapi):
pip install currentsapi
Python 3.8+ is supported.
Usage
Import the client and initialize it with your API key:
from currentsapi import CurrentsAPI
api = CurrentsAPI(api_key="YOUR_API_KEY")
Endpoints
Latest News
Retrieve the latest news headlines. Optionally filter by language:
api.latest_news()
api.latest_news(language="en")
Search
Search news articles with optional filters:
api.search(keywords="OpenAI", language="en")
api.search(country="US", category="technology", start_date="2024-01-01", end_date="2024-12-31")
Supported parameters:
keywords– search keywordslanguage– article language codecountry– country codecategory– news categorystart_date– start date (YYYY-MM-DDordatetimeobject)end_date– end date (YYYY-MM-DDordatetimeobject)
Available Resources
api.available_languages()
api.available_regions()
api.available_category()
Examples
- Generate a source-linked news briefing from a live Search API response or a deterministic offline fixture.
- Build a company news monitor with a JSON watchlist, bounded search window, local state, and deterministic fixture.
Authentication
All requests are authenticated using an Authorization header. Pass your API key when instantiating the client:
api = CurrentsAPI(api_key="YOUR_API_KEY")
Get your API key at https://currentsapi.services/en/register.
License
MIT License
Error handling
Any non-200 API response raises CurrentsAPIError, which exposes the parsed
response body:
from currentsapi.client import CurrentsAPIError
try:
api.latest_news()
except CurrentsAPIError as exc:
print(exc.status, exc.code, exc.message)
Metadata
Release files for currentsapi 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| currentsapi-0.1.2.tar.gz | 11.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| currentsapi-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / currentsapi-0.1.2.tar.gz
| Download URL | currentsapi-0.1.2.tar.gz |
|---|---|
| Size | 11.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0b4477257b0195898c26222539f61dce469201e0995060d286c368f04b3e13b
|
|
BLAKE2b-256 checksum How to use checksums |
3be2c52cdb6e2d7db98ac600c942c2407842d69f994f348526e49d55339c8e52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / currentsapi-0.1.2-py3-none-any.whl
| Download URL | currentsapi-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab2fe29cccbe39bb746f5e332ab3d414ed9830d4182ffafa27d03bec18d6dc71
|
|
BLAKE2b-256 checksum How to use checksums |
b6dd15be9504e7bb431e4c37bd8ffa0069aefca809f7d98b6ac49802839fc706
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|