The stock market memory for AI agents
24 million chart patterns, one API call
Historical pattern intelligence for AI research, trading, and risk agents. Condition on regime, sector, and liquidity — get the full distribution of what happened next, with path percentiles and sample size.
REST API · MCP Server · Python SDK · 200 free calls/day
Example Response
Real data from April 2, 2026Try it yourself with your API key:
curl "https://chartlibrary.io/api/v1/intelligence/NVDA?compact=true" \
-H "Authorization: Bearer YOUR_API_KEY"{
"symbol": "NVDA",
"date": "2026-04-02",
"matches": [
{ "symbol": "BAC", "date": "2019-06-04", "distance": 39.20, "day_change_pct": 2.76 },
{ "symbol": "XLK", "date": "2026-04-02", "distance": 40.47, "day_change_pct": 3.12 },
{ "symbol": "SPXL", "date": "2021-06-21", "distance": 40.52, "day_change_pct": 2.91 },
{ "symbol": "MSFT", "date": "2019-02-04", "distance": 40.67, "day_change_pct": 2.84 },
{ "symbol": "MSFT", "date": "2023-05-26", "distance": 41.07, "day_change_pct": 2.73 },
{ "symbol": "NVDA", "date": "2024-03-01", "distance": 41.41, "day_change_pct": 2.87 },
{ "symbol": "AAPL", "date": "2022-03-22", "distance": 41.67, "day_change_pct": 2.01 },
{ "symbol": "AVGO", "date": "2026-04-02", "distance": 42.25, "day_change_pct": 3.31 },
{ "symbol": "UAL", "date": "2022-04-19", "distance": 42.45, "day_change_pct": 3.17 },
{ "symbol": "NVDA", "date": "2024-02-09", "distance": 42.46, "day_change_pct": 2.27 }
],
"match_count": 10,
"follow_through": {
"horizon_returns": {
"1": { "mean": 1.02, "positive": 6, "count": 8 },
"3": { "mean": 3.34, "positive": 5, "count": 8 },
"5": { "mean": 3.21, "positive": 7, "count": 8 },
"10": { "mean": 5.62, "positive": 7, "count": 8 }
}
},
"regime": {Not another data feed.
Polygon gives you prices. Alpha Vantage gives you indicators. Chart Library tells you what happened last time.
24M
pre-computed pattern embeddings
<3s
end-to-end search response time
10 years
15,000+ stocks, minute-bar resolution
Start with market context.
Before analyzing a stock, give your agent market awareness. One call returns current regime, index prices, VIX, sector rotation, and sentiment crowding.
Request
curl "https://chartlibrary.io/api/v1/market-context"Response
{
"SPY": {"close": 679.46, "change_pct": -0.07, "volume": 42305622},
"QQQ": {"close": 611.07, "change_pct": 0.14, "volume": 33605274},
"IWM": {"close": 261.30, "change_pct": -0.25},
"volatility": {"realized_20d_annualized_pct": 14.2, "percentile_252d": 0.48, "label": "normal"},
"regime": {
"label": "bull+volatile",
"cluster": 1,
"volatility": "elevated",
"trend": "rising"
},
"sectors": {
"spy_5d_return": -2.14,
"leaders": [{"symbol": "XLE", "return_5d": 2.1}],
"laggards": [{"symbol": "XLK", "return_5d": -3.2}]
},
"signal_crowding": {"bullish": 4, "bearish": 8, "neutral": 8}
}Then analyze with regime-aware matching
curl -X POST "https://chartlibrary.io/api/v1/analyze" \
-H "Content-Type: application/json" \
-d '{
"query": "NVDA",
"context_weight": 0.05,
"same_sector": true,
"format": "agent"
}'context_weight weights matches that happened in similar regimes. same_sector restricts matches to the query's own GICS sector (peer-relative). format=agent strips visualization data to cut token usage ~80%.
| Method | Endpoint |
|---|---|
| GET | /api/v1/market-contextcontext |
| POST | /api/v1/portfolio/analyzecontext |
| GET | /api/v1/accuracy/by-regimecontext |
| GET | /api/v1/regime-win-ratescontext |
| GET | /api/v1/exit-signalcontext |
| GET | /api/v1/pattern-degradationcontext |
| GET | /api/v1/risk-adjusted-pickscontext |
| GET | /api/v1/intelligence/{symbol} |
| GET | /api/v1/regime/current |
| GET | /api/v1/regime-tracker?symbol=SPY |
| POST | /api/v1/search/textcontext |
| POST | /api/v1/analyzecontext |
| POST | /api/v1/follow-through |
| POST | /api/v1/summary |
| GET | /api/v1/discover/picks |
| POST | /api/v1/search/batch |
| GET | /api/v1/status |
| GET | /api/v1/anomaly/{symbol} |
| GET | /api/v1/volume-profile/{symbol} |
| GET | /api/v1/sector-rotation |
| GET | /api/v1/crowding |
| GET | /api/v1/earnings-reaction/{symbol} |
| GET | /api/v1/correlation-shift |
| POST | /api/v1/scenario |
MCP Server
Works with Claude, ChatGPT, and any MCP-compatible agent
Install the Chart Library MCP server and your AI agent can search patterns, check market regime, and get context-aware forward returns through natural language.
# Install
pip install chartlibrary-mcp
# Claude Desktop / Claude Code
claude mcp add chart-library -- chartlibrary-mcpv1.2.0 — 23 tools including the recommended agent-first set: get_market_context, analyze_pattern (with context_weight), check_ticker, get_portfolio_health, get_regime_accuracy
Quick Start
Python
import requests
# One call — full intelligence for any symbol
r = requests.get(
"https://chartlibrary.io/api/v1/intelligence/NVDA",
headers={"Authorization": "Bearer cl_your_key"},
params={"compact": True}
)
data = r.json()
print(f"Top match: {data['matches'][0]['symbol']} {data['matches'][0]['date']}")
print(f"10-day outlook: {data['follow_through']['horizon_returns']['10']['mean']:+.1f}%")
print(f"Regime: {data['regime']['spy_summary'][:100]}...")JavaScript
const res = await fetch(
"https://chartlibrary.io/api/v1/intelligence/NVDA?compact=true",
{ headers: { Authorization: "Bearer cl_your_key" } }
);
const { matches, follow_through, regime, summary } = await res.json();API Pricing
Start free. Scale as your agent grows.
Sandbox
200 calls / day
- Pattern search + forward returns
- Regime tracker (SPY, QQQ, sectors)
- MCP server access
- 10 requests/min
Builder
50,000 calls / month
- Everything in Sandbox
- AI summaries
- Batch search (20 symbols)
- 60 requests/min
Scale
500,000 calls / month
- Everything in Builder
- 300 requests/min
- Priority support
Agent
2M calls / month
- Everything in Scale
- Cohort session handles
- Conditional distribution API
- 1,000 req/min + burst
- Priority queue
Enterprise
Unlimited calls
- Everything in Agent
- Dedicated index replica
- Dedicated support + SLA
- Custom integrations
What developers are building
Trading Bots
Add historical pattern context to entry/exit signals. "7 of 10 similar setups went up."
AI Assistants
When a user asks about a stock, your agent responds with real historical data instead of hallucinating.
Risk Monitoring
Alert when a portfolio position enters a historically bearish pattern. Nightly automated scans.
Market Research
Regime analysis, sector rotation detection, and pattern-based screening at scale.