Skip to main content

Python SDK for AskNews

Project description

AskNews Python SDK

PyPI - Python Version

Python SDK for the AskNews API.

Installation

pip install asknews

Usage

from asknews_sdk import AskNewsSDK

ask = AskNewsSDK(
    client_id=<"YOUR_CLIENT_ID>",
    client_secret="<YOUR_CLIENT_SECRET>",
    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
  • /chat, an OpenAI compatible endpoint infused with news
  • /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.

Support

Join our Discord to see what other people are building, and to get support with your projects.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

asknews-0.7.51-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file asknews-0.7.51-py3-none-any.whl.

File metadata

  • Download URL: asknews-0.7.51-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for asknews-0.7.51-py3-none-any.whl
Algorithm Hash digest
SHA256 5b043b5c7f0e49c9399f6430534879bdc21f691a0d01a6da2d246d94197b691a
MD5 15a0d8fe7afc848819b55fcc69b0cdc7
BLAKE2b-256 64c53c40aedb5bc7b2c25843bd651479262cceef9de08294a62f99dfe1e5edf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for asknews-0.7.51-py3-none-any.whl:

Publisher: release.yml on emergentmethods/asknews-python-sdk

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page