https://github.com/emergentmethods/asknews-python-sdk
Infusing news into any LLM with a single line of code
https://github.com/emergentmethods/asknews-python-sdk
llm news newsapi nlp rag
Last synced: about 1 month ago
JSON representation
Infusing news into any LLM with a single line of code
- Host: GitHub
- URL: https://github.com/emergentmethods/asknews-python-sdk
- Owner: emergentmethods
- License: mit
- Created: 2024-05-11T09:23:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-04-28T13:44:36.000Z (about 2 months ago)
- Last Synced: 2026-04-28T15:30:41.077Z (about 2 months ago)
- Topics: llm, news, newsapi, nlp, rag
- Language: Python
- Homepage: https://docs.asknews.app
- Size: 1.09 MB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# AskNews Python SDK

Python SDK for the AskNews API.
## Installation
```bash
pip install asknews
```
## Usage
```python
from asknews_sdk import AskNewsSDK
ask = AskNewsSDK(
api_key=""
scopes=["news", "chat", "stories", "analytics"]
)
query = "Effect of fed policy on tech sector"
# prompt-optimized string ready to go for any LLM:
news_context = ask.news.search_news(query).as_string
```
And you will have a prompt-optimized string ready to go for any LLM. The API doesn't stop there, explore a wide range of endpoints:
- /stories, high level event tracking and state of the art article clustering
- /forecasts, industry leading forecasting on any real-time event
- /analytics, time-series data on finance and politics
- /deepnews, a deep research agent that can explore the new knowledge graph, X, Reddit, Google, Wikipedia and more to build forecasts, reports, analytics, and anything else your system may need.
- /graph, build any news knowledge graph imaginable from the largest news graph on the planet
- /websearch, search the web and get back an LLM distillation of all the relevant web pages
Find full details at the [AskNews API documentation](https://docs.asknews.app).
## Support
Join our [Discord](https://discord.gg/2Yw66XXEhY) to see what other people are building, and to get support with your projects.