Philippine Stock Exchange PSEi (PSEI) Convert API
You need to quote, convert, and chart the Philippine Stock Exchange PSEi (PSEI) in your app. By the end of this guide, you’ll pull the latest PSEI rate, convert USD amounts into “index units” and back, and set up a daily series you can chart or alert on—all using Indices-API.
What you’re building: a PSEI quote and converter you can ship today
This walkthrough focuses on two jobs:
- Get the latest PSEI rate in a way that’s consistent across your stack, including how to interpret base, date, and units.
- Convert between USD and PSEI “index units” reliably, then extend it to a time series suitable for charts and daily alerts.
We’ll use the latest and time-series endpoints. If you also need OHLC or intraday candles later, see the Documentation. Confirm the exact symbol on the Symbols page before coding to production.
How PSEI quotes are expressed in Indices-API
Indices-API standardizes index pricing with a base currency and a per-index “rate.” The key details you’ll use:
- Base currency: USD (field: base).
- Rates: values are relative to USD and expressed “per index” (field: unit is per index).
- For PSEI, you’ll commonly reference rates.PSEI and/or rates.USDPSEI to compute conversions in either direction.
- Timestamps are Unix seconds (field: timestamp) and dates are ISO yyyy-mm-dd (field: date).
If you serve global users, cache results and annotate them with the server timestamp so your UI communicates freshness accurately. Update frequency depends on plan (e.g., every 60 minutes or 10 minutes). Don’t assume intraday precision outside your plan’s cadence; read the Documentation for exact update intervals.
Get the latest PSEI quote
The latest endpoint returns a normalized payload you can use for quotes and conversions. You must authenticate with access_key passed as a query parameter.
curl: latest PSEI
curl -s "https://indices-api.com/api/latest?access_key=YOUR_API_KEY&symbols=PSEI,USD,USDPSEI"
Official response (use these exact values in your tests to match this article):
{"data":{"success":true,"timestamp":1791938580,"date":"2026-10-14","base":"USD","rates":{"PSEI":0.011006353897368,"USD":1,"USDPSEI":90.85660967517451}}}
Fields you will actually use:
- success: boolean indicating a valid response.
- timestamp: 1791938580 (Unix seconds). Use this to label cache freshness and data time.
- date: 2026-10-14 (ISO date). For end-user display and time-bucketing.
- base: USD. All rates are expressed relative to USD.
- rates.PSEI: 0.011006353897368. This is “USD per one PSEI index unit.”
- rates.USDPSEI: 90.85660967517451. This is “PSEI index units per one USD.”
- rates.USD: 1. Useful as a programmatic anchor when you want to normalize maps.
Interpreting these two directions:
- USD per index (rates.PSEI): multiply PSEI units by this to get USD value.
- Index units per USD (rates.USDPSEI): multiply USD by this to get PSEI units.
JavaScript example: compute USD⇄PSEI conversions
async function fetchPSEI() {
const url = "https://indices-api.com/api/latest?access_key=YOUR_API_KEY&symbols=PSEI,USD,USDPSEI";
const res = await fetch(url);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const json = await res.json();
// Navigate to the standardized fields
const data = json.data;
if (!data?.success) throw new Error("API call unsuccessful");
const { timestamp, date, base } = data;
const { PSEI, USDPSEI } = data.rates;
// Conversions
const usdToPsei = (usd) => usd * USDPSEI;
const pseiToUsd = (pseiUnits) => pseiUnits * PSEI;
// Example: price label and conversions
console.log({
fetchedAt: new Date(timestamp * 1000).toISOString(),
date,
base,
usdPerPSEI: PSEI,
pseiPerUSD: USDPSEI,
sampleConversions: {
"100_USD_to_PSEI_units": usdToPsei(100),
"10_PSEI_units_to_USD": pseiToUsd(10)
}
});
return { timestamp, date, base, PSEI, USDPSEI, usdToPsei, pseiToUsd };
}
fetchPSEI().catch(console.error);
In dashboards, surface date and timestamp so users see data age. If you cache this response, store the timestamp and set a cache TTL that aligns with your plan’s update frequency.
Convert for PSEI: getting from an amount to “index units” and back
You can implement PSEI conversion directly from the latest payload:
- USD to PSEI units = amountUSD × rates.USDPSEI
- PSEI units to USD = amountPSEI × rates.PSEI
Because the base is USD, these two rates are reciprocals. Use whichever is available in the payload to avoid floating-point drift. For financial UI, format results to a fixed precision that matches your product’s conventions (e.g., 2–4 decimals for USD figures; display PSEI units to a practical number of decimals).
If you prefer to offload conversions to the API as your integration grows, refer to the Convert endpoint in the Documentation. For PSEI, confirm the exact symbol on the Symbols page.
Build a daily PSEI time series for charts and alerts
For historical backfills and charts, use the time-series endpoint. The payload schema mirrors latest—same base, date-keyed rates map—so it’s easy to reuse parsing code. Note that end_date cannot be today; set it to the most recent completed calendar day. Markets close on local trading days; weekends and holidays will not print new values.
Typical workflow:
- Pick a start_date and end_date in ISO format (yyyy-mm-dd). Ensure end_date <= today-1.
- Request PSEI only (or a small set) to keep payloads lean.
- Fill missing non-trading days in your chart client with gaps or forward-fill, depending on UX requirements.
- Use the date keys for x-axis and rates.PSEI as your y values.
When deploying alerts, run a daily job after the exchange’s local close plus a buffer. Cache bust with If-Modified-Since style logic on your side: compare your last stored timestamp to the new timestamp and write only on change.
Trading days, timing, and caching details that matter
- Update cadence: The latest endpoint refreshes based on your plan interval. Check the Documentation and cache with a TTL that matches (e.g., 10–60 minutes).
- End-of-day logic: Do not set end_date to today. Use yesterday or the last trading day you know has closed.
- Weekends/holidays: Expect no new bars on non-trading days. Your chart should render gaps or flat lines only if you explicitly forward-fill; default should be gaps.
- Timestamps and timezones: timestamp is Unix seconds; interpret it as UTC in your systems. Date strings are ISO and do not carry timezone.
- Error handling: Always check success before using rates. If you serve multiple symbols, guard against missing keys and fall back to the Symbols directory when onboarding new indices.
About converting PSEI values alongside currency reporting (including ANG)
Because all index rates are relative to USD, you can integrate currency display logic cleanly on top of your PSEI stack. For example, if your frontend supports Netherlands Antillean Gulden (ANG), compute USD amounts first from PSEI units using rates.PSEI, then apply your USD→ANG FX mapping in your pricing layer. Keep the concerns separate: indices in one service, FX in another, joined by USD as the bridge. This improves auditability and reduces latent discrepancies.
When displaying multi-currency results:
- Store raw USD figures and the source timestamp for PSEI.
- Apply your USD→ANG conversion at render time with its own timestamp.
- Label both timestamps so end users understand data freshness from each source.
This “USD as hub” approach scales to additional currencies without rewriting your index ingestion. If you expand your product’s coverage, confirm each new index code on the Symbols page.
Production notes: reliability and UX
- Caching: Cache latest calls server-side and propagate to clients. Include the source timestamp in your cache key or metadata so you can quickly test staleness.
- Precision: For money, use decimal-capable types server-side. Round only on the presentation layer, not at storage boundaries.
- Unit consistency: Keep a single source of truth for unit semantics. In this integration: base is USD, unit is per index, PSEI is USD per one PSEI unit, USDPSEI is index units per USD.
- Backfills: When backfilling large windows, paginate dates on your side (e.g., monthly batches) to control memory footprint even when a single request could return a long range.
- Monitoring: Alert when success is false, when expected symbols are missing, or when timestamps regress.
Endpoint recap and where to go next
- Latest: use it for quotes and conversions in USD⇄PSEI via rates.PSEI and rates.USDPSEI.
- Time-series: use it for backfilling and charts; remember end_date cannot be today.
- Convert: available if you want server-side conversion; confirm usage on the Documentation.
Find the exact symbol codes before you ship to prod: Indices-API Supported Symbols. For additional features like OHLC and intraday candles, see Indices-API Documentation. If you work with Model Card Protocol (MCP) or related pipelines, reference MCP for compatibility notes.
References and helpful links
- Indices-API Homepage
- Indices-API Documentation
- Indices-API Supported Symbols
- MCP Guidance
- Philippine Stock Exchange (Official)
- Investopedia: PSEi Overview
FAQ
What is the correct symbol for the Philippine Stock Exchange index?
Use PSEI, but always confirm on the Symbols page before deployment.
Why does the API show both PSEI and USDPSEI?
They are reciprocal rate expressions relative to USD. PSEI is USD per index unit; USDPSEI is index units per USD. Use whichever direction matches your computation to avoid extra division.
Can I set end_date to today for a time-series request?
No. end_date cannot be today. Use yesterday or the most recent completed trading day. Weekends and local holidays will not produce new values.
How often does the latest endpoint update?
It depends on your subscription plan (e.g., every 60 or 10 minutes). Check the Documentation and cache accordingly.
How do I display values in Netherlands Antillean Gulden (ANG)?
Convert PSEI units to USD using rates.PSEI, then convert USD to ANG using your FX source. Keep timestamps for both conversions so users see the freshness of each layer.
Ready to wire this into production? Start your 7‑day trial (PRO $49.99/mo) and get your API key now: Register. Once you have a key, follow the Documentation to extend this PSEI integration with time-series, OHLC, and more.