Skip to main content

SentiSense Python SDK

PyPI version Python versions License: MIT

Official Python SDK for the SentiSense market intelligence API.

Installation

pip install sentisense

Quick Start

from sentisense import SentiSenseClient

client = SentiSenseClient("your-api-key")

# Get a stock price
price = client.get_stock_price("AAPL")
print(price)

# Get multiple stock prices
prices = client.get_stock_prices(["AAPL", "MSFT", "GOOGL"])

# Check market status
status = client.get_market_status()
print(status)

# Get latest news for a stock
news = client.get_documents_by_ticker("TSLA", source="news", days=7)

# Search across news and social media
results = client.search_documents("AI earnings surprise")

# Get mention time series for a stock (v2 metrics API)
mentions = client.get_metrics("NVDA", metric_type="mentions")

# Get sentiment time series
sentiment = client.get_metrics("NVDA", metric_type="sentiment")

# Get mentions broken down by source
dist = client.get_metrics_distribution("NVDA", metric_type="mentions", dimension="source")

Authentication

All API requests require an API key. You can generate one from your Developer Console.

client = SentiSenseClient("your-api-key")

For full endpoint documentation, request/response schemas, and interactive examples, see the API Documentation.

API Reference

Stocks

Method Description
get_stock_price(ticker) Real-time price for a single stock
get_stock_prices(tickers) Real-time prices for multiple stocks
get_stock_profile(ticker) Company profile
get_stock_entities(ticker) Tracked entities related to a stock (executives, products)
get_stock_chart(ticker, timeframe="1M") OHLCV chart data
get_all_stocks() List of available tickers
get_all_stocks_detailed() Tickers with company names and entity IDs
get_market_status() Market open/closed status
get_fundamentals(ticker, timeframe="quarterly") Financial fundamentals
get_current_fundamentals(ticker) Most recent fundamentals snapshot
get_historical_revenue(ticker) Historical revenue series
get_short_interest(ticker) Short interest (FINRA bi-monthly)
get_float(ticker) Shares float
get_short_volume(ticker) Daily short-sale volume (FINRA)

Knowledge Base

Method Description
get_popular_kb_entities() Popular KB entities (search suggestions)

News & Documents

Method Description
get_documents_by_ticker(ticker, source?, days?, hours?, limit?) News and social posts for a stock
get_documents_by_ticker_range(ticker, start_date, end_date) Documents within a date range
get_documents_by_entity(entity_id) Documents for a KB entity
search_documents(query, source?, days?, limit?) Natural language search across news and social
get_documents_by_source(source, days?, hours?, limit?) Latest from a source ("news", "reddit", "x", "substack")
get_stories(limit?, days?, expanded?) AI-curated news story clusters
get_story(cluster_id) Single story with all source documents
get_stories_by_ticker(ticker, limit?) Stories for a specific stock

Metrics (v2)

Method Description
get_metrics(symbol, metric_type="mentions", start_time?, end_time?, max_data_points?) Time series for a metric (mentions, sentiment, sentisense_score, social_dominance, creators)
get_metrics_distribution(symbol, metric_type="mentions", dimension="source", start_time?, end_time?) Metric distribution by dimension (e.g. mentions by source)

Note: start_time and end_time are epoch milliseconds.

Institutional Flows (13F)

Method Description
get_institutional_quarters() Available 13F reporting quarters
get_institutional_flows(report_date=None, limit=50) Fund flows for a quarter (omit report_date for the latest)
get_stock_holders(ticker, report_date) Institutional holders for a stock
get_activist_positions(report_date) Activist investor positions

Analyst Ratings

The price target cone (mean, high, low, upside %) and consensus are free for everyone, full data via API: we give it away. Upgrade/downgrade feeds and forward EPS estimates are limited on free, unlimited on PRO.

Method Description
get_analyst_consensus(ticker) Price target band (mean, high, low), analyst count, upside %. Free for everyone, full data.
get_analyst_actions(ticker, lookback_days=90) Recent upgrade/downgrade actions. Free: 3 most recent. PRO: unlimited.
get_analyst_estimates(ticker) Forward EPS estimates and earnings surprise history. Free: 1 quarter. PRO: full history.
get_analyst_market_activity(lookback_days=30) Market-wide recent analyst actions across all tickers (PRO).

Company KPIs (PRO)

Method Description
get_company_kpis(ticker) Company-specific KPI time-series (product metrics, segment revenue). Free tier returns metadata only (empty kpis array); PRO returns full series.
list_kpi_coverage() List all tickers with curated KPI coverage (free, no quota cost)

ETFs (beta)

Composition data is public; the holdings-weighted aggregate views follow the same PRO-with-preview pattern as Analyst/Insider. Aggregates synthesize fund-level views from each constituent's per-stock data (analyst coverage, insider trades, sentiment), weighted by allocation. Every aggregate response carries a coverage block so you see exactly how much of the fund's AUM the underlying data covered.

Method Description
list_etfs() Every ETF tracked by SentiSense. Returns ticker, fund name, issuer, tracked index, asset class.
get_etf_holdings(ticker) Full composition: per-holding weights and freshness metadata.
get_etf_analyst_aggregate(ticker) Holdings-weighted analyst consensus (weighted upside, distribution). Free: headline + coverage. PRO: + topContributors.
get_etf_insider_aggregate(ticker, lookback_days=30) Holdings-weighted Form 4 net flow over a configurable window. Free: headline + buy/sell split. PRO: + topContributors.
get_etf_sentiment_aggregate(ticker) Two SentiSense readings side-by-side: constituent-weighted and direct (mentions of the fund itself).

Error Handling

The SDK raises typed exceptions for API errors:

from sentisense import SentiSenseClient, AuthenticationError, RateLimitError

client = SentiSenseClient("your-api-key")

try:
    price = client.get_stock_price("AAPL")
except AuthenticationError:
    print("Invalid or missing API key")
except RateLimitError:
    print("Rate limit exceeded, try again later")
Exception HTTP Status Description
AuthenticationError 401, 403 Invalid or missing API key
NotFoundError 404 Resource not found
RateLimitError 429 Rate limit exceeded
APIError Other 4xx/5xx General API error

All exceptions inherit from SentiSenseError and include .status_code, .message, and .response attributes.

Not yet in the Python SDK

A few endpoints available in the Node SDK are intentionally not yet exposed here (low-traffic / discovery-convenience surfaces). Call them directly over HTTP if you need them: /api/v1/stocks/images, /api/v1/stocks/descriptions, /api/v1/stocks/popular, /api/v1/stocks/{ticker}/entities, /api/v1/stocks/{ticker}/ai-summary, and the metrics breakdown endpoint.

License

MIT - see LICENSE for details.

Download files

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

Source Distribution

sentisense-0.33.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

sentisense-0.33.0-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file sentisense-0.33.0.tar.gz.

File metadata

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

File hashes

Hashes for sentisense-0.33.0.tar.gz
Algorithm Hash digest
SHA256 445af07813b53b8833e556795948829d62313daa8897728972dc96677d5a1cc2
MD5 6aac377ce0bb9485fb93b7e50f994430
BLAKE2b-256 e43af76a3ac55c25293b4a1d928c968994b28431e39002d868f61e1c640cf054

See more details on using hashes here.

File details

Details for the file sentisense-0.33.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sentisense-0.33.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6e3f65298088e9c55f7a08eb340da31edd4d4ec2005333e8a13ece0c7b7d318
MD5 7b6e37fcfaf2ee4fe12f731f0d0aab78
BLAKE2b-256 dceb36ad7eee9c085275dddc7f1c4f16539ce99bafdd365a4d6a55357eb226c2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.53.0

2 files

0.51.0

2 files

0.50.0

2 files

0.49.0

2 files

0.48.0

2 files

0.47.0

2 files

0.46.0

2 files

0.44.0

2 files

0.42.0

2 files

0.41.0

2 files

0.40.0

2 files

0.39.0

2 files

0.37.0

2 files

0.36.0

2 files

0.34.0

2 files

This release

0.33.0 This release

2 files

0.32.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.22.1

2 files

0.22.0

2 files

0.21.1

2 files

0.21.0

2 files

0.19.0

2 files

0.18.0

2 files

0.16.0

2 files

0.15.0

2 files

0.12.0

2 files

0.10.1

2 files

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page