# Market Summary API

> AI-generated market headline and expanded analysis, refreshed through the trading day: what moved, why it moved, and which stocks are most active.

Base URL: `https://app.sentisense.ai/api/v1/market-summary`
Tier: Free

All API access requires an API key via the `X-SentiSense-API-Key` header. Keys look like `ss_live_...`.
<!--
  KEEP IN SYNC: the frontmatter `endpoints:` list above must stay aligned with the
  `## GET /...` section headings in this file (same order, same count). When you change
  paths, update the skill source at `skills/src/sentisense/body.md` and run
  `cd skills && npm run deploy:website` to regenerate `public/skill.md`.
-->

## Overview

Market Summary is SentiSense's AI-generated read on the current trading session: a one-to-two sentence headline punchline plus a longer markdown analysis covering market sentiment, the session's price action, and the stocks and earnings driving it. It is distinct from [Market Mood](/docs/api/market-mood/), which is a composite fear/greed score; Market Summary is prose, written and refreshed by SentiSense's AI throughout the trading day.

**Use cases:**
- Show a one-line market punchline in a dashboard header or Discord/Slack bot
- Pull the expanded analysis into a research agent's context for "what's happening in the market today"
- Track how the AI's read on the session evolves by polling `generatedAt`

**Access:** API key required on every call. Available on every tier; requests count toward your standard monthly quota and per-minute rate limit like any other read endpoint. Anonymous calls return `401 api_key_required`.

---

## GET /api/v1/market-summary

Returns the latest AI-generated market summary.

**Parameters:** none.

**Example Request:**

```bash
curl -H "X-SentiSense-API-Key: ss_live_YOUR_KEY" \
  "https://app.sentisense.ai/api/v1/market-summary"
```

```python
from sentisense import SentiSenseClient

client = SentiSenseClient(api_key="ss_live_YOUR_KEY")
summary = client.get_market_summary()
print(summary["headline"])
```

**Response Schema:**

| Field | Type | Description |
|-------|------|--------------|
| `lastUpdated` | long | Epoch milliseconds for when this response was served |
| `headline` | string \| null | One-to-two sentence market punchline. `null` if no AI summary has been generated yet |
| `expandedContent` | string \| null | Full markdown analysis, typically organized under headings like "Market Sentiment," "Market Overview," and "Notable Market Movers," with inline citation links to the source stories. `null` if no AI summary has been generated yet |
| `generatedAt` | long \| null | Epoch seconds for when the AI summary itself was generated (older than `lastUpdated`, which reflects the request time). `null` if no AI summary has been generated yet |

**Example Response** (trimmed):

```json
{
  "lastUpdated": 1784787398557,
  "headline": "ServiceNow smashed Q2 estimates and raised guidance after Wednesday's close, jumping over 7% after hours and puncturing the AI-eats-SaaS fear that hammered the sector all session. Alphabet and Tesla told a messier story: both beat on revenue but fell after hours on capex hikes and margin compression, while oil pushed toward $94 a barrel on escalating US-Iran strikes.",
  "expandedContent": "### Market Sentiment\nSentiSense's Market Mood ticked up to 55/100, Neutral, though the underlying signal mix stayed cautious...\n\n### Market Overview\nWednesday's regular session was a holding pattern ahead of the bell: the S&P 500 proxy (SPY) slipped 0.12%...\n\n### Notable Market Movers\nThe after-hours verdict on tonight's earnings split three ways. **ServiceNow** topped every headline metric in its guide...\n",
  "generatedAt": 1784765596
}
```

## Notes

- Market Summary is regenerated by SentiSense's AI several times during the trading day as new price action and news come in. `generatedAt` tells you how fresh the current summary is; `lastUpdated` is just the response timestamp and moves on every call.
- `expandedContent` is markdown, including inline links to the news stories and data the AI cited. Render it with a markdown renderer rather than treating it as plain text.
