how to use Claude for finance analysis
Learn how to connect Claude to live market data using a free API. We show you 3 ways to link data and give you copy-paste prompts for stock analysis.
Claude dey very good for read financial data and explain wetin e mean. But e no sabi today numbers, because language model training data dey end many months before you ask your question. The fix easy: give Claude live market data from an API, make e do wetin e really sabi do, which na analysis, comparison, and plain-English explanation.
This guide go show you how to do that with one free market data API, three different ways to connect Claude to am, and working prompts wey you fit copy. Full disclosure: the API belong to Strasmore, wey our team build. You no need account, so you fit try everything for this guide within next five minutes.
Why Claude needs a data source
If you ask Claude "what is Microsoft's dividend yield right now" without any tools, you go get one of two failure modes. Either e go refuse, or e go answer from training data wey don old for months. Both dey happen because the model no get access to current prices. E no fit look anything up by itself.
If you attach a data source, the picture change completely. Claude dey read JSON well well, e fit keep dozens of rows for context without lose track, and e go happily compare, rank, and summarize wetin the data really show. The quality of the answer now depend on the quality of the data wey you hand am.
A free market data API with no key
Strasmore's demo API dey serve one catalog of fixed queries for US stocks and options data as plain JSON. No signup, no API key, and no rate-limit dance. The full endpoint reference dey for the API documentation post; the short version na:
# 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"Every response include the rows, the column names, and the exact SQL wey produce the numbers. That last part important for AI work: you fit show Claude the SQL together with the data, and e go explain the query to you as well as the result.
Prices dey delay and the options greeks na end-of-day values. For learning, screening, and analysis, that na exactly wetin you need. E no be trading feed, and this guide na about analysis, no be trade execution.
Way 1: paste the JSON into a chat
The zero-setup version. Run one curl, copy the JSON, and paste am into a Claude chat with clear instruction. This work for claude.ai web app, the desktop app, or any chat interface.
One prompt shape wey work 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 na the important one. E dey push Claude to name the limits of the data instead of overreaching, and its suggestions ("check the payout history", "compare against the sector") often make better next query than anything wey you go type cold.
Way 2: let Claude Code fetch the data itself
If you run Claude Code, you fit skip the copy-paste entirely, because Claude Code fit run curl on its own. Ask am a question and tell am where the data dey:
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 dey read the catalog, pick dividend_yield_leaders, fetch am, and work from the real rows. Because the agent loop dey run for your machine, e fit join with everything else for there: e fit save results to files, chart them with a Python script, or diff today's screen against the one e save last week. One cost to watch: every JSON payload wey the agent fetch dey stay for the conversation and e go dey re-sent for next turn, which na why a long Claude Code session gets expensive.
One always-on Linux server na the natural home for this workflow. One daily "fetch the screens, compare with yesterday, write me a summary" loop need machine wey no dey sleep, and we get full guide to running Claude Code on a VPS with tmux so sessions go survive SSH disconnects. If you go that route, read our guide to running AI agents safely on a VPS first; agent wey get shell access deserve real guardrails.
Way 3: the Claude API with a fetch tool
For software wey you dey build, give Claude the API as a tool. With Anthropic's Python SDK, the whole wiring na 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 dey call the tool when question need data, you execute the fetch and hand back the JSON, and e go answer from real rows instead of memory. The same pattern work with Model Context Protocol if you prefer reusable server over inline tool; our MCP servers on a VPS guide cover how to host those.
Prompts that get good analysis
Some patterns wey dey 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 kill vague summaries.
- Ask for wetin the data no fit show. Delayed prices, end-of-day greeks, and a fixed screen all get limits; Claude go state them clearly when you ask, and that keep the analysis honest.
- Make e compare, no be predict. "Which of these yields look sustainable based on the payout ratios shown" dey get grounded answer. "Which stock will go up" dey get well-written guess, because prediction no be something the data support.
- Keep the SQL for context. The
sqlfield dey tell Claude exactly how a screen was built, so e fit explain why one name no dey (like market-cap floor, or yield ceiling) instead of dey invent reason.
When the fixed queries stop being enough
The demo's screens dey fixed by purpose. The next level na Strasmore's paid API: the same warehouse, 22 years of US equities and 12 years of options history, and your own questions for SQL or plain English with a programmatic key. The workflow stay identical; your tool dey fetch from an authenticated endpoint instead of the open one, and the questions become yours to define. Claude really sabi write ClickHouse SQL against a documented schema, which turn "pull the dividend history of every REIT above $10B and rank by five-year growth" into one-prompt job.
FAQ
Can Claude analyze stocks without any data source?
No, no with current numbers. Its training data dey end before today, so anything e say about current prices dey come from stale memory. Give am a live API and the analysis go dey grounded for rows wey e just fetch.
Is the Strasmore demo API really free?
Yes. No key, no signup, no card. E dey serve one catalog of fixed queries for delayed US equities and end-of-day options data, and e deliberately open for AI agents.
Do I need a VPS for this?
No. The paste-in workflow no need anything except browser. A VPS dey become worth it when you want the agent loop to run on a schedule, survive disconnects, and keep local files of past results.
Is this financial advice?
No. Everything here na analysis tooling. Claude dey summarize and compare data; wetin you do with that na your decision, and delayed educational data no be basis for trade execution.
Wire one screen into one chat and you go see the difference immediately: Claude go stop to sound confident about numbers wey e no fit know, and e go start to dey useful for numbers wey e fit know.