BSE Focused MidCap (FOCMID) Price Change — Intraday Movement and API Query Example
You need to track how much the BSE Focused MidCap index (FOCMID) moved intraday and wire that number into a dashboard or alert. In this guide, you’ll fetch the latest FOCMID quote through Indices-API, interpret the fields you need for price change, and set up a lightweight polling loop you can ship today.
What you’ll build: a practical intraday delta for FOCMID
We’ll focus on two concrete tasks:
- Read the latest FOCMID rate and interpret how quotes are expressed (index units per USD vs USD per index).
- Compute a simple intraday change by comparing the most recent tick against a previously cached tick from earlier today (or, for daily change, by using the Fluctuation endpoint).
You’ll leave with a working curl request, a JavaScript snippet you can paste into your service, and the operational notes that typically cost a few hours of trial and error.
Make sure you have the right symbol and quoting convention
This post uses the symbol FOCMID for the BSE Focused MidCap index. Always confirm symbols and availability in the official list before integrating: Indices-API Supported Symbols. If your environment relies on symbol normalization, store both the human label and the canonical code side-by-side.
Indices-API responses are base-relative. When base is USD:
- rates.FOCMID = index units per 1 USD (USD → FOCMID conversion rate).
- rates.USDFOCMID = USD per 1 index unit (FOCMID → USD conversion rate).
- rates.USD = 1 (identity for the base).
For price display in USD, most dashboards will use rates.USDFOCMID. For position sizing or conversions, choose the direction that makes your math straightforward.
Fetch the latest FOCMID print
The Latest endpoint returns a consolidated snapshot that includes FOCMID and its USD cross. Authentication is via the access_key query parameter.
curl example you can copy
curl -s 'https://indices-api.com/api/latest?access_key=YOUR_API_KEY'
Below is an official sample response for a latest snapshot. Use it to wire up your field parsing before you connect your own key:
{"data":{"success":true,"timestamp":1792197600,"date":"2026-10-17","base":"USD","rates":{"FOCMID":0.0039120990778038,"USD":1,"USDFOCMID":255.61724795615007}}}
What these fields mean for your delta calculation
- data.success: boolean guard; check it before reading fields.
- data.timestamp: Unix seconds when the snapshot was created. Use it to bucket intraday samples.
- data.date: Calendar date for the snapshot (useful for distinguishing trading vs non-trading days).
- data.base: Base currency for all quotes in rates.
- data.rates.FOCMID: FOCMID units per 1 USD. Useful for conversions from USD to index units.
- data.rates.USDFOCMID: USD per 1 FOCMID unit. Use this for price displays and deltas in USD terms.
- data.rates.USD: Identity rate for the base.
JavaScript: poll the latest endpoint and compute intraday change
This example fetches the latest snapshot, reads USDFOCMID, and computes a simple intraday delta versus a cached prior value you store in your own persistence layer. The code avoids printing any specific percentage so you can plug in your own thresholds and alerting logic.
async function fetchLatestFOCMID() {
const url = 'https://indices-api.com/api/latest?access_key=YOUR_API_KEY';
const res = await fetch(url, { method: 'GET' });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const payload = await res.json();
// Basic guards
if (!payload || !payload.data || payload.data.success !== true) {
throw new Error('API did not return success');
}
const ts = payload.data.timestamp; // Unix seconds
const asOfDate = payload.data.date; // YYYY-MM-DD
const base = payload.data.base; // 'USD'
const rates = payload.data.rates || {};
// Primary fields for FOCMID pricing
const usdPerIndex = rates['USDFOCMID']; // USD per 1 FOCMID unit
const indexPerUsd = rates['FOCMID']; // FOCMID units per 1 USD
if (typeof usdPerIndex !== 'number' || typeof indexPerUsd !== 'number') {
throw new Error('FOCMID quotes not present in the response');
}
// Retrieve the previous intraday sample from your store (you provide this).
// For example purposes, imagine you loaded previousUsdPerIndex from a DB:
const previousUsdPerIndex = await loadPreviousFOCMIDUsdPerIndex(); // number | undefined
let deltaAbsolute, deltaPct;
if (typeof previousUsdPerIndex === 'number' && previousUsdPerIndex > 0) {
deltaAbsolute = usdPerIndex - previousUsdPerIndex;
deltaPct = (deltaAbsolute / previousUsdPerIndex) * 100;
}
// Persist the current sample for the next poll
await saveFOCMIDSample({
timestamp: ts,
date: asOfDate,
base,
usdPerIndex,
indexPerUsd
});
// Return the minimal set you need for UI or alerts
return {
timestamp: ts,
date: asOfDate,
usdPerIndex,
indexPerUsd,
deltaAbsolute,
deltaPct
};
}
// Implement your own persistence methods
async function loadPreviousFOCMIDUsdPerIndex() {
// e.g., SELECT last(usdPerIndex) FROM focmid_intraday_samples WHERE date = currentDate
return undefined;
}
async function saveFOCMIDSample(sample) {
// e.g., INSERT INTO focmid_intraday_samples (...)
return true;
}
Notes:
- Use data.rates.USDFOCMID for price-like display and deltas in USD terms.
- Use data.timestamp to deduplicate repeats if your plan updates more frequently than your polling cadence.
- If you snapshot on a schedule (for example, every 1–10 minutes depending on plan), store only the latest row per interval to keep storage bounded.
Day-over-day movement with the Fluctuation endpoint
For day change and week-to-date ranges, the Fluctuation endpoint returns start_rate, end_rate, and change fields over a date window. That’s cleaner than stitching together multiple daily snapshots on your side. The endpoint and arguments are listed in the docs; use FOCMID as your symbol, and set start_date and end_date to market days in the past. For specifics and parameters, see the Indices-API Documentation.
Important constraint: end_date cannot be today. Set end_date to the most recent completed market date. For intraday change “since open,” combine your own first intraday sample of the day (or the OHLC open for the day, where available) with the latest snapshot.
Operational details you’ll want on hand
- Base currency and units: With base set to USD, FOCMID is quoted in two directions:
- rates.FOCMID = FOCMID per USD
- rates.USDFOCMID = USD per FOCMID
- Update frequency: The Latest endpoint updates on a cadence tied to your plan (for example, every 60 minutes or every 10 minutes). Poll at or just slower than the plan cadence; add modest jitter to avoid burst alignment.
- Caching: Implement a short-lived cache layer to coalesce identical snapshots across a fleet. Use data.timestamp to detect duplicates.
- Non-trading days: On weekends and local market holidays, you may see no changes across polls; persist with awareness that multiple dates can map to the last trading session’s value.
- Time bucket hygiene: Since end_date cannot be today on historical-style endpoints, keep “intraday” logic separate from “completed day” logic. Write two code paths.
- Error handling: Guard on data.success, handle HTTP non-200s, and back off with exponential retries. Log the raw payload on parse errors.
How to wire FOCMID into charts and alerts
Alerting strategy
- Threshold alerts: Compare the latest USDFOCMID to a stored open or a prior time bucket and trigger when abs(deltaPct) exceeds your threshold.
- Rate-of-change windows: Keep a ring buffer of the last N snapshots and alert on slope changes instead of point-to-point deltas.
- Trading-hours gating: Gate alerts to Indian market hours for FOCMID, and suppress during weekends/holidays.
Charting notes
- For intraday charts, poll Latest on an interval consistent with plan cadence. Resample into fixed buckets (e.g., 1m or 5m) to keep series uniform.
- For EOD charts, use the Fluctuation or time-series endpoints to derive day-level points, abiding by the “end_date cannot be today” rule.
- Display both USDFOCMID (USD price) and, if helpful, the reciprocal FOCMID (index units per USD) in tooltips so users can reason about conversions.
Security, keys, and environment setup
Store your API key in a secret manager or environment variable; never commit it to version control. The API authenticates via the access_key query parameter. If your architecture needs multiple services to read Indices-API, consider an internal proxy with request shaping and response caching.
You can find the complete parameter list, endpoint behaviors, and examples in the Documentation. When you’re ready to try it live, start a free 7‑day trial on the PRO plan ($49.99/mo after) and get an API key here: Register.
Quality checks and validation
- Cross-verify symbol: Reconfirm FOCMID on the Symbols page before shipping.
- Sanity bounds: Place sanity constraints on rates.USDFOCMID (e.g., non-negative and within a historically reasonable range) before rendering.
- Auditability: Persist raw payloads keyed by timestamp so you can explain historical UI states if a user asks about a past alert.
Where to go next
- Dive deeper into interval candles and OHLC aggregation in the docs: Indices-API Documentation.
- Explore additional resources relevant to Indian equities and indices, like the official exchange portal: BSE Index Archive.
- If you maintain an internal change pipeline, you may also find this resource useful: MCP.
FAQ
How do I interpret rates.FOCMID vs rates.USDFOCMID?
With base "USD", rates.FOCMID is index units per USD, while rates.USDFOCMID is USD per index unit. For displaying a “price in USD,” use rates.USDFOCMID.
Why can’t I set end_date to today for historical-style endpoints?
Historical and fluctuation windows operate on completed sessions. Set end_date to the most recent completed market day. Use the Latest endpoint for intraday.
How often does Latest update?
It depends on your subscription plan. Poll at or slower than your plan’s cadence (for example, every 60 minutes or every 10 minutes). Add jitter to avoid synchronized bursts.
What should I do on weekends and holidays?
Expect no change across snapshots during non-trading days. Keep intraday and EOD logic separate, and gate alerts to local trading hours.
Can I restrict the Latest response to just FOCMID?
Filter client-side using the rates map, or consult the Documentation for request parameters that may narrow the response, depending on your plan.
Ready to plug in a key and ship your first FOCMID intraday alert? Start your free 7‑day trial on PRO ($49.99/mo afterwards) and get your access_key here: Register. If you need to confirm symbol availability first, check the Indices-API Supported Symbols list.