Claude for Finance Analysis: a Practical Guide
Use Claude to analyze stocks and options with live market data: a free no-key API, three ways to connect it, and copy-paste prompts that get grounded answers.
Claude is very good at reading financial data and explaining what it means. It is bad at knowing today's numbers, because a language model's training data ends months before you ask your question. The fix is simple: give Claude live market data from an API, and let it do what it is actually good at, which is analysis, comparison, and plain-English explanation.
This guide shows you how to do that with a free market data API, three different ways to connect Claude to it, and working prompts you can copy. Full disclosure: the API belongs to Strasmore, which is built by our team. It needs no account, so you can try everything in this guide in the next five minutes.
Why Claude needs a data source
Ask Claude "what is Microsoft's dividend yield right now" with no tools attached and you get one of two failure modes. Either it refuses, or it answers from training data that is months old. Both happen because the model has no access to current prices. It cannot look anything up by itself.
Attach a data source and the picture changes completely. Claude reads JSON fluently, keeps dozens of rows in context without losing track, and will happily compare, rank, and summarize what the data actually shows. The quality of the answer now depends on the quality of the data you hand it.
A free market data API with no key
Strasmore's demo API serves seven fixed queries over US stocks and options data as plain JSON. There is no signup, no API key, and no rate-limit dance. The full endpoint reference lives in the API documentation post; the short version:
# What queries exist? (start here)
curl "https://ai.strasmore.com/api/demo/catalog"
# The highest large-cap dividend yields right now
curl "https://ai.strasmore.com/api/demo?q=dividend_yield_leaders"
# Implied-volatility leaders in the options market
curl "https://ai.strasmore.com/api/demo?q=iv_leaders"
# The latest market headlines with tickers
curl "https://ai.strasmore.com/api/demo?q=latest_market_news"
Each response includes the rows, the column names, and the exact SQL that produced the numbers. That last part matters for AI work: you can show Claude the SQL together with the data, and it will explain the query to you as well as the result.
Prices are delayed and the options greeks are end-of-day values. For learning, screening, and analysis workflows that is exactly what you need. It is not a trading feed, and this guide is about analysis, not trade execution.
Way 1: paste the JSON into a chat
The zero-setup version. Run one curl, copy the JSON, and paste it into a Claude chat with a clear instruction. This works in the claude.ai web app, the desktop app, or any chat interface.
A prompt shape that works well:
Here is JSON from a market data API. The `sql` field shows exactly
how the numbers were computed.
[paste the JSON here]
1. Summarize what this data shows in plain English.
2. Which three rows stand out, and what makes them unusual?
3. What would you want to check next before drawing conclusions?
The third question is the important one. It pushes Claude to name the limits of the data instead of overreaching, and its suggestions ("check the payout history", "compare against the sector") often make a better next query than anything you would have typed cold.
Way 2: let Claude Code fetch the data itself
If you run Claude Code, you can skip the copy-paste entirely, because Claude Code can run curl on its own. Ask it a question and tell it where the data lives:
Fetch https://ai.strasmore.com/api/demo/catalog, pick the query that
best answers this question, fetch it, and analyze the result:
which large-cap stocks pay the highest dividend yields right now,
and how do their P/E ratios compare?
Claude Code reads the catalog, chooses dividend_yield_leaders, fetches it, and works from the real rows. Because the agent loop runs on your machine, this also composes with everything else on it: it can save results to files, chart them with a Python script, or diff today's screen against the one it saved last week.
An always-on Linux server is the natural home for this workflow. A daily "fetch the screens, compare with yesterday, write me a summary" loop wants a machine that never sleeps, and we have a full guide to running Claude Code on a VPS with tmux so sessions survive SSH disconnects. If you go that route, read our guide to running AI agents safely on a VPS first; an agent with shell access deserves real guardrails.
Way 3: the Claude API with a fetch tool
For software you are building, give Claude the API as a tool. With Anthropic's Python SDK the whole wiring is one tool definition and one fetch function:
import json, urllib.request
import anthropic
def fetch_demo(query_key: str) -> str:
url = f"https://ai.strasmore.com/api/demo?q={query_key}"
with urllib.request.urlopen(url, timeout=30) as r:
return r.read().decode()
client = anthropic.Anthropic()
tools = [{
"name": "fetch_market_data",
"description": "Fetch a fixed market-data query. Keys are listed at "
"https://ai.strasmore.com/api/demo/catalog e.g. "
"dividend_yield_leaders, iv_leaders, latest_market_news.",
"input_schema": {
"type": "object",
"properties": {"query_key": {"type": "string"}},
"required": ["query_key"],
},
}]
# Claude decides when to call the tool; your loop executes fetch_demo()
# and returns the JSON as the tool result. See Anthropic's tool-use docs.
Claude calls the tool when a question needs data, you execute the fetch and hand back the JSON, and it answers from real rows instead of memory. The same pattern works with the Model Context Protocol if you prefer a reusable server over an inline tool; our MCP servers on a VPS guide covers hosting those.
Prompts that get good analysis
A few patterns that consistently improve the output, whichever way you connect:
- Tell Claude to cite rows. "For every claim, name the ticker and the number it comes from." This kills vague summaries.
- Ask for what the data cannot show. Delayed prices, end-of-day greeks, and a fixed screen all have limits; Claude will state them clearly when asked, and that keeps the analysis honest.
- Make it compare, not predict. "Which of these yields look sustainable based on the payout ratios shown" gets a grounded answer. "Which stock will go up" gets a well-written guess, because prediction is not something the data supports.
- Keep the SQL in context. The
sqlfield tells Claude exactly how a screen was built, so it can explain why a name is missing (a market-cap floor, a yield ceiling) instead of inventing a reason.
When the fixed queries stop being enough
The demo's seven screens are fixed on purpose. The step up is Strasmore's paid API: the same warehouse, 22 years of US equities and 12 years of options history, and your own questions in SQL or plain English with a programmatic key. The workflow stays identical; your tool fetches from an authenticated endpoint instead of the open one, and the questions become yours to define. Claude is genuinely good at writing ClickHouse SQL against a documented schema, which turns "pull the dividend history of every REIT above $10B and rank by five-year growth" into a one-prompt job.
FAQ
Can Claude analyze stocks without any data source?
Not with current numbers. Its training data ends before today, so anything it says about current prices comes from stale memory. Give it a live API and the analysis is grounded in rows it just fetched.
Is the Strasmore demo API really free?
Yes. No key, no signup, no card. It serves seven fixed queries over delayed US equities and end-of-day options data, and it is deliberately open to AI agents.
Do I need a VPS for this?
No. The paste-in workflow needs nothing but a browser. A VPS becomes worth it when you want the agent loop running on a schedule, surviving disconnects, and keeping local files of past results.
Is this financial advice?
No. Everything here is analysis tooling. Claude summarizes and compares data; what you do with that is your decision, and delayed educational data is not a basis for trade execution.
Wire one screen into one chat and you will see the difference immediately: Claude stops sounding confident about numbers it cannot know, and starts being useful about numbers it can.