ProShares UltraShort Gold (GLL) - Per Ounce Price API: Integration Guide for Developers
You need to display or ingest the live ProShares UltraShort Gold (GLL) price in your app and optionally cross-check it against gold per-ounce logic. By the end of this guide, you’ll call the Metals-API latest endpoint for GLL, parse USD-per-share from the response, and ship production-ready handling for timestamps, base currency, caching, and market-closure gaps.
What you’re building: a reliable GLL “last” you can ship
This walkthrough focuses on pulling the latest GLL price via the Metals-API “latest” endpoint and interpreting the two relevant fields you’ll actually use:
- rates.USDGLL — the price of 1 GLL unit in USD (USD per GLL)
- rates.GLL — the reciprocal (GLL units per USD), useful for sanity checks and conversions
Metals-API’s core is precious and industrial metals data at per–troy ounce granularity (e.g., XAU = gold), but it also exposes a GLL symbol for teams who hedge, backtest, or report ETF-aligned values alongside per-ounce gold data. For a full symbol inventory, see the Metals-API Supported Symbols.
Endpoint you’ll use and why
We’ll keep this integration scoped and production-ready by using only the following:
- Latest Rates endpoint — to pull the current GLL reading you can cache and display.
- Optionally Historical or Time-series — to backfill a chart or validate yesterday’s close; see the Metals-API Documentation for request details.
If you later add XAU (gold) per-ounce pricing to correlate with GLL, you can query XAU in parallel using the same endpoints. Keep in mind that metals are quoted per troy ounce by default, whereas GLL is quoted per share when you read USDGLL.
Copy/paste curl: get the latest GLL
Use symbols=GLL,USDGLL so you have both the reciprocal and the directly usable USD-per-unit. Replace YOUR_API_KEY with your key from the Register page.
curl -s "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=GLL,USDGLL"
Real response to expect
The following is an official response example you can mirror in test fixtures:
{"success":true,"timestamp":1792022940,"date":"2026-10-15","base":"USD","rates":{"GLL":0.038940809968847,"USD":1,"USDGLL":25.68000000000023}}
How to read it
- base = "USD": everything is quoted relative to 1 USD unless explicitly inverted.
- rates.GLL = 0.038940809968847: that’s GLL per 1 USD (reciprocal units).
- rates.USDGLL = 25.68000000000023: that’s USD per 1 GLL (the field you’ll typically display as “price”).
- timestamp = 1792022940: Unix epoch seconds (UTC). Use this to track freshness and cache validity.
- date = "2026-10-15": calendar date corresponding to the timestamp window.
Minimal Python example that parses USD per GLL
This snippet calls the same endpoint as the curl above and extracts the display-ready value from rates.USDGLL:
import os
import time
import requests
API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
URL = "https://metals-api.com/api/latest"
params = {
"access_key": API_KEY,
"symbols": "GLL,USDGLL"
}
resp = requests.get(URL, params=params, timeout=10)
resp.raise_for_status()
data = resp.json()
if not data.get("success"):
raise RuntimeError(f"Metals-API error: {data}")
timestamp = data["timestamp"] # Unix seconds (UTC)
price_usd_per_gll = data["rates"]["USDGLL"] # USD per 1 GLL
reciprocal = data["rates"]["GLL"] # GLL per 1 USD (optional cross-check)
# Optional: strict reciprocal validation within a small tolerance
if abs((1.0 / price_usd_per_gll) - reciprocal) > 1e-9:
raise ValueError("Reciprocal mismatch detected")
print({
"symbol": "GLL",
"price_usd_per_gll": price_usd_per_gll,
"as_of_utc": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(timestamp))
})
Per-ounce vs. per-share: what to store and display
Metals-API metals such as gold (XAU) are quoted per troy ounce by default, while GLL is a share-based symbol. Keep these rules straight when modeling your data:
- For GLL, display rates.USDGLL when you need a price in USD per share.
- For metals like XAU, display rates.USDXAU for USD per troy ounce, or keep rates.XAU if you prefer the “ounces per USD” form. If you incorporate XAU later, confirm the unit field (troy ounces) where provided.
- Do not mix per-ounce and per-share fields; store the unit in your schema to avoid accidental arithmetic across mismatched units.
Caching, market hours, and when the number won’t move
Metals-API data freshness depends on your plan; the latest endpoint updates on a schedule specified in the docs. To build a robust client:
- Set a short cache lifetime aligned with the update frequency in your plan. A common pattern is to cache until the next expected update tick plus a small buffer.
- Use the timestamp in each response as your single source of truth for recency. Avoid comparing client time to server time without converting both to UTC.
- Expect slower or no changes during weekends and market holidays. Equity-linked symbols like GLL observe exchange calendars; don’t alert users on stagnant prices when the market is closed.
- Backfill via Historical or Time-series endpoints if you need continuity across non-trading days. Endpoint details are in the Documentation.
Error handling and guardrails you should add
- Check success in the JSON; if false, read the error payload and fail fast with a clear message.
- Validate that rates.USDGLL exists. If not present, retry with backoff and log the payload for diagnostics.
- Use timeouts on every request and keep a small pool of HTTP connections to reduce tail latency.
- Record the exact timestamp and symbols you requested to make historical reconciliation painless.
- Normalize precision: store raw doubles from the API for calculations; only round at presentation time.
Scaling your integration
If you need to chart or monitor GLL alongside metals per-ounce pricing (e.g., XAU), design your polling layer to fan out symbol sets while sharing a single cache and retry policy:
- Batch symbols in one latest call when reasonable (e.g., symbols=GLL,USDGLL,XAU,USDXAU) to reduce requests.
- Centralize inversion logic: whenever you read “per USD” rates, compute and store the reciprocal “USD per unit” for uniform display and alerting.
- Log derived values separately from source fields so you can re-derive from raw data if formulas evolve.
For data model consistency and symbol discoverability, consult the live catalog at Metals-API Supported Symbols.
A note on gold (XAU), analytics, and innovation
Many teams pair GLL with XAU to track the relationship between ETF price action and per-ounce gold reference data. Metals-API’s normalized format and consistent timestamps make it straightforward to:
- Compute rolling spreads or ratios between USDGLL and USDXAU (if you also query XAU).
- Trigger alerts on divergences using Time-series deltas.
- Integrate into quant pipelines that also price jewelry SKUs, refining inputs, or hedging models that require per-ounce baselines alongside exchange-traded instruments.
As you connect more analytics, keep unit boundaries explicit: per share (GLL) vs per troy ounce (XAU). For endpoint specifics and supported parameters, rely on the Documentation.
Plan and budget notes
- Metals-API does not offer a free trial. Obtain an API key from the Register page.
- Copper Monthly is listed at $19.99/month. For other plans or details around update intervals and endpoints access, review the account area and MCP.
Production checklist
- Symbols: request symbols=GLL,USDGLL so you have USD per share and the reciprocal in one call.
- Freshness: rely on timestamp (UTC). Show users when the price was last updated.
- Caching: align your cache TTL with your plan’s update cadence; invalidate on timestamp change.
- Units: treat GLL as per share; do not combine with per-ounce math unless you transform and label it.
- Retrievability: store raw JSON payloads for a short period to ease investigations and backtests.
- Resilience: add exponential backoff on HTTP 429/5xx, plus circuit breaking to protect your UI.
Where to go next
- Get an API key: Register.
- Read endpoint details and parameters: Documentation.
- Confirm symbol coverage: Metals-API Supported Symbols.
For broader market context on the ETF, consider checking the issuer’s product page or your preferred analytics platform for methodology and trading considerations. For example, you can review the issuer’s overview at ProShares GLL while using Metals-API exclusively for price retrieval and historical queries.
FAQ
Q: Which field is the “display price” for GLL?
A: Use rates.USDGLL (USD per GLL). rates.GLL is its reciprocal (GLL per USD) and mainly helpful for verification and conversions.
Q: What timezone is the timestamp?
A: The timestamp is Unix epoch seconds in UTC. Convert to your users’ local time only for display; keep UTC in storage and logs.
Q: How often does the latest endpoint update?
A: Update cadence depends on your plan. Cache until the next scheduled refresh and check the response timestamp to confirm a new tick. For specifics, see the Documentation.
Q: Can I chart GLL intraday?
A: You can poll latest on your plan’s schedule and store points with their timestamps. For historical ranges, use the Historical or Time-series endpoints described in the docs and ensure the symbol (GLL) is supported for those endpoints.
Q: How do I get gold (XAU) per-ounce alongside GLL?
A: Request symbols like XAU and USDXAU in the same latest call. Remember that XAU is per troy ounce, while GLL is per share—keep the units distinct in your UI and analytics.
Ready to wire this up? Create your key and start hitting the latest endpoint for GLL with confidence: Register. For account operations and plan management, visit MCP.