SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor · Updated 2026-08-29

How to Use Claude for Stock and Options Analysis

Use Claude with live market data to analyze stocks and options. Get a free no-key API, 3 connection methods, and copy-paste prompts for grounded answers.

Claude dey very good to read financial data and explain wetin e mean. But e no too good to know today numbers, because language model training data dey end months before you ask your question. The solution simple: give Claude live market data from an API, then make e do wetin e really good at — analysis, comparison, and plain-English explanation.

This guide go show you how to do am with free market data API, three different ways to connect Claude to am, and working prompts wey you fit copy. Make we talk true: Strasmore own the API, and na our team build am. E no need account, so you fit try everything for this guide within the next five minutes.

Why Claude need a data source

Ask Claude “wetin be Microsoft dividend yield now” when no tools attach, you go see one of two failure modes. E fit refuse, or e fit answer with training data wey don old for months. Both happen because the model no get access to current prices. E no fit look up anything by itself.

Attach a data source, and the situation go change completely. Claude dey read JSON well, e fit keep dozens of rows for context without losing track, and e go gladly compare, rank, and summarize wetin the data actually show. The answer quality now depend on the quality of the data wey you give am.

A free market data API wey no need key

Strasmore demo API dey serve catalog of fixed queries for US stocks and options data as plain JSON. No signup, no API key, and no rate-limit dance dey involved. You fit see the complete endpoint reference for the API documentation post; na the short version be this:

# 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 include the rows, column names, and the exact SQL wey produce the numbers. This last part matter for AI work: you fit show Claude the SQL together with the data, and e go explain the query and the result to you.

Prices dey delayed, and options greeks na end-of-day values. For learning, screening, and analysis workflows, na exactly wetin you need. E no be trading feed, and this guide na about analysis, not trade execution.

Way 1: paste JSON go one chat

Dis na version wey no need setup. Run one curl, copy the JSON, then paste am for Claude chat with clear instruction. E go work for claude.ai web app, desktop app, or any chat interface.

Prompt shape wey dey 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 push Claude to name the limits of the data instead of making claims wey pass wetin data fit support. E suggestions ("check the payout history", "compare against the sector") often dey make better next query pass anything wey you for type without context.

Way 2: make Claude Code fetch the data by itself

If you dey run Claude Code, you fit skip the copy-paste completely, because Claude Code fit run curl by itself. Ask am 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 go read the catalog, choose dividend_yield_leaders, fetch am, then work with the real rows. Because the agent loop dey run for your machine, e fit also work together with everything else for there: e fit save results to files, draw chart with a Python script, or compare today's screen with the one e save last week. One cost wey you need monitor: every JSON payload wey the agent fetch dey remain inside the conversation and dem go send am again for the next turn. Na why long Claude Code session dey cost plenty be this.

Linux server wey dey always on na the natural place for this workflow. Daily loop wey go "fetch the screens, compare with yesterday, write me a summary" need machine wey no dey sleep, and we get complete guide for how to run Claude Code on VPS with tmux so sessions fit continue after SSH disconnects. If you choose this method, first read our guide for how to run AI agents safely on VPS; agent wey get shell access need proper guardrails.

Way 3: Claude API wey get fetch tool

For software wey you dey build, give Claude the API as a tool. With Anthropic's Python SDK, the whole connection 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 go call the tool when question need data. You go run the fetch and send the JSON back. Then e go answer from real rows instead of memory. The client go collect your key from environment. So if this code later dey run for server or behind cloud provider, first understand how to authenticate the client there before you hardcode anything. This na also the only option wey dey charge you per token instead of using chat subscription. So if you dey ask whether Claude API get free tier, short answer be say you go get small credit when you sign up, then metered pricing go start after that. This same pattern dey work with Model Context Protocol if you prefer reusable server instead of inline tool. Our MCP servers on a VPS guide explain how to host dem.

Prompts wey fit get better analysis

Some patterns dey improve output steady, no matter how you connect:

  • Tell Claude make e cite rows. "For every claim, name the ticker and the number wey e come from." This one stop vague summaries.
  • Ask wetin the data no fit show. Delayed prices, end-of-day greeks, and fixed screen all get limits; Claude go explain dem clearly when you ask, and this go keep the analysis honest.
  • Make e compare, no be predict. "Which of these yields look sustainable based on the payout ratios wey dem show" go give grounded answer. "Which stock go rise" go give well-written guess, because the data no support prediction.
  • Keep the SQL for context. The sql field tell Claude exactly how dem build the screen, so e fit explain why one name no dey there (market-cap floor, yield ceiling) instead make e invent reason.

When fixed queries no longer enough

The demo screens fixed on purpose. The next level na Strasmore paid API: na the same warehouse, 22 years of US equities and 12 years of options history, plus your own questions for SQL or plain English with a programmatic key. The workflow still remain the same; your tool go fetch data from authenticated endpoint instead of the open one, and na you go define the questions. Claude really good at writing ClickHouse SQL against documented schema, so e fit turn “pull the dividend history of every REIT above $10B and rank by five-year growth” into one-prompt job.

FAQ

Claude fit analyze stocks without any data source?

No be with current numbers. Its training data end before today, so anything wey e talk about current prices dey come from stale memory. Give am a live API, and the analysis go base on rows wey e just fetch.

Strasmore demo API really free?

Yes. No key, no signup, no card. E dey serve catalog of fixed queries for delayed US equities and end-of-day options data, and dem deliberately make am open to AI agents.

I need VPS for this?

No. The paste-in workflow no need anything except browser. VPS become useful when you want the agent loop to run on schedule, survive disconnects, and keep local files of old results.

This na financial advice?

No. Everything for here na analysis tooling. Claude dey summarize and compare data; wetin you do with am 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 start to dey useful about numbers wey e fit know.