TOPIX (Japan) (TPX) Price Change API - intraday change endpoints and usage examples for 2026
To chart an intraday TOPIX move or alert when it crosses a threshold, you need more than a current quote: you need a consistent comparison point and a way to tell a new observation from a cached one. This guide shows how to retrieve the TPX quote, calculate a change between snapshots, and handle the timing and quote-direction details that affect the result.
Get the latest TOPIX quote
The latest endpoint returns a snapshot containing TPX in its rates object. It does not, by itself, give you a previous observation for an intraday comparison. Store successive snapshots if you want to calculate a move during the day.
First, get a key and substitute it for YOUR_API_KEY in this request:
curl 'https://indices-api.com/api/latest?access_key=YOUR_API_KEY'
The following response is a real example. Its values represent one observation, not a quote to use as a current market price:
{"data":{"success":true,"timestamp":1795653660,"date":"2026-11-26","base":"USD","rates":{"TPX":0.042479472532166,"USD":1,"USDTPX":23.540781944568337}}}
Read through the outer data object before accessing the fields:
successindicates whether the response reports a successful request. Check it before using the rates.rates.TPXandrates.USDTPXare the two TPX-related entries in this response. They are approximately reciprocals, so their percentage changes are not interchangeable.baseisUSD. The API describes its default rates as relative to USD; do not label either entry as the native TOPIX index-point level without confirming its meaning.dateis the date associated with the response. Preserve it with the observation, but confirm its timezone and session interpretation before using it as a trading-session boundary.timestampis a Unix timestamp. Convert it to UTC for storage and display, and use it to distinguish observations; do not assume it is an exchange trade time.
Confirm the current symbol and quote conventions on the Symbols page. In particular, agree on which returned rate your application tracks before storing history or setting alert thresholds.
Calculate a move from successive snapshots
The following Python example calls the same latest endpoint and tracks rates.USDTPX. It saves the last accepted observation locally and calculates a percentage change when a newer observation has the same response date and base. Set the environment variable INDICES_API_KEY before running it.
import json
import os
from datetime import datetime, timezone
from decimal import Decimal
from pathlib import Path
from urllib.parse import urlencode
from urllib.request import urlopen
key = os.environ["INDICES_API_KEY"]
url = "https://indices-api.com/api/latest?" + urlencode(
{"access_key": key}
)
with urlopen(url, timeout=10) as response:
payload = json.load(response, parse_float=Decimal)
data = payload["data"]
if not data.get("success"):
raise ValueError("API response did not report success")
rate = Decimal(str(data["rates"]["USDTPX"]))
if not rate.is_finite() or rate <= 0:
raise ValueError("USDTPX must be a positive finite rate")
current = {
"timestamp": data["timestamp"],
"date": data["date"],
"base": data["base"],
"rate": str(rate),
}
observed_at = datetime.fromtimestamp(
current["timestamp"], tz=timezone.utc
)
print("Observation time (UTC):", observed_at.isoformat())
print("Response date:", current["date"])
print("Base:", current["base"])
print("USDTPX:", rate)
state_file = Path("tpx_snapshot.json")
previous = None
if state_file.exists():
previous = json.loads(state_file.read_text())
if previous and current["timestamp"] <= previous["timestamp"]:
print("No newer timestamp; keeping the previous snapshot.")
else:
if (
previous
and current["date"] == previous["date"]
and current["base"] == previous["base"]
):
old_rate = Decimal(previous["rate"])
if old_rate.is_finite() and old_rate > 0:
change_pct = (rate / old_rate - 1) * 100
print("Change since previous snapshot (%):", change_pct)
else:
print("No comparable snapshot for this response date and base.")
state_file.write_text(json.dumps(current))
Run the script again after the provider has published a newer observation. On the first run there is no previous snapshot, so the script saves one without reporting a change. It also refuses to replace the saved snapshot with an observation whose timestamp is the same or older.
The calculation is (current rate / previous rate - 1) * 100. Both inputs must use the same rate key and base. A positive result means the selected USDTPX rate increased between the two accepted observations; it does not automatically establish the percentage change in the native index level.
The response date check is a conservative comparison rule, not a guarantee that both observations belong to the same Tokyo trading session. For a production chart, define the session boundary using the market calendar and the documented interpretation of the API’s date. For a production alert, also define whether the reference is the previous observation, the session’s first observation, or another explicitly selected baseline.
The local file makes the example easy to try, but it is not coordinated storage. A service with multiple workers should use shared storage and an atomic update so that concurrent requests do not overwrite a newer snapshot. Keep the API key out of source control and avoid logging complete request URLs, since the key is in the query string.
Choose the right comparison for an intraday chart
Successive latest snapshots are useful for a lightweight line or step chart and for alerts evaluated as new data arrives. Save the returned timestamp, response date, base, selected rate key, and value together. That record lets you reconstruct which observation triggered an alert and prevents a later change of quote direction from silently corrupting the series.
There are important limits to this approach. A series built from polling only contains observations your application successfully collected. If your process was offline, connecting the points on either side of the gap may make the chart look more complete than the data actually is. Mark gaps rather than treating them as evidence that the rate was unchanged.
For interval-based candles on a specific date, the intraday endpoint is the relevant alternative. Use the Documentation to check its request syntax, available intervals, response structure, and access for your subscription before building a candle chart. Do not treat a collection of latest snapshots as guaranteed open, high, low, and close data.
For a comparison between dates rather than observations within a day, the fluctuation endpoint returns fields such as start_rate, end_rate, change, and change_pct in its documented response format. Confirm the TPX request and returned quote convention in the documentation. Its end_date cannot be today, so use a completed eligible date range; it is not a substitute for a current intraday alert.
Keep quote direction and timing visible
The example response is USD-based and includes both TPX and USDTPX. Since those numbers are approximately reciprocal, a rise in one corresponds to a fall in the other. The percentage magnitudes are not exactly equal either: calculate the percentage from the actual pair of observations rather than reversing the sign of a percentage calculated from the other key.
Label a chart with the selected rate key and base instead of simply calling the value “TOPIX points.” If a product needs native index levels, verify the API’s field definitions and the effect of the USD base first. Likewise, a movement in a USD-relative quote should not be presented as a pure local-market index return without establishing what currency effects the quote contains.
Update frequency depends on the subscription. The latest endpoint can be updated at intervals including every 60 minutes or every 10 minutes, depending on the plan. Polling more often than the applicable update interval does not guarantee new data. Compare timestamps, and display the observation time so users can see the age of the value rather than assuming that every request returned a fresh market tick.
Cache the latest successful result for your application’s expected update cadence, while retaining its original timestamp and date. A cache refresh time is not the same thing as the provider’s observation time. If a request fails, a previously saved value may still be useful, but display it as stale rather than presenting it as a new observation.
TOPIX follows Japan’s market calendar, so weekends and exchange holidays matter. A successful response outside a trading session should not automatically be interpreted as a new trading-day move. Check the applicable market calendar and the returned timestamps; do not manufacture missing daily observations or assume a weekend value is a new close.
For integrations that also use the provider’s tooling, the MCP page provides a separate starting point. The snapshot and comparison rules above still need to be established for the data your application uses.
FAQ
Does the latest response contain an intraday percentage change?
The example contains rates and observation metadata, not an intraday change field. Calculate a change from two comparable snapshots, or check the intraday endpoint documentation for the data needed by your chart.
Which value should I use: TPX or USDTPX?
Choose the rate that matches your documented use case and use it consistently. The example uses USDTPX; the two entries are approximately reciprocal and should not be mixed in a single percentage calculation.
Can I use today as the fluctuation endpoint’s end_date?
No. Choose an eligible earlier end date for a date-range fluctuation, and use current snapshots or documented intraday data for a current-session view.
Why did a new request not produce a new alert?
The returned timestamp may be unchanged, the market may be closed, or the data may not yet have updated under your subscription. Check the observation timestamp and your plan’s update frequency before treating a repeated rate as a new event.
Ready to start collecting TPX observations? Use Register to get a free Indices-API key, then run the latest request and verify the quote convention before connecting it to your chart or alert.