Skip to main content

Python SDK for the Finance Sentiment API — stock sentiment (Reddit, X/Twitter, Polymarket) and crypto sentiment (Reddit)

Project description

social-stock-sentiment

Python SDK for the Finance Sentiment API — analyze stock sentiment (Reddit, X/Twitter, Polymarket) and crypto sentiment (Reddit).

Installation

pip install social-stock-sentiment

Quick Start

from stocksentiment import StockSentimentClient

client = StockSentimentClient(api_key="sk_live_...")

# Get trending stocks on Reddit
trending = client.reddit.trending(days=7, limit=10)
for stock in trending:
    print(f"{stock.ticker}: buzz={stock.buzz_score}, sentiment={stock.sentiment_score}")

# Get detailed sentiment for a stock
tsla = client.reddit.stock("TSLA", days=14)
print(f"TSLA buzz: {tsla.buzz_score}, trend: {tsla.trend}")

# AI-generated trend explanation
explanation = client.reddit.explain("TSLA")
print(explanation.explanation)

# Search for stocks
results = client.reddit.search("Tesla")

# Compare multiple stocks
comparison = client.reddit.compare(["TSLA", "AAPL", "MSFT"], days=7)

X/Twitter Data

# Same interface, different data source
x_trending = client.x.trending(days=1, limit=20)
nvda = client.x.stock("NVDA")

Polymarket Data

# Prediction-market sentiment and activity
pm_trending = client.polymarket.trending(days=7, limit=20, type="stock")
aapl = client.polymarket.stock("AAPL")

Async Usage

Every method has an _async variant:

import asyncio
from stocksentiment import StockSentimentClient

async def main():
    async with StockSentimentClient(api_key="sk_live_...") as client:
        trending = await client.reddit.trending_async(days=7)
        tsla = await client.reddit.stock_async("TSLA")

asyncio.run(main())

Available Methods

client.reddit.*

Method Description
trending(days, limit, offset, type) Trending stocks by buzz score
trending_sectors(days, limit, offset) Trending sectors
trending_countries(days, limit, offset) Trending countries
stock(ticker, days) Detailed sentiment for a ticker
explain(ticker) AI-generated trend explanation
search(query) Search stocks by name/ticker
compare(tickers, days) Compare up to 10 stocks

client.x.*

Method Description
trending(days, limit, offset, type) Trending stocks on X/Twitter
trending_sectors(days, limit, offset) Trending sectors
trending_countries(days, limit, offset) Trending countries
stock(ticker, days) Detailed X/Twitter sentiment
search(query) Search stocks
compare(tickers, days) Compare stocks

client.polymarket.*

Method Description
trending(days, limit, offset, type) Trending stocks on Polymarket
trending_sectors(days, limit, offset) Trending sectors
trending_countries(days, limit, offset) Trending countries
stock(ticker, days) Detailed Polymarket sentiment
search(query) Search stocks
compare(tickers, days) Compare stocks

Authentication

Get your API key at api.adanos.org. Free tier includes 250 requests/month.

# Custom base URL (e.g. for self-hosted instances)
client = StockSentimentClient(
    api_key="sk_live_...",
    base_url="https://your-instance.com",
    timeout=60.0,
)

Rate Limits

Tier Monthly Requests Burst Limit
Free 250 100/min
Paid Unlimited 1000/min

Rate limit headers are included in every response.

License

MIT

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

social_stock_sentiment-1.18.0.tar.gz (54.6 kB view details)

Uploaded Source

Built Distribution

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

social_stock_sentiment-1.18.0-py3-none-any.whl (141.2 kB view details)

Uploaded Python 3

File details

Details for the file social_stock_sentiment-1.18.0.tar.gz.

File metadata

  • Download URL: social_stock_sentiment-1.18.0.tar.gz
  • Upload date:
  • Size: 54.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for social_stock_sentiment-1.18.0.tar.gz
Algorithm Hash digest
SHA256 dd0df7878182ea54455cc1dd17e63ed90b36f6b8db79d29afa19dd9f3860d78d
MD5 39f684f23b2bde9a82600d60b2829791
BLAKE2b-256 72e2d90d56f1aaaaf537dfb77278e78cd73770152c4efa4406756c7913683f87

See more details on using hashes here.

Provenance

The following attestation bundles were made for social_stock_sentiment-1.18.0.tar.gz:

Publisher: publish-sdk.yml on alexander-schneider/api.adanos.org

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file social_stock_sentiment-1.18.0-py3-none-any.whl.

File metadata

File hashes

Hashes for social_stock_sentiment-1.18.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07f34edb1b7863c0a776b4951f63f3c0556cc31ec128ac6e6b9e857d48d7fa80
MD5 b5102030ffedc8ba6139a4e3626c17da
BLAKE2b-256 4705cb7a142e20e0506ff59c7bae9e1a3c016f0ce4a135eec3f2d2a5e2ac6ea3

See more details on using hashes here.

Provenance

The following attestation bundles were made for social_stock_sentiment-1.18.0-py3-none-any.whl:

Publisher: publish-sdk.yml on alexander-schneider/api.adanos.org

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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