Docs menuexpand_more
travel_exploreTry in the API Viewer

Guides

Reference

Other pages

Endpoints

search
appsAll APIs
functionHow metrics are calculated

Cookbook · Applied · Hands-on 8

Keep your API key out of the browser: a local proxy for financial data, and how to verify live data

Keep the API key out of browser JavaScript with a small local Python proxy that blocks other sites and hides upstream errors, plus four checks after switching to live data.
For developersFor investors8 min read
open_in_newIllustrated series on Qiita (Japanese)The same topic is also published as an illustrated series on Qiita.

Endpoints used

When a browser-based dashboard calls an API, the thing to avoid above all is leaking the API key. Any key in JavaScript can be read by anyone who opens the page. This page shows how to keep the key out of the browser: a small Python server on your own machine holds it and calls ZENITH Code on the page's behalf.

  • Take the key from an environment variable or a hidden prompt. Never put it in code, URLs, or command-line arguments.
  • The browser only talks to the local proxy; the proxy adds the key and calls the API.
  • After switching to live data, check four things before trusting it: a known value, units, missing values, and sources.

The example fetches Toyota Motor (7203) annual figures from the income statement endpoint. The stock quote endpoint (/stable/quote) comes last, and only for display in your own private environment.

We at Crabgrass Inc. build ZENITH Code, an API for financial and disclosure data on Japanese companies. This article is an implementation guide for using our own data.

Why the key can't live in the browser

Everything that runs in the browser is delivered to the user. A key written in JavaScript can be read in any of these ways:

  • The Network tab in developer tools shows the request headers.
  • The page source and loaded JavaScript files are open to inspection.
  • localStorage and cookies can be read directly.

Watch your build tooling too. Environment variables prefixed with NEXT_PUBLIC_ in Next.js or VITE_ in Vite are inlined into browser bundles at build time. "It's in an environment variable" doesn't make it secret.

A leaked key lets someone else spend your quota. ZENITH Code accepts keys in the x-api-key header and does not accept ?apikey= in the URL, because URLs tend to end up in access logs and Referer headers.

How to pass the key

Use one of these two:

Method Example Good for
Environment variable ZENITH_API_KEY Automation, or injecting from a password manager
Hidden prompt Python's getpass Trying things locally

Don't pass it as a command-line argument (--key xxxx); it stays in shell history and process listings. If you use a .env file, add it to .gitignore so it never reaches Git.

import getpass
import json
import os
import re
import secrets
import sys
import threading
import urllib.error
import urllib.parse
import urllib.request
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer

BASE_URL = "https://api.zenithcode.net/stable"
PORT = 8780
ANNUAL_LIMIT = 5
SYMBOL_RE = re.compile(r"^[0-9A-Z]{4,5}$")


def load_api_key() -> str:
    """Read the key from the environment or a hidden prompt, never from argv."""
    key = os.environ.get("ZENITH_API_KEY", "").strip()
    if not key and sys.stdin.isatty():
        key = getpass.getpass("ZENITH API key (hidden): ").strip()
    if not key:
        sys.exit("Set ZENITH_API_KEY or start from a terminal.")
    return key


def call_zenith(api_key: str, path: str, params: dict):
    """Call ZENITH Code. The key is attached to the header here and nowhere else."""
    url = f"{BASE_URL}{path}?{urllib.parse.urlencode(params)}"
    request = urllib.request.Request(url, headers={"x-api-key": api_key, "Accept": "application/json"})
    with urllib.request.urlopen(request, timeout=30) as response:
        return json.load(response)

The dashboard shows a new key only once, when you create it. Save it somewhere safe right then. If you think it leaked, revoke it in the dashboard and create a new one.

Build the local proxy

Put a small server that runs only on your machine between the browser and ZENITH Code.

Leg Destination API key
Browser → proxy http://127.0.0.1:8780/api/annual Not included
Proxy → ZENITH Code https://api.zenithcode.net/stable/income-statement Added by Python

Don't let the proxy become an open relay. Accept one specific request, and have the server decide every parameter except the ticker. The response check, validate_annual, is in the next section.

UPSTREAM_ERRORS = {401: "key_rejected", 403: "key_forbidden", 429: "rate_or_quota"}


def make_handler(api_key: str, local_token: str):
    gate = threading.Lock()
    origin = f"http://127.0.0.1:{PORT}"

    class Handler(BaseHTTPRequestHandler):
        def log_message(self, *_):
            pass  # don't print URLs or headers to the terminal

        def reply(self, status: int, body: dict):
            data = json.dumps(body, ensure_ascii=False).encode()
            self.send_response(status)
            self.send_header("Content-Type", "application/json; charset=utf-8")
            self.send_header("Cache-Control", "no-store")
            self.send_header("Content-Length", str(len(data)))
            self.end_headers()
            self.wfile.write(data)

        def do_GET(self):
            if self.headers.get("Host") != f"127.0.0.1:{PORT}":
                return self.reply(403, {"error": "local_only"})
            if self.path == "/config.json":
                return self.reply(200, {"token": local_token})
            if self.path == "/":
                page = open(os.path.join(os.path.dirname(__file__), "index.html"), "rb").read()
                self.send_response(200)
                self.send_header("Content-Type", "text/html; charset=utf-8")
                self.send_header("Content-Security-Policy", "default-src 'self'; connect-src 'self'; frame-ancestors 'none'")
                self.send_header("Referrer-Policy", "no-referrer")
                self.end_headers()
                return self.wfile.write(page)
            return self.reply(404, {"error": "not_found"})

        def do_POST(self):
            if (self.headers.get("Host") != f"127.0.0.1:{PORT}"
                    or self.headers.get("Origin") != origin
                    or not secrets.compare_digest(self.headers.get("X-Local-Token", ""), local_token)):
                return self.reply(403, {"error": "local_only"})
            if self.path != "/api/annual":
                return self.reply(404, {"error": "not_found"})
            try:
                length = min(int(self.headers.get("Content-Length", "0")), 1024)
                symbol = str(json.loads(self.rfile.read(length) or b"{}").get("symbol", "")).strip().upper()
            except (ValueError, AttributeError):
                return self.reply(400, {"error": "bad_request"})
            if not SYMBOL_RE.fullmatch(symbol):
                return self.reply(400, {"error": "bad_symbol"})
            if not gate.acquire(blocking=False):
                return self.reply(429, {"error": "busy"})
            try:
                rows = call_zenith(api_key, "/income-statement",
                                   {"symbol": symbol, "period": "annual", "limit": ANNUAL_LIMIT})
                rows = validate_annual(rows, symbol, ANNUAL_LIMIT)
                self.reply(200, {"symbol": symbol, "rows": rows})
            except urllib.error.HTTPError as e:
                # Never relay the upstream body. Map the status to a fixed code.
                self.reply(502, {"error": UPSTREAM_ERRORS.get(e.code, "upstream_failed"), "status": e.code})
            except (urllib.error.URLError, TimeoutError):
                self.reply(502, {"error": "network"})
            except ValueError:
                self.reply(502, {"error": "invalid_response"})
            finally:
                gate.release()

    return Handler


if __name__ == "__main__":
    key = load_api_key()
    token = secrets.token_urlsafe(32)  # regenerated on every start; not the API key
    server = ThreadingHTTPServer(("127.0.0.1", PORT), make_handler(key, token))
    print(f"Open http://127.0.0.1:{PORT}", flush=True)
    server.serve_forever()

Keep other pages from using it

The proxy sits there holding your key. If another site open in your browser could call it in the background, that would be as bad as handing over the key. So every data request is checked three ways:

Check What it stops
Host is 127.0.0.1:8780 Requests reaching the server under another hostname (DNS rebinding)
Origin is your own page Other open sites calling the proxy behind your back
X-Local-Token matches the startup token Callers that never loaded your page

The token is regenerated with secrets.token_urlsafe(32) on every start. Your page fetches it from /config.json first. Pages on other sites can't read that response because of the browser's same-origin policy. The token isn't the API key, so it's fine for the page to know it.

The proxy also:

  • Listens on 127.0.0.1 only, so other devices on your Wi-Fi can't connect. Don't change it to 0.0.0.0.
  • Runs one request at a time, so repeated clicks don't drain your quota.
  • Validates the ticker format and fixes period and limit on the server, so the page can't pass arbitrary parameters.
  • Prints no access log, and sends Cache-Control: no-store so the browser doesn't keep responses.
  • Sends a Content-Security-Policy that blocks scripts from anywhere else.

Don't relay error bodies

If an API call fails, the proxy doesn't pass the upstream body to the page. It returns a fixed code based on the status, on the assumption that error bodies could contain internal details.

Proxy error Status Typical cause
key_rejected 401 Missing or wrong key
key_forbidden 403 Revoked key, too many keys for the plan, and similar
rate_or_quota 429 Rate limit or quota reached
network — Connection failure or timeout
invalid_response — The response failed the shape check

Don't retry automatically after an error. If the key or quota is the problem, retries return the same result and only burn quota.

Validate the response before the page sees it

Check the shape of the data before showing it. A plausible chart built from another company's rows, or from non-annual rows, is harder to notice than an error.

def validate_annual(rows, symbol: str, limit: int) -> list:
    """Check the response shape before display. Raise ValueError on mismatch."""
    if not isinstance(rows, list) or len(rows) > limit:
        raise ValueError("row_count")
    seen = set()
    for row in rows:
        if not isinstance(row, dict) or row.get("symbol") != symbol:
            raise ValueError("symbol_mismatch")
        if row.get("period") != "FY":
            raise ValueError("not_annual")
        period = row.get("fiscalPeriod")
        if not isinstance(period, str) or not re.fullmatch(r"\d{4}-\d{2}", period) or period in seen:
            raise ValueError("fiscal_period")
        seen.add(period)
        for field in ("revenue", "operatingIncome", "netIncome", "operatingMargin"):
            value = row.get(field)
            if value is not None and (isinstance(value, bool) or not isinstance(value, (int, float))):
                raise ValueError("field_type")
    return rows
  • Stop if there are more rows than limit. That catches a wrong parameter returning far more periods than expected.
  • An empty array isn't an error. Companies with no reported fiscal years (just after listing, for example) return []. Show "no financial data" instead.
  • null amounts are allowed. Pass missing values through as missing; never turn them into 0.

Put the code in one file (for example local_proxy.py) in this order: load_api_key and call_zenith, then validate_annual, then make_handler and the startup block. Place your page's index.html in the same folder and run python3 local_proxy.py.

Browser-side code

The page's JavaScript only calls the proxy. Neither the ZENITH Code URL nor the key appears anywhere.

const MESSAGES = {
  bad_symbol: "Check the ticker (4 to 5 letters or digits).",
  busy: "Another request is in progress.",
  key_rejected: "Check your API key.",
  key_forbidden: "Check your key's status (revoked, or over the key limit).",
  rate_or_quota: "Request limit reached. Try again later.",
  network: "Check your connection.",
  invalid_response: "Unexpected data format. Display stopped.",
  local_only: "Reload the page.",
};

const { token } = await (await fetch("/config.json")).json();

export async function loadAnnual(symbol) {
  const res = await fetch("/api/annual", {
    method: "POST",
    headers: { "Content-Type": "application/json", "X-Local-Token": token },
    body: JSON.stringify({ symbol }),
  });
  const body = await res.json();
  if (!res.ok) return { error: MESSAGES[body.error] ?? "Couldn't fetch the data." };
  if (body.rows.length === 0) return { error: "No annual financial data for this ticker." };
  return { rows: body.rows };
}

Restarting the proxy changes the token, so an old tab gets local_only. Reload the page.

Four checks after switching to live data

A dashboard built on sample data has the same shape as live data but not the same behavior. Once numbers appear, check these four things before you rely on them.

1. Does a known value match?

Pick one period with a published value and compare. For Toyota's fiscal year ended March 2025, the production API returned these values on October 27, 2026 at 16:50 JST:

Field Value
revenue 48036704000000 (¥48.04 trillion)
operatingIncome 4795586000000 (¥4.80 trillion)
operatingMargin 0.0998 in the API, 9.98% on screen
accountingStandard ifrs
provenance.docId S100VWVY
def smoke_check(rows: list) -> list:
    """Compare one known period. Return a list of differences."""
    expected = {"revenue": 48036704000000, "operatingIncome": 4795586000000}
    row = next((r for r in rows if r["fiscalPeriod"] == "2025-03"), None)
    if row is None:
        return ["no 2025-03 row (is limit too small?)"]
    problems = [f"{k}: {row.get(k)} != {v}" for k, v in expected.items() if row.get(k) != v]
    doc = (row.get("provenance") or {}).get("docId")
    if problems and doc != "S100VWVY":
        problems.append(f"filing ID changed to {doc} (possible correction or replacement)")
    return problems

A mismatch isn't automatically a bug. Values can be updated, for example by a correction. Check whether the filing ID changed first.

2. Are the units right?

API amounts are in yen; ratios are decimals from 0 to 1. If the screen shows "48,036,704," you're displaying millions; if it shows "0.10%," you forgot to multiply the ratio by 100. Sample data built in millions or percentages will disagree here.

3. Did missing values become 0?

Live data contains null: ordinary income for IFRS companies, or items with no line on the statement. If you see 0 or 0%, something converted null to 0.

4. Are sources and timestamps shown?

Confirm each period shows its filing ID and disclosure time. Timestamps come back in UTC; convert to Japan time before display. See Track the source of every financial figure.

How many calls

limit is the number of periods in one response, not the number of calls. Five years is still one call. Our docs list both the income statement and quote endpoints at one token per call, available on the Free plan. Check the pricing page for current quota terms.

Show stock prices only in your private environment

Adding the quote endpoint (/stable/quote) to the proxy lets you show the latest close (price) and its date (priceDate). Only do this in your own private environment.

  • Stock prices, price changes, and market capitalization are exchange data. They can't be shown or redistributed to third parties on any plan. Even inside a company, only the registered member can view them.
  • Before you put a screenshot in an article, on social media, or in a shared internal deck, make sure no stock price is visible.
  • Keep the proxy on 127.0.0.1 so no one else can connect.

Gate the quote behind an explicit "private display" switch so it never slips into a public page by accident:

SHOW_QUOTE = os.environ.get("ZENITH_PRIVATE_QUOTE") == "1"  # set to 1 only on your own machine

# inside do_POST, in place of self.reply(200, {...})
body = {"symbol": symbol, "rows": rows}
if SHOW_QUOTE:
    quote = call_zenith(api_key, "/quote", {"symbol": symbol})
    latest = quote[0] if quote else None
    body["privateQuote"] = {"price": latest["price"], "priceDate": latest["priceDate"]} if latest else None
self.reply(200, body)

On screen, label the price area "shown in a private environment only."

The price date and the fiscal period are different points in time. priceDate is the latest trading day; fiscalPeriod is the month the fiscal period ended. If you combine a current price with past results to compute your own metrics, keep the timing gap in mind. Check the display rules before showing any price-derived value on a public page.

See What you can and can't display for the full rules.

Read the numbers carefully

  • Amounts are in yen; ratios are decimals from 0 to 1. Operating margin is 0.0998 in the API and 9.98% on screen.
  • An empty array means no reported results. Newly listed companies may have no annual rows yet, and pre-listing income statements may not be available.
  • Values can change later. Corrections, or replacing earnings-summary figures with securities-report figures, update the same period. When you compare with a known value, compare the filing ID too.
  • Non-yen periods have null amounts. US dollar reporters (6269 and 9399) return nullReason of non_jpy_material.
  • Timestamps are UTC. Convert announcedAt and updatedAt to Japan time before display.
  • Price dates and fiscal periods differ. Don't line up today's price and a fiscal year that ended months ago as if they were the same moment.

Summary

  • Keep the API key out of the browser; only the local proxy holds it, read from an environment variable or a hidden prompt.
  • Bind the proxy to 127.0.0.1, check Host, Origin, and a startup token, and accept only the specific request you need.
  • Don't relay upstream error bodies, and validate the response shape before display.
  • After switching to live data, check a known value, units, missing values, and sources. Show stock prices only in your private environment.

Related

A Japanese-language walkthrough with screenshots is on Qiita.

Before you read the numbers

Points about the endpoints in this article that are easy to misread as wrong data.

  • By designTDnet-derived information is returned 24 hours after disclosure

    Under Article 7(1) of the JPX TDnet API service terms, information derived from TDnet (timely disclosures) is returned by the API and MCP 24 hours after the disclosure time (from 2026-11-13). Within 24 hours, rows of timely disclosures, dividends, dividend changes, splits, delisting schedules, earnings-release periods and earnings forecasts are left out, and TDnet PDFs (filing-document) return 403 tdnet_embargo with the time they become available (availableAt). Latest values (quote, key-metrics-latest, screener and so on) have no previous value to fall back to, so for stocks with a TDnet document in the last 24 hours the fields computed from documents (PER, PBR, dividend yield, market cap and so on) are null; prices and price changes are unaffected. The response headers X-TDnet-Embargoed-Count, X-TDnet-Embargoed-Symbols and X-TDnet-Embargo-Next-Release tell what was held back and when it becomes available. The boundary is disclosure time + 24 hours <= response time, compared in absolute time rather than Japan time. For shareholder benefits and dividend policies, versions sourced from TDnet are held back for 24 hours and the previous version is returned when there is one (versions from EDINET or company IR pages are not affected). Rows whose TDnet disclosure time is unknown are not returned. Calls whose whole content is held back (a list that is empty only because of this rule, or a single stock whose affected latest fields are all null) do not use tokens; calls where only part is held back do. EDINET filings (annual, extraordinary and large-holding reports) and stock prices are not affected.

    Endpoints:/disclosures/events-feed/filing-document/dividend-changes/dividends/dividends-calendar/dividends-bulk/dividend-streaks/splits/delisting-schedule/income-statement/balance-sheet-statement/cash-flow-statement/key-metrics/income-statement-short/balance-sheet-statement-short/cash-flow-statement-short/key-metrics-short/key-metrics-bulk/financial-statement-full/earnings-forecast/sga-breakdown/valuation-history/market-cap-history/quote/key-metrics-latest/batch-quote/batch-key-metrics-latest/market-capitalization/profile/screener/rankings/peers/screener-presets/industry-benchmarks/shareholder-benefits/shareholder-benefits-list/dividend-policy/dividend-policies

  • By designMetrics are refreshed on weekday evenings

    Prices and metrics are swapped in by a daily run that starts around 18:30 JST on weekdays, and metrics are swapped shortly before 19:00 (the finish time varies by day). If your requests straddle that window, bulk endpoints and per-symbol endpoints, or two different endpoints, can show different values. Fetching again at the same time brings them in line, so record when you fetched the data when you compare.

    Endpoints:/key-metrics-latest/key-metrics/valuation-history/quote/profile/key-metrics-bulk/batch-key-metrics-latest/batch-quote/quote-short-bulk/eod-bulk/dividends-bulk/dividend-streaks

  • By designTOKYO PRO Market companies have no financials

    TOKYO PRO Market (the market for professional investors) companies file no XBRL results, so their financials are not ingested; statements and the metrics and market capitalization calculated from financials or share counts are empty or null. Describe them as "financials not covered", not as missing data. Market-wide aggregates (rankings, market-breadth and so on) also exclude this market by default.

    Endpoints:/income-statement/balance-sheet-statement/cash-flow-statement/income-statement-short/balance-sheet-statement-short/cash-flow-statement-short/financial-statement-full/key-metrics/key-metrics-short/key-metrics-latest/market-capitalization/market-cap-history/valuation-history/profile

  • By designMarket cap is empty for all dates when no share count is disclosed

    Market capitalization needs a share count, so it is empty for every date for companies without such disclosure (TOKYO PRO Market, foreign companies, the Bank of Japan and similar). Preferred and class shares are also empty by design. market-cap-history, profile and key-metrics-latest are empty in the same way, so the endpoints do not contradict each other.

    Endpoints:/market-capitalization/market-cap-history/quote/profile/key-metrics-latest

  • By designMarket cap of new listings uses pre-listing share counts

    For newly listed companies, market capitalization is calculated from shares outstanding at the last period end before listing and excludes shares issued in the IPO. It is therefore understated until the share count is replaced with the first results after listing. When you publish it, note that it is based on the pre-listing share count.

    Endpoints:/market-capitalization/quote/batch-quote/key-metrics-latest/market-cap-history/profile

  • By designRight after listing, prior-year income and ratios can be empty

    The first earnings release after listing does not include full-year income for the prior year, so for newly listed companies the pre-listing income statement is empty and the prior-year row has only total assets and net assets. Before the first results, market cap and PER/PBR history are empty too. Describe it as "income before listing not covered".

    Endpoints:/income-statement/income-statement-short/valuation-history/market-cap-history/key-metrics-short

  • By designQuarterly income figures are year to date

    Q2 and Q3 income and cash-flow figures are cumulative from the start of the fiscal year. Listing them as single-quarter revenue makes Q3 look large. Subtract the previous quarter's cumulative value to get a single quarter, and use key-metrics for trailing-twelve-month (TTM) values.

    Endpoints:/income-statement/cash-flow-statement/income-statement-short/cash-flow-statement-short/key-metrics

  • By designPeriods before and after a switch from consolidated to standalone do not connect

    Each statement period carries a consolidation flag (consolidated or nonconsolidated). For companies that moved from consolidated to standalone reporting, or that became a different business through a share exchange, the reporting scope changes at that point, so prior-period-end values and growth rates do not connect across it. Align consolidation before comparing across periods.

    Endpoints:/income-statement/balance-sheet-statement/cash-flow-statement/income-statement-short/balance-sheet-statement-short/cash-flow-statement-short/financial-statement-full

  • By designJPY amounts and missing-field reasons in foreign-currency statements

    reportedCurrency identifies the statement currency. Available JPY amounts are returned. nullReasons identifies missing fields, including non_jpy_material for unavailable JPY amounts and source_missing:operating_income when the statement lacks operating income used for the margin. Foreign-currency rows without any JPY amount retain nullReason = non_jpy_material.

    Endpoints:/income-statement/balance-sheet-statement/cash-flow-statement

  • By designGross profit scope differs for companies with other operating revenue

    For companies that report operating revenue (such as retailers), revenue = net sales (netSales) + other operating revenue (otherOperatingRevenue), and whether grossProfit includes the latter depends on the company (grossProfitIncludesOtherOperatingRevenue). Use operatingGrossProfit (or grossProfit when it is null) to compare companies. Adding other operating revenue to grossProfit before subtracting SG&A can count it twice.

    Endpoints:/income-statement/income-statement-short/financial-statement-full

  • By designFor annual reports with both Japanese GAAP and IFRS statements, financial-facts and the statements can look different

    For companies whose annual report includes both Japanese GAAP and IFRS statements (2130, 436A, 4494, 6532 and others), the summary of business results in financial-facts comes from the Japanese GAAP tables, while balance-sheet-statement and the other statement endpoints use the IFRS tables the company has adopted, so totals such as total assets can look different. Both are as filed. accountingStandard in financial-facts is the standard declared for the whole document, so rows with Japanese GAAP tags also show IFRS. Check which table a value comes from by its tag name, not by accountingStandard. A trailing _notes in a tag name is added when ZENITH ingests the data and is not part of the original tag.

    Endpoints:/financial-facts/balance-sheet-statement/income-statement/cash-flow-statement

  • By designChange periods start on the same date n months earlier (or the previous trading day)

    changePct3m in returns starts from the close on the same date three months earlier (or the previous trading day if that date is a holiday). changePct1w, 1m and 6m are counted the same way, not by a number of trading days (such as 63 trading days back). Values computed from a trading-day count will differ slightly.

    Endpoints:/returns/quote/batch-quote/screener

  • Easy to misreadMarket cap does not equal a close times the share count in a filing

    The share count behind market cap reflects not only the count in earnings releases but also changes in treasury shares, such as buybacks and cancellations, so it can change from day to day. Prices are split-adjusted as well. Multiplying a day's close by the share count in a filing therefore does not reproduce market cap, and a mismatch is not a data error.

    Endpoints:/market-capitalization/market-cap-history/quote/key-metrics

  • Easy to misreadOperating income is not always gross profit minus SG&A

    Under Japanese GAAP, operating income = (operatingGrossProfit ?? grossProfit) − SG&A − (otherOperatingExpenses ?? 0). For companies with other operating revenue or with operating-expense lines besides SG&A, computing only grossProfit − SG&A does not match and looks like an error. Use this formula when you check the numbers.

    Endpoints:/income-statement/income-statement-short/financial-statement-full

  • Easy to misreadBulk vs per-symbol differences are usually about fetch time

    If you fetch bulk and per-symbol endpoints at different times, values can change across the daily update or new results and appear to disagree (for example PBR and market cap of new listings, or dividend streak years). When you compare, fetch both again at the same time.

    Endpoints:/key-metrics-bulk/dividends-bulk/eod-bulk/quote-short-bulk/batch-quote/batch-quote-short/batch-key-metrics-latest/key-metrics-latest/quote

  • Easy to misreadEPS can be negative even with positive net income

    Companies that deduct dividends on class shares when computing common-share EPS can show negative EPS even with positive net income, as in their earnings releases (7412 and 8836). A sign difference between net income and EPS is not an error by itself.

    Endpoints:/income-statement/key-metrics

  • Easy to misreadactualEps and estimateEps in earnings-calendar are for the quarter alone, not year to date or full year

    actualEps (reported) and estimateEps (estimate) in earnings-calendar are both earnings per share (yen) for that quarter alone (three months). Rows whose fiscalPeriod is FY also cover only the fourth quarter, not the full year. estimateEps is the market consensus, not the company forecast. Quarterly EPS in income-statement is cumulative from the start of the fiscal year, so the values differ (for 6230 in Q2, actualEps is 21.16 and the year-to-date figure is 38.27). Use the same basis, single quarter or year to date and full year, when you compare. Values are null for rows before the announcement, for reported rows whose results are not in yet, and for issues or periods without an estimate.

    Endpoints:/earnings-calendar/income-statement/income-statement-short

  • FixedMarket cap is now rounded to the yen

    Some issues had fractions of a yen in market cap (calculated from closes in 0.1-yen ticks or split-adjusted closes). quote, market-capitalization and related endpoints were rounded to the yen in version 81, and per-period values in key-metrics by a data-platform fix, so the latest value no longer differs from market-cap-history by half a yen. Fractions in older responses are not errors and do not matter once rounded to yen or hundreds of millions of yen.

    Fixed in: version 81 (2026-11-03); data platform #3183 (2026-11-03)Endpoints:/quote/market-capitalization/batch-quote/profile/screener/rankings/key-metrics/key-metrics-bulk

  • FixedShare counts added for companies whose releases are PDF only

    For companies whose earnings releases are PDF only and for some new listings (17 issues including 9334), share counts, market cap and BPS were empty. On Nov 3 share counts began to be read from PDF releases as well, which filled them, and 9334's split adjustment was corrected. Values that were empty before then are present if you fetch again.

    Fixed in: data platform #3178 and #3185 (2026-11-03)Endpoints:/market-capitalization/quote/market-cap-history/key-metrics/key-metrics-latest

  • FixedStandalone income for periods with a first subsidiary at year end is back

    When a company acquired its first subsidiary at year end, the annual report had a consolidated balance sheet only and standalone income and cash-flow statements only, and those periods were missing entirely from the annual income and cash-flow data (12 periods, including 5572, 9262, 7370 and 3370). Those periods now return income and cash flow flagged consolidation: nonconsolidated, while the same period's balance sheet is consolidated. Mind the flag when comparing with adjacent periods.

    Fixed in: version 79 and data platform #3177 (2026-11-03)Endpoints:/income-statement/cash-flow-statement/income-statement-short/cash-flow-statement-short

  • FixedPeriods with no values are no longer returned

    Previously, rows for periods with every value null and no source could be returned (some cash-flow periods for 648A and 624A, for example). Since version 48, periods with no values are not returned (except non-yen periods, which come with nullReason). An all-null row in an older response does not mean results existed for that period.

    Fixed in: version 48 (2026-11-02)Endpoints:/income-statement/balance-sheet-statement/cash-flow-statement/income-statement-short/balance-sheet-statement-short/cash-flow-statement-short/financial-statement-full

visibility_off
The screens and numbers in these articles leave out stock prices and metrics calculated from them. Before showing live data on your own screens, check what you may display. What you can display
gavel

Disclaimer

This page explains how to use a Japanese equity data API and how its data is defined. It is not a solicitation to invest or a recommendation to buy or sell any security. The content reflects information at the time of writing and is not guaranteed to be accurate or complete. Investment decisions are your own responsibility.

What you may show or provide to third parties depends on your plan and Article 8 of the Terms. Exchange data such as stock prices may not be shown to third parties on any plan. Edited or processed information from which the original stock prices or similar market data can be readily reconstructed is treated as exchange data and may not be displayed or redistributed to third parties. No plan or separate agreement with us overrides this restriction. Terms, Article 8 · Data sources and terms of use