Historical requests combine a candle interval, a count and optionally an anchor timestamp. They are not a conventional SQL query between two dates. Understanding the direction of the request avoids exporting a valid response that covers the wrong period.
Choose an interval and a count
Use the dedicated /api/price/ohlcv/{symbol} endpoint for standard candles. Common interval values include 1, 5, 15, 30, 60, 240, D, W and M; the numeric forms represent minutes, while M represents monthly candles. Verify availability for your specific instrument and timeframe.
range=10 asks for ten candles. Ten daily candles may span more than ten calendar days because some markets close on weekends or holidays. A returned count below the requested count is not proof of a complete window. Record both counts and the actual minimum and maximum timestamp.
Understand from and to precedence
With a positive count and to, the request looks backward from the supplied timestamp. With from, it requests forward from that anchor. If both parameters are present, from takes precedence and to is ignored. Do not use both expecting a closed date interval.
The following is a fixed historical example, not a request for the latest market data. Timestamps are Unix seconds, not JavaScript milliseconds. Set the server environment using the quickstart first.
curl --fail-with-body --get "$NAVQUOTE_API_BASE/api/price/ohlcv/NASDAQ:AAPL" \
-H "Authorization: Bearer $API_KEY" \
--data-urlencode "timeframe=D" \
--data-urlencode "range=10" \
--data-urlencode "from=1704153600" \
--data-urlencode "adjustment=splits"
That anchor is January 2, 2024 at 00:00 UTC. It is not a guarantee that the first returned bar begins exactly at that instant. Candle alignment depends on the interval and market session. Inspect the response and apply your own inclusion rule.
Filter a requested analysis period explicitly
For a half-open interval [start, end), retain bars whose time is at least start and less than end. Sort by time and deduplicate by instrument, timeframe, adjustment and timestamp. Keep the requested boundaries in a manifest so filtering remains reproducible.
If multiple requests are necessary, check that each request advances the earliest or latest observed timestamp in the intended direction. Stop when there is no progress, an empty result or an application-defined request budget is reached. Do not assume unlimited paging or that subtracting one second always yields the next complete page; anchoring and interval alignment need verification for the selected market.
Keep adjustment consistent
adjustment=splits is the default split-adjusted mode. adjustment=dividends also applies cash-dividend adjustment. Select one policy before joining data across requests, and include it in your dataset key. Combining a split-adjusted file with a differently adjusted file can create artificial discontinuities.
Adjusted historical prices may change after later corporate actions. If you require exact reproduction of a past analysis, archive the returned dataset and retrieval time; recording request parameters alone does not freeze the underlying history.
Inspect the last candle and gaps
A currently forming candle may be incomplete even when the HTTP request succeeds. Do not infer that a daily candle is final merely because your own local calendar date has changed. Check the instrument’s session timezone and whether that interval has closed.
Similarly, a missing interval can represent a closed market, an inactive instrument or unavailable data. Preserve gaps rather than filling them with invented OHLCV values. The CSV export guide provides a concrete normalization step; coverage and historical-depth verification remain separate acceptance checks.