The official Python SDK for the Currents API.
Install the package from PyPI:
pip install currentsapiImport the client and initialize it with your API key:
from currentsapi import CurrentsAPI
api = CurrentsAPI(api_key="YOUR_API_KEY")Retrieve the latest news headlines. Optionally filter by language:
api.latest_news()
api.latest_news(language="en")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)
api.available_languages()
api.available_regions()
api.available_category()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.
MIT License