PREVIEW · Proposed endpoints and dated plan snapshot · Not ready for public launch
navquote.
Menu
Quotes

Get stock quotes in Python

Build a Python quote request with environment credentials, timeout handling, nested response validation and UTC timestamps before storing market data.

NavQuote integration guides · Reviewed September 27, 2026

Local preview: neutral endpoints are pending live validation. Examples describe the current implementation contract; confirm endpoint availability and plan access before using them with live data.

A useful quote integration returns more than a number: it identifies the instrument, preserves the data timestamp and makes unavailable data visible. This example builds that boundary in a Python script before you connect a database, notebook or dashboard.

Prepare a server-side environment

Use Python 3 with requests installed: python -m pip install requests. Create an API key in the shared Console, then set API_KEY and NAVQUOTE_API_BASE in your server or shell environment. The proposed base is https://api.navquote.com; its live validation is pending. Do not put the key in a notebook you plan to share.

Save the following as quote.py and run python quote.py. NASDAQ:AAPL is an instrument example, not a statement about current availability or delivery speed. Confirm the exchange and instrument you need before using a ticker in your application.

Fetch and validate one quote

The response has two data levels: the outer object identifies the symbol; the inner object contains quote fields. lp_time is interpreted as Unix seconds. The script emits a timezone-aware UTC value so a downstream consumer does not mistake it for local time. It rejects missing data instead of inventing a zero price.

Decide what to store

Keep the symbol and currency alongside the price. Store market time separately from receive time: a fast HTTP response may contain an older observation. A degraded result can still contain data, but your application should retain that flag rather than present the value as a newly observed trade.

This example prints one record and exits. For a scheduled job, write the validated record to storage only after all required fields pass your checks. Keep the last successful record when a later attempt fails, and mark it as stale in the consumer. See the freshness guide for the distinction between old, unavailable and delayed data.

Handle failures before adding retries

An HTTP error, a JSON success: false response and a missing price are different failures. Check credentials and plan access for authorization errors; check symbol identity for unavailable instruments. Repeating the same invalid request will not fix either condition.

For temporary transport failures, add a bounded retry policy with backoff and a total deadline appropriate to your job. Do not add an unbounded loop around this script. Once one quote works, use the batch watchlist guide to retrieve multiple instruments while retaining per-symbol outcomes.

Build your first working request.

One account for API keys, usage and subscriptions.

Get API Key

Continue to our shared account console.