Skip to main content

Official Python SDK for The Polaris Report Knowledge API — real-time news intelligence for AI agents and applications.

Project description

polaris-news

Official Python SDK for The Polaris Report API.

Installation

pip install polaris-news

Quick Start

Authenticate via CLI

polaris login    # opens GitHub in your browser — API key saved automatically
polaris whoami   # check your auth status
polaris logout   # remove saved credentials

Use the client

from polaris_news import PolarisClient

client = PolarisClient()  # auto-reads saved credentials
feed = client.feed(category="technology", limit=10)
for brief in feed.briefs:
    print(brief.headline)

You can also pass a key explicitly or set the POLARIS_API_KEY environment variable.

Methods

Method Description
feed(category?, limit?, page?, per_page?, min_confidence?) Get the news feed
brief(brief_id, include_full_text?) Get a single brief by ID
search(query, category?, page?, per_page?, sort?, min_confidence?, from_date?, to_date?, entity?, sentiment?) Search briefs
generate(topic, category?) Generate a brief on a topic
entities(q?, type?, limit?) List entities
entity_briefs(name, role?, limit?, offset?) Get briefs for an entity
trending_entities(limit?) Get trending entities
similar(brief_id, limit?) Get similar briefs
clusters(period?, limit?) Get brief clusters
data(entity?, type?, limit?) Get structured data points
agent_feed(category?, tags?, limit?, min_confidence?) Get agent-optimized feed
compare_sources(brief_id) Compare sources for a brief
trending(period?, limit?) Get trending briefs
verify(claim, context?) Fact-check a claim against briefs
stream(categories?) Stream briefs via SSE (generator)

Error Handling

from polaris_news import PolarisClient, AuthenticationError, RateLimitError, NotFoundError

client = PolarisClient()

try:
    brief = client.brief("abc123")
except AuthenticationError:
    print("Invalid API key")
except NotFoundError:
    print("Brief not found")
except RateLimitError as e:
    print(f"Rate limited. Retry after: {e.retry_after}s")

Streaming

client = PolarisClient()

for brief in client.stream(categories="technology,science"):
    print(f"[{brief.category}] {brief.headline}")

Documentation

Full API documentation: https://thepolarisreport.com/docs

Project details


Download files

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

Source Distribution

polaris_news-0.7.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polaris_news-0.7.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file polaris_news-0.7.0.tar.gz.

File metadata

  • Download URL: polaris_news-0.7.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for polaris_news-0.7.0.tar.gz
Algorithm Hash digest
SHA256 7cb970f77cdce440af873943e7a60e0516e4be9f2ddd8cfc4e79f26612d023aa
MD5 f7bc4f134c33c8d565dc2c120d3d7cc2
BLAKE2b-256 f19a541864788355ea4861353854ad597d8c285cd1a5077193bfed8bc4a7a1f1

See more details on using hashes here.

File details

Details for the file polaris_news-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: polaris_news-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for polaris_news-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79d5fcac38183ac77147b778e84e6303520a8b957ff3777672275fc26ed580f6
MD5 08b97184668dba89d35fc1a974bee269
BLAKE2b-256 ddbb6f99f1d92fd922e1ec613a26c90b82ff41b032a06a629cf3dd712246d41f

See more details on using hashes here.

Supported by

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