QVeris

Finance & Market Data

How to Add Real-Time Stock Market Data to Claude

Build reliable real-time stock data workflows for Claude with verified timestamps, market coverage, freshness, and failure handling.

Published: April 18, 2026 · By the QVeris Team

Stock-market quotes displayed across a laptop and mobile device
Stock-market quotes displayed across a laptop and mobile device
Stock-market quotes displayed across a laptop and mobile device
Core pattern: Claude requests a quote; application code validates the instrument, queries the entitled feed, normalizes the response, and returns evidence. Claude explains it but never invents the price.
Decision 01

Choose the Claude surface first

MESSAGES API

Application-owned tool use

For a web app or analyst copilot, your backend sends the tool definition, executes Claude’s selected function, and returns a matching tool result.

Anthropic tool use
MCP

Claude discovers a server

For Claude Code or Desktop, the server exposes read-only tools and keeps provider credentials outside the conversation.

Anthropic MCP
Browsing is not a quote feed. Pages may be cached, delayed, or licensed only for display.
Contract 02

Make “real time” a field, not a claim

instrument Symbol, exchange, asset type
price Value and currency
as_of Provider timestamp
feed Provider and entitlement
freshness Real-time, delayed, close
session Pre, regular, after, closed
{ "instrument": { "symbol": "AAPL", "exchange": "NASDAQ" }, "price": 0, "currency": "USD", "as_of": "provider timestamp", "provider": "configured source", "feed": "entitled feed", "freshness": "real_time | delayed", "session": "regular | closed" }

The zero is a schema placeholder—not a quote.

Execution 03

Run Claude’s tool loop deliberately

Describe one read-only operation

Define get_stock_quote with symbol and optional exchange. State that it cannot trade.

Validate outside the model

Resolve ambiguous tickers, cap batches, and never let Claude build a URL containing credentials.

Execute and normalize

Call a snapshot or read the newest validated stream event, then convert it to the contract.

Return evidence and errors

Preserve ambiguity, halt, stale cache, entitlement, rate-limit, and timeout states.

Constrain the answer

Require price, currency, exchange, session, source, and time. If stale, say unavailable.

Connect with the QVeris MCP guide, inspect the tool directory, and test in the Playground.
Streaming 04

Keep the firehose outside Claude

INGEST

Subscribe narrowly

Request only needed symbols and event types; monitor reconnects and sequence.

REDUCE

Validate and aggregate

Deduplicate, detect out-of-order data, and retain provenance.

REASON

Send bounded context

Send a snapshot or threshold event—not thousands of ticks.

Alpaca documents separate SIP, IEX, and delayed SIP feeds. Expose the feed instead of calling everything “live.” Read its stream documentation and FAQ.

Acceptance 05

Prove freshness—and honest failure

Test Condition Required behavior
Fresh quote Known symbol, valid entitlement Show value, currency, exchange, source, session, time
Ambiguous Multiple instruments Ask; do not guess
Closed Earlier session Label last trade or close
Stale Age exceeds threshold Return stale or unavailable
Failure Timeout, limit, auth Never fall back to model memory
Source design 06

Choose the market-data mode from the question

“Real-time stock market data for Claude” does not mean every workflow needs a continuous stream. Match retrieval to the decision Claude must support.

IntentBest inputDisclose
Current priceLatest quote or trade snapshotValue type, feed, time, session
Spread alertWebSocket plus rule engineTrigger, window, event time
Intraday summaryValidated intraday barsInterval, timezone, partial status
Historical comparisonHistorical bars with adjustment policyRange, adjustment, missing sessions
TRADE

Last execution

A completed trade is not necessarily the price available for a new order.

QUOTE

Bid and ask

Claude should name the cited side instead of flattening both into one “stock price.”

BAR

Aggregated interval

Mark an in-progress OHLCV bar before comparing it with completed periods.

Tool definition 07

Give Claude a schema that prevents guessing

State when the tool is required, what it cannot do, and which ambiguity must be resolved. Application code validates arguments and accesses the provider.

symbolRequired; never infer exchange
exchangeRequired when ambiguous
modelatest_quote · latest_trade · snapshot
max_age_msApplication freshness threshold
extended_hoursExplicit session scope
{ "name": "get_stock_quote", "description": "Read-only current quote. Never places orders. Ask for exchange when ambiguous.", "input_schema": { "type": "object", "properties": { "symbol": { "type": "string" }, "exchange": { "type": "string" }, "mode": { "enum": ["latest_quote", "latest_trade", "snapshot"] } }, "required": ["symbol", "mode"] } }
Explicit result states: ok, ambiguous_instrument, stale, market_halt, not_entitled, rate_limited, provider_unavailable.
Production controls 08

Control latency, cost, permissions, and licensing

Read-only boundary

Separate data credentials from brokerage credentials. Trading needs another tool, credential, approval path, and audit trail.

Freshness budget

Define acceptable quote age per workflow and reject data beyond it.

Cache with provenance

Store provider time, receive time, feed, entitlement, and visible cache age.

Redistribution rights

Review terms for end-user display, derived output, storage, and multi-user access.

Observability

Log sanitized arguments, feed, event time, cache age, latency, and outcome. Redact secrets.

Injection resistance

Treat news as data, not instructions. Accept typed parameters—not retrieved URLs or headers.

Troubleshooting 09

Diagnose the data path before changing the prompt

SymptomLikely causeAction
No tool callDescription misses live intentRequire the tool for current, latest, bid, ask, and session queries
Different priceDifferent feed, field, session, or timeCompare identical instrument, feed, value type, and timestamp
No symbol dataOTC entitlement, inactivity, halt, symbol changeResolve metadata; never substitute a similar ticker
HTTP 403Credentials, host, or entitlementCheck auth and label any feed downgrade
Old latest eventClosed, halt, stale connection, delayed feedCheck calendar, connection, feed class, provider time
Launch playbook 10

Validate the workflow in four passes

Contract tests

Test valid, ambiguous, inactive, and unsupported symbols; assert evidence fields and timezone parsing.

Session tests

Run before open, during regular hours, after close, on holidays, and in extended hours.

Failure injection

Simulate timeout, 403, 429, broken stream, stale cache, malformed payload, and out-of-order events.

Answer review

Verify multiple phrasings return instrument, value type, currency, exchange, session, provider/feed, and time.

Production gate: Distinguish unavailable from numeric zero, and delayed or partial coverage from consolidated real time.
Reference 11

Terms Claude should use precisely

As-of time

Market observation time, not answer-generation time.

Feed

Delivery source and coverage class.

Freshness

Measured age and declared delay class.

Session

Pre-market, regular, after-hours, or closed.

Quote

Bid and ask; different from a completed trade.

Snapshot

Bounded latest fields at a defined retrieval time.

FAQ

Real-time stock data for Claude

Does Claude include real-time prices?

Do not treat Claude as a licensed feed. Connect an external source and return timestamp, feed, and session.

MCP or Messages API?

Use Messages API in your app; use MCP when a Claude client should discover the capability.

Send every tick?

No. Aggregate outside the model and send a bounded snapshot.

A verified profile link does not guarantee entitlement, field availability, price or current execution success; inspect the current contract before calling.

How to Add Real-Time Stock Market Data to Claude | QVeris Guides