Congolese Franc (CDF) OHLC Data: API request examples and pagination tips
You need daily OHLC bars for the Congolese Franc (CDF) to power a chart, an alerting rule, or a backfill job across months of history. In this guide you’ll learn how to fetch CDF prices over HTTP, interpret the response, and paginate day-by-day OHLC pulls so you can render candles and keep them up to date.
What you will build
By the end of this article you will be able to:
- Request the latest CDF price and parse its fields (base, date, timestamp, rates).
- Request daily OHLC bars for CDF for any past date and organize them into candles.
- Paginate OHLC pulls across long ranges without guessing at undocumented pagination parameters.
- Handle trading-day gaps, caching, and update-frequency nuances so your charts stay accurate.
If you are new to Indices-API, you can explore the product at indices-api.com and get an API key here: Register.
Understand how CDF quotes are expressed
Indices-API responses are denominated relative to a base currency. For currency data, the default base is USD, and the JSON returns a rates object keyed by symbols. In CDF responses you will typically see:
base: The pricing base, usuallyUSD.rates.CDF: Units of CDF per 1 USD (i.e., how many Congolese Franc a single US Dollar buys).rates.USDCDF(when present): USD per 1 CDF (the inverse of the above), useful when you want to convert a CDF amount into USD directly.
Confirm the exact symbol codes you plan to query on the Indices-API Supported Symbols page before you ship to production.
Quick start: get the latest CDF price
The latest endpoint returns current prices relative to the base currency and updates on a schedule that depends on your plan (for example, every 60 or 10 minutes). Use your access key with the access_key query parameter.
curl example
curl -s "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
Official JSON response
{"data":{"success":true,"timestamp":1792730400,"date":"2026-10-23","base":"USD","rates":{"CDF":2315.327179,"USD":1,"USDCDF":0.0004319044017061573}}}
Field primer:
success: Boolean indicator of a successful request.timestamp: Unix epoch (seconds) for when the prices were last updated. Treat this as UTC.date: The calendar date that the response corresponds to (YYYY-MM-DD).base: The base currency of the quotes, hereUSD.rates.CDF: CDF per 1 USD (e.g., 1 USD ≈ 2315.327179 CDF).rates.USDCDF: USD per 1 CDF (≈ 0.0004319044 USD), the inverse ofCDF.
Python snippet to parse and use the fields
import requests
from datetime import datetime, timezone
API_KEY = "YOUR_API_KEY"
url = "https://indices-api.com/api/latest"
resp = requests.get(url, params={"access_key": API_KEY}, timeout=10)
resp.raise_for_status()
payload = resp.json()["data"]
# Core fields
success = payload["success"]
ts = payload["timestamp"] # seconds since epoch (UTC)
asof = datetime.fromtimestamp(ts, tz=timezone.utc)
base = payload["base"]
date = payload["date"]
rates = payload["rates"]
cdf_per_usd = rates.get("CDF") # how many CDF one USD buys
usd_per_cdf = rates.get("USDCDF") # how many USD one CDF buys (inverse)
usd_per_usd = rates.get("USD", 1) # 1 by definition under USD base
print(f"Success: {success}")
print(f"As-of (UTC): {asof} | Date: {date} | Base: {base}")
print(f"USD→CDF: {cdf_per_usd} | CDF→USD: {usd_per_cdf} | USD: {usd_per_usd}")
# Example: convert 100,000 CDF to USD using the provided inverse rate
amount_cdf = 100_000
if usd_per_cdf:
est_usd = amount_cdf * usd_per_cdf
print(f"{amount_cdf} CDF ≈ {est_usd:.2f} USD")
Daily candles: how to request CDF OHLC
For candlestick charts and backtests you need open, high, low, and close for a given date. Use the OHLC endpoint to fetch CDF for a specific day:
- Endpoint pattern:
/api/open-high-low-close/YYYY-MM-DD - Auth:
access_keyquery parameter - Base: Defaults to
USDunless otherwise specified. Your OHLC prices will be relative to that base.
Example request shape (do not paste values for the candle itself here; do not invent candles):
# GET the OHLC bar for Oct 23, 2026 (example date)
https://indices-api.com/api/open-high-low-close/2026-10-23?access_key=YOUR_API_KEY
This call returns OHLC for supported symbols on that date. Use the response’s rates object to access the CDF fields (e.g., rates.CDF.open, rates.CDF.high, rates.CDF.low, rates.CDF.close) if CDF is supported for OHLC on that date. Always verify the CDF symbol and related keys on the Symbols page before coding to the response schema.
Notes that will save you time:
- End dates cannot be “today.” For daily OHLC, query up to the most recent completed day.
- Weekends and non-trading days typically won’t produce new candles. Structure your backfill to skip dates that do not appear.
- Timestamps are UTC. Store them as such to avoid off-by-one date bugs when you plot OHLC by session.
Efficient backfilling and pagination without guesswork
The OHLC endpoint is date-addressable (one candle per request), so you won’t use a numeric “page” parameter. Instead, paginate by iterating dates deterministically:
- Pick a start date and an end date (the end date should be no later than yesterday).
- Generate a list of YYYY-MM-DD strings for that range.
- Loop across that list and request
/api/open-high-low-close/<date>for each date with youraccess_key. - Upsert responses into storage keyed by date + symbol to ensure idempotence.
If you need to pre-check which days are likely to have data for CDF, you can build a date “scaffold” using the time-series endpoint and then request the OHLC bar for each date from that scaffold:
- Time-series endpoint: Use it to enumerate days within a range. It returns a
ratesmap keyed by date. See the Documentation for request and response details. - For each date present in the time-series response, call the OHLC endpoint once and capture the candle for CDF.
Concurrency and retry tips:
- Batch your date list into small chunks (e.g., 5–20 concurrent requests) to avoid saturating connections.
- Implement backoff on non-200 responses.
- Honor cache headers where supplied and add your own short cache (e.g., 30–60 seconds) for “latest” pulls; OHLC for past dates is immutable, so you can cache indefinitely once written.
Handling base currency and conversions in OHLC workflows
Because the API’s default base is USD, your CDF OHLC values reflect prices “per USD.” That is, each bar’s open/high/low/close tells you how many CDF one USD bought at those points during the day. If your UI or analytics need the inverse (USD per CDF), convert on the fly with the inverse rate or, when the response includes a helper key like USDCDF, use that directly. For historical candles without an explicit inverse field, compute it as 1 / CDF_value with appropriate precision.
When mixing “latest” and “OHLC” data, be aware that:
- Latest quotes update intra-day according to your plan’s polling cadence; they are not OHLC bars.
- Daily OHLC bars complete after the trading day ends and remain stable thereafter.
- Never stitch “today” into a daily candle unless the exchange day is fully closed for CDF; instead, show an “in-progress” intraday quote separate from the completed last daily bar.
Putting it together: a day-by-day CDF OHLC backfill planner
A practical flow for initial backfill might be:
- Select a historical window, for example, the last 365 completed days.
- Generate the day sequence and filter out weekends or holidays if you maintain a trading calendar for CDF. If you don’t maintain one, just attempt the requests and skip days with no CDF candle in the response.
- For each remaining date, call
/api/open-high-low-close/<date>?access_key=YOUR_API_KEY. - Extract
rates.CDF.open/high/low/closeandtimestamp/datefor storage. - Re-run this job daily after the market close for that session to append the newest completed bar.
For longer ranges, use a daily worker that maintains a watermark date. On success, advance the watermark and persist progress, so retries resume where they left off.
Operational considerations that prevent subtle bugs
- Timezone: Treat all timestamps as UTC. If your application displays local time, convert during presentation, not storage.
- End-date rules: Avoid using “today” for end dates. Use “yesterday” or the last confirmed completed date to keep charts consistent.
- Update frequency: The “latest” endpoint is refreshed on a plan-dependent schedule (e.g., 60 or 10 minutes). Do not poll faster than updates; it just increases load.
- Idempotence: Key OHLC records by
(symbol, date). Upserts protect you from duplicates and let you safely re-run failed batches. - Caching: Cache yesterday’s daily OHLC indefinitely since it won’t change. For intra-day “latest,” a short cache saves bandwidth across dashboards or microservices.
Where to find more details and get an API key
Review request/response schemas, optional parameters, and additional endpoints, including intraday candles, in the Indices-API Documentation. Confirm CDF and any related symbols on the Symbols page before hard-coding them.
For deployment patterns and connectivity guidance, see MCP. If you have not yet created your account, sign up here: Register. You can always return to the home page at indices-api.com for product overview and updates.
Working with update cadence, weekends, and rate inversions
Currency markets do not observe equity exchange hours, but you should still expect stalled updates on weekends and certain holidays. Your “latest” responses may keep the same timestamp for extended periods during closures; treat that as a signal to pause polling. When the market reopens, resume your normal cadence.
For inversions:
- If the API returns
rates.USDCDFalongsiderates.CDF, prefer the explicitly provided key for conversions to minimize rounding error. - If only
rates.CDFis present, computeUSD per CDF = 1 / rates.CDFusing decimal arithmetic with sufficient precision.
Production hardening checklist
- Monitoring: Alert on gaps in daily OHLC delivery (e.g., missing yesterday’s CDF bar by a cutoff time).
- Storage: Use a columnar or time-series store keyed by
(symbol, date)with indices ondatefor fast range queries. - Validation: Assert that
low ≤ open/close ≤ highafter parsing OHLC; reject anomalies early. - Backoff: Exponential backoff with jitter on transient HTTP failures.
- Replay: Keep your date iteration idempotent so you can replay date windows safely.
FAQ
Can I request OHLC for “today”?
Use “yesterday” or the last completed session. End dates cannot be today. For intra-day visuals, combine the “latest” endpoint with the most recent completed daily bar.
How often do latest CDF quotes update?
The cadence depends on your subscription plan (for example, every 60 or 10 minutes). Check the Documentation for specifics relevant to your tier.
What symbol should I use for Congolese Franc?
Use CDF, and confirm any pair-style keys (such as USDCDF) on the Symbols page before hard-coding.
How do I paginate OHLC results?
There is no numeric page parameter. Iterate dates: one /api/open-high-low-close/YYYY-MM-DD request per day you need. Chunk your requests and retry with backoff.
What base currency are CDF OHLC prices in?
By default, USD. Each OHLC value expresses “CDF per 1 USD” for that day unless you override the base (see the Documentation for base overrides).
Ready to ship CDF candles into your charts? Create your key now and start querying in minutes: Register. For overview and updates, visit indices-api.com.