How to Get BSE 250 MICROCAP (MC250) Prices via API using curl examples for quick tests
To chart BSE 250 MICROCAP or alert on a move, you first need to retrieve MC250, identify the quote you are displaying, and know how fresh it is. By the end of this guide, you can test the latest endpoint with curl, read the response in Python, and design a historical series without treating weekends or stale snapshots as new market moves.
Test the latest MC250 quote with curl
Get a free API key from Indices-API Register, then replace YOUR_API_KEY in this request:
curl "https://indices-api.com/api/latest?access_key=YOUR_API_KEY"
The latest endpoint returns a JSON object containing rates. The request does not filter for a symbol; select MC250 from the response rather than assuming every returned rate belongs on your chart.
The key is part of the URL, so take care when sharing shell history, logs, monitoring traces, or screenshots. For an application, load it from an environment variable or a secret manager instead of committing it to source control.
MC250 is the symbol used in the response below. For a production integration, check Indices-API Supported Symbols for the current symbol listing and specifications.
Read the response and its units
The following is an actual response example. Values and dates will differ when you make your own request.
{"data":{"success":true,"timestamp":1795653600,"date":"2026-11-26","base":"USD","rates":{"MC250":0.0049850221141291,"USD":1,"USDMC250":200.6009155236623}}}
Start at the outer data object and check success. Then use these fields together rather than storing a number without its context:
rates.MC250is the MC250 rate relative to the stated USD base. In this response it is approximately the reciprocal ofrates.USDMC250.rates.USDMC250is the inverse quote shown in the response. Choose the orientation your application needs and keep it consistent across charts, alerts, and stored observations.rates.USDis the base rate, shown as one in this response.baseidentifies USD as the response base.dateis the date label returned with the data.timestampis a Unix timestamp in seconds; convert it to UTC for a portable freshness display.
Quote orientation matters. A rise in MC250 and a rise in its inverse are not the same movement. The response provides USD-relative rates; it does not by itself establish that either number is the official BSE index level in local index points. Verify the intended units against the symbol specifications before labeling a display “index points.”
Keep the original field name, base, date, and timestamp alongside the value you persist. That makes it possible to audit whether a chart uses the direct or inverse quote and to detect a change in the data returned by a future request.
Fetch and validate the quote in Python
This example calls the same latest endpoint and reads both MC250 orientations. It uses only the Python standard library. Set INDICES_API_KEY in your environment before running it.
import json
import os
from datetime import datetime, timezone
from decimal import Decimal
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import urlopen
key = os.environ.get("INDICES_API_KEY")
if not key:
raise SystemExit("Set INDICES_API_KEY before running this script.")
url = "https://indices-api.com/api/latest?" + urlencode(
{"access_key": key}
)
try:
with urlopen(url, timeout=10) as response:
payload = json.loads(response.read(), parse_float=Decimal)
except (HTTPError, URLError, TimeoutError, ValueError):
# Avoid printing the request URL: it contains the API key.
raise SystemExit("Could not retrieve or decode the latest response.")
data = payload.get("data") if isinstance(payload, dict) else None
if not isinstance(data, dict) or data.get("success") is not True:
raise SystemExit("The response did not contain successful data.")
rates = data.get("rates")
if not isinstance(rates, dict):
raise SystemExit("The response did not contain a rates object.")
mc250 = rates.get("MC250")
inverse = rates.get("USDMC250")
timestamp = data.get("timestamp")
date = data.get("date")
base = data.get("base")
if (
not isinstance(mc250, (int, Decimal))
or isinstance(mc250, bool)
or not isinstance(inverse, (int, Decimal))
or isinstance(inverse, bool)
or not isinstance(timestamp, int)
or isinstance(timestamp, bool)
or not isinstance(date, str)
or not isinstance(base, str)
):
raise SystemExit("A required quote field is missing or invalid.")
try:
observed_at = datetime.fromtimestamp(timestamp, tz=timezone.utc)
except (OverflowError, OSError, ValueError):
raise SystemExit("The response timestamp is outside the supported range.")
print("Base:", base)
print("Date:", date)
print("Timestamp (UTC):", observed_at.isoformat())
print("MC250:", mc250)
print("USDMC250:", inverse)
The script checks for the response shape it needs instead of silently substituting zero when a field is absent. Parsing decimal values as Decimal also avoids immediately converting the returned quote to a binary floating-point number.
A successful response is not necessarily a fresh market observation. Compare its timestamp with your application’s current time, and define a freshness threshold appropriate to your subscription and use case. If the response is too old, show the last observation with a stale-data indicator rather than presenting it as a new tick.
Build a dependable chart and alert
For a dashboard, separate retrieval from display. A server-side worker can fetch the latest response, validate it, and publish a cached observation to the UI. Store the raw response or the fields needed to reconstruct the quote, including its orientation and timestamp.
Latest data update frequency depends on the subscription: the described options include updates every 60 minutes or every 10 minutes. Check your current plan and the Indices-API Documentation before choosing a polling interval. Polling more often than the feed updates does not turn the result into additional market observations.
Use a cache lifetime that reflects the permitted update frequency and the tolerance of your application for stale data. When a refresh fails, retain the last successful observation with its timestamp and make its age visible. Avoid letting every browser or dashboard panel make an independent request with the same key.
For alerts, compare observations of the same field and base. A percentage change can be calculated as the new quote minus the earlier quote, divided by the earlier quote, multiplied by 100. Reject a missing or zero denominator, and avoid triggering repeatedly when the timestamp or value has not changed.
Decide whether an alert concerns MC250 or USDMC250 before setting its direction. Because the quotes are inverse, an increase in one corresponds to a decrease in the other; their percentage changes are not simply interchangeable. Record the quote field and the observation times with each alert so the decision can be reproduced.
Trading days also matter. Weekends, market holidays, and other non-trading periods can leave the latest available observation unchanged. Do not manufacture a new price for every calendar day or interpret a repeated cached value as proof of fresh trading activity.
Backfill and compare historical moves
The time-series endpoint is the relevant companion to latest data when you need a daily historical chart. Its response organizes rates by date, with symbols beneath each date. Read MC250 only when it is actually present for that date, and preserve the returned base with the series.
For a time-series request, end_date cannot be today. Use an earlier end date, then use the latest endpoint separately for the current snapshot. Check the documentation for request syntax, date-range restrictions, and the coverage available for MC250; do not assume that every calendar date has an observation.
Sort returned observations by date before drawing the series. If a date is absent, leave a gap or apply an explicitly documented display policy. Carrying forward the last value can be useful for some visualizations, but mark it as carried forward rather than presenting it as a recorded quote for that day.
For a comparison between two dates, the fluctuation endpoint returns rates with fields such as start_rate, end_rate, change, and change_pct. Confirm that the response contains MC250 and that its base and quote orientation match the series you are comparing. Use the returned dates and rates to explain an alert; do not infer a movement from a missing endpoint value.
The latest example above contains no pagination fields. If you build a broader ingestion process, consult the documentation for the behavior and limits of the endpoint you use rather than assuming that a latest response and a historical request have identical paging or range rules.
If your workflow also uses an agent or tool integration, the Indices-API MCP page provides a starting point. Keep the same symbol, base, orientation, and freshness checks regardless of how the observation reaches your application.
FAQ
Which field should I use for MC250?
The example contains both rates.MC250 and rates.USDMC250, which are inverse quote orientations. Select the one suited to your calculation and label it with its base and units. Verify the symbol specifications before calling either an official index-point value.
Is the latest response always a live trading price?
Not necessarily. Update frequency depends on the subscription, and the market may be closed. Display the returned timestamp and make stale data distinguishable from a fresh observation.
Can I use today as the end date for a time series?
No. Choose an earlier end_date for the historical request and retrieve the latest snapshot separately. Check the endpoint documentation for the allowed date range and MC250 coverage.
What should I do when MC250 is missing?
Treat the observation as unavailable rather than substituting another symbol or zero. Check the supported-symbol listing, response status, and documentation; keep the last valid cached observation only if your UI clearly marks its age.
Ready to test your integration? Get a free API key through the registration link above, run the curl request, and check the returned MC250 fields before connecting them to a chart or alert.