About this project
AskNews Python SDK is a client library for the AskNews API, designed to seamlessly integrate real-time news data into large language model (LLM) workflows. The SDK supports Python 3.8 through 3.13 and is installed via pip.
The core value proposition is simplicity: a single call to `ask.news.search_news(query).as_string` returns a prompt-optimized string ready to feed into any LLM, eliminating the need for custom news retrieval and formatting logic.
Beyond basic news search, the SDK exposes a broad set of API endpoints:
- **/stories**: High-level event tracking with state-of-the-art article clustering, enabling systems to follow evolving news narratives.
- **/forecasts**: Industry-leading forecasting capabilities on any real-time event, useful for predictive analytics in financial or political contexts.
- **/analytics**: Time-series data covering finance and politics, suitable for dashboards and trend analysis.
- **/deepnews**: A deep research agent that explores a news knowledge graph, X (Twitter), Reddit, Google, Wikipedia, and more to build forecasts, reports, and analytics on demand.
- **/graph**: Access to the largest news knowledge graph available, allowing users to construct custom graph queries for entity relationships and event connections.
- **/websearch**: Web search with LLM-distilled summaries of relevant pages, providing concise, context-aware results.
The SDK is initialized with an API key and optional scopes (news, chat, stories, analytics), giving developers fine-grained control over which capabilities their application can access. Full API documentation is available at docs.asknews.app, and the project maintains a Discord community for support and collaboration.
This tool is particularly valuable for developers building RAG (Retrieval-Augmented Generation) systems, news-aware chatbots, financial analysis platforms, or any application that requires up-to-date, structured news data as context for LLM inference.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.