S&P/BMV INMEX (INMEX) OHLC API — retrieving intraday 1-minute and 5-minute bars
You need intraday candles for the S&P/BMV INMEX (INMEX) to power a live chart, calculate VWAP, or trigger alerts. By the end of this guide you will pull a verified latest print for INMEX, understand how to request OHLC and intraday bars for a specific trading date, and roll 1-minute bars up to 5-minute intervals to drive your dashboards and backtests.
What we are building: 1-minute and 5-minute INMEX bars you can chart today
The immediate job is to obtain reliable intraday OHLC candles for the INMEX index at 1-minute granularity, and aggregate those to 5-minute bars without gaps. We will:
- Confirm the correct symbol (INMEX) and trading-day constraints.
- Verify connectivity and base currency using the latest endpoint.
- Request daily OHLC and intraday candles for a target date (Mexico City trading day).
- Aggregate 1-minute candles into 5-minute bars in your code.
We will focus on two Indices-API endpoints that matter here: Latest (for sanity checks) and OHLC/Intraday (for candles). For full parameter details, see the Indices-API Documentation. If you do not have an API key, start a 7‑day trial on the PRO plan ($49.99/mo) here: Register.
Prerequisites, symbol check, and trading hours
We will use the symbol INMEX for S&P/BMV INMEX. If you need to confirm the exact symbol code or discover variants, use the official Symbols directory. Do not guess symbols—production builds should validate against the symbols list at startup time.
INMEX tracks the Mexican equity market and follows Mexico City local trading days and hours. Expect no intraday data on weekends and local exchange holidays. If you schedule backfills, align your calendar to the Bolsa Mexicana de Valores holiday schedule. Helpful references:
- Exchange calendar overview: Bolsa Mexicana de Valores (BMV)
- Time zone: Mexico City (usually UTC−6, UTC−5 in daylight saving).
Authentication and response model basics
All calls use a query parameter access_key. Example: ?access_key=YOUR_API_KEY. The API returns JSON where:
- base denotes the base currency for rates; by default, USD.
- timestamp is a Unix epoch (seconds) in UTC for when the data snapshot was produced.
- date is the UTC date associated with the snapshot or requested period.
- rates is a map of symbols to numeric values relative to base.
For the latest endpoint, rates for indices are expressed relative to USD. You will also encounter reciprocal convenience keys (e.g., USDINMEX) when provided, which are useful for inverting conversions without client-side math. Learn more at indices-api.com and the endpoint docs linked below.
Quick connectivity and sanity check with the latest endpoint
Before charting, verify you can obtain a current print for INMEX. Use the latest endpoint. This also helps confirm your key, symbol availability, and the base currency.
cURL request
curl -s "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
Official JSON response (copy as-is for your tests)
{"data":{"success":true,"timestamp":1793320860,"date":"2026-10-30","base":"USD","rates":{"INMEX":0.0043086544570782,"USD":1,"USDINMEX":232.09101819646114}}}
What these fields mean for your downstream processing
- success: Boolean indicating the call succeeded.
- timestamp: 1793320860 is a Unix epoch in seconds (UTC). Use it for caching and freshness checks.
- date: "2026-10-30" is the UTC date for the returned snapshot.
- base: "USD" indicates all rate values are relative to USD.
- rates.INMEX: 0.0043086544570782 represents the rate of INMEX quoted against USD (relative to base).
- rates.USDINMEX: 232.09101819646114 is the reciprocal mapping, useful if you need to invert the quote quickly.
If you cache latest responses server-side, store by symbol and timestamp to avoid re-fetching within your freshness SLA. Production apps typically cache for the plan’s update cadence (e.g., 10 or 60 minutes depending on subscription). See your plan details and the Documentation for guidance.
JavaScript example to read these fields
async function fetchInmexLatest() {
const url = "https://indices-api.com/api/latest?access_key=YOUR_API_KEY";
const res = await fetch(url, { headers: { "Accept": "application/json" } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const payload = await res.json();
// The official sample nests the content under payload.data
const { success, timestamp, date, base, rates } = payload.data;
if (!success) throw new Error("Latest call failed");
const inmexRate = rates["INMEX"]; // relative to USD (base)
const usdToInmex = rates["USDINMEX"]; // reciprocal if you need it
return {
timestamp,
date,
base,
inmexRate,
usdToInmex
};
}
fetchInmexLatest()
.then(console.log)
.catch(console.error);
Daily OHLC for a given INMEX trading date
Use the OHLC endpoint to retrieve the open, high, low, and close for INMEX on a specific date. The format follows an open-high-low-close/YYYY-MM-DD path and returns a rates object keyed by symbol with OHLC fields.
- Endpoint: open-high-low-close/YYYY-MM-DD
- Method: GET
- Auth: access_key query parameter
- Symbols: Use INMEX (validate on the Symbols page)
Notes that will save you time:
- Dates are in YYYY-MM-DD and interpreted in UTC on the wire; align to Mexico City local date when choosing which YYYY-MM-DD to request.
- If the target date is a non-trading day, expect no INMEX OHLC record.
- Do not set an end_date to today for historical or time-series style pulls; as a rule, the most recent complete day is the last fully settled candle. Request today’s partials with latest or intraday as appropriate.
If you need to reconcile day-level OHLC with your intraday aggregation, compute your own O/H/L/C from the 1-minute bars for that date and compare to the OHLC endpoint’s values to detect gaps or rounding differences.
Intraday endpoint for 1-minute and 5-minute INMEX bars
The intraday endpoint provides interval-based candles for a specific date. Use it to fetch 1-minute bars directly. To obtain 5-minute bars, aggregate those 1-minute candles in your application logic by slotting them into fixed 5-minute windows (e.g., 09:00–09:04, 09:05–09:09, etc. in Mexico City time) and computing:
- Open: first 1-minute open in the window.
- High: max of the 1-minute highs in the window.
- Low: min of the 1-minute lows in the window.
- Close: last 1-minute close in the window.
- Volume (if provided): sum across the 1-minute bars.
Practical pointers for intraday pulls:
- Always request a single calendar trading date at a time; retry with backoff if you hit transient errors.
- Normalize timestamps to Mexico City local time when windowing into 1-minute and 5-minute buckets.
- If the exchange has auction or pre-open sessions, decide whether to include them in your bar set before aggregating.
- Cache raw 1-minute bars as your source of truth; regenerate 5-minute aggregates on demand to avoid double storage.
For the full parameter list supported by intraday (date inputs, available interval options, any pagination and limits), refer to the Documentation. If you are unsure whether your plan includes intraday OHLC for INMEX, check the marketplace coverage page here: MCP.
Handling trading days, freshness, and caching
Weekend and holiday behavior: if you request OHLC or intraday data on a non-trading day, you may receive an empty series for INMEX. When scheduling backfills, iterate over an exchange-aware calendar to avoid unnecessary calls. For ongoing ingestion, use a market-hours gate that suppresses intraday calls outside of the exchange session.
Update frequency: the latest endpoint updates depend on your plan, often 60-minute or 10-minute refresh windows. Treat timestamp as your authoritative freshness marker. For intraday and OHLC, once the date is complete and settled, values should not change; cache those aggressively.
End-of-day timing: do not request end_date equal to today when using historical or time-series style calls. Today’s data is incomplete until session close; use the intraday endpoint to monitor in-flight candles and switch to the daily OHLC after settlement on the next UTC day.
Verifying symbol availability and base currency assumptions
Always confirm that INMEX is listed and intraday-ready on the Symbols page before you deploy. The API returns index rates by default relative to USD. In the latest sample above, rates.USD is 1 and rates.INMEX is quoted in the USD base context. If you need to display values in another currency or invert the quote, use reciprocal fields such as USDINMEX when provided, or compute them client-side.
If your application needs consistency across multiple indices and currencies, keep a single normalization layer where you convert rates to your app’s base. For more on currency normalization and endpoints, see indices-api.com and the endpoint reference.
Operational checklist for 1-minute and 5-minute bars
- Bootstrap with latest to confirm INMEX availability and timestamp freshness.
- Pull intraday 1-minute bars for the target Mexico City trading date.
- Aggregate to 5-minute bars using windowed O/H/L/C rules.
- Compare your aggregated 1-day O/H/L/C to the OHLC endpoint for the same date to validate completeness.
- Cache raw 1-minute and derived 5-minute bars; re-use unless you detect upstream updates.
Plan, pricing, and getting your API key
To run the calls above in production, start with the PRO plan ($49.99/mo) and a 7‑day trial. You can create your key here: Register. Keep your access_key confidential and rotate it periodically according to your security policy.
Troubleshooting and edge cases
- Empty intraday set: Verify the date is a trading day in Mexico City and that the session has begun. If you query too early, the set may be empty.
- Close mismatches: If your 1-minute aggregation close differs from OHLC’s daily close, confirm your session cutoff and whether you included auctions.
- Today’s data gaps: Don’t use end_date=today for historical pulls. Combine latest and intraday for in-session monitoring; reconcile next day with daily OHLC.
- Timezone drift: Normalize timestamps to Mexico City local time for bar windowing, even though the API timestamps are UTC.
FAQ
How do I confirm the correct symbol code for S&P/BMV INMEX?
Use the official symbols directory and search for INMEX: Symbols. Do not hardcode symbols without verification.
Why does my end_date=today request fail or return incomplete data?
The latest trading day is not considered complete until after session close and settlement. Avoid setting end_date to today for historical or time-series pulls; use intraday for in-session candles and daily OHLC starting the next UTC day.
What timezone should I use to aggregate 1-minute bars into 5-minute bars?
Use Mexico City local time (exchange time) to define your 5-minute windows. Convert API timestamps (UTC) into local time before bucketing.
Can I get 5-minute bars directly?
Use the intraday endpoint’s interval capabilities for the target date if supported by your plan. If you prefer consistency, request 1-minute candles and aggregate to 5-minute windows in your code.
How are the rates quoted relative to USD?
The base field is “USD” by default, and rates are relative to that base. In the official latest example, rates.INMEX is returned in the USD base context, with a reciprocal USDINMEX for convenience.
Get your key and start streaming INMEX intraday OHLC today. Create a free trial on PRO and follow the endpoint specs here: Register. For endpoint details and parameters, see the Documentation, and verify symbols any time via Symbols.