Get updated Yellow Brass (Y-BRASS) prices using this API
Building a pricing engine or analytics dashboard that automatically updates Yellow Brass (Y-BRASS) prices requires precise, timely market data and a consistent way to query, transform, and display it. With Metals-API, you can fetch updated Yellow Brass prices, compare them to historical levels, monitor intraday or daily fluctuations, and even compute spreads when bid/ask is available—all through a simple, production-ready JSON REST interface. In this guide, we’ll walk through how to integrate Metals-API to power real-time and historical Y-BRASS workflows, highlight best practices that save bandwidth and errors, and show how to get from an HTTP response to a reliable value in your own currency and preferred unit (troy ounces vs grams vs pounds) without surprises.
What problem we’re solving: automated Yellow Brass pricing across products and time
Common use cases for Yellow Brass (often specified as Y-BRASS or a broader BRASS symbol) include:
- E-commerce dynamic pricing: Reprice brass-dependent SKUs every 10–60 minutes based on input costs.
- Manufacturing cost rollups: Update bill-of-materials (BOM) valuations and MRP/ERP cost sheets using recent Yellow Brass quotes.
- Trading and hedging: Track short-term fluctuation and day’s OHLC to inform execution or hedging triggers.
- Research dashboards: Backfill historical charts, test factor models, or run seasonality studies using daily time-series.
Metals-API supports all these workflows through specialized endpoints: Latest Rates, Historical Rates, Time-Series, Fluctuation, OHLC, and Bid/Ask, with data generally quoted relative to a base currency (USD by default) and standardized units (typically per troy ounce). You can obtain the precise symbol to use for Yellow Brass from the official list; symbols can evolve and are periodically updated, so always verify the correct code for Yellow Brass first on the Metals-API Supported Symbols page.
Quick start: locate your Yellow Brass symbol and plan your data model
Before writing any code:
- Find the exact symbol for Yellow Brass (Y-BRASS or variant) via the official list at the Metals-API Supported Symbols.
- Confirm base currency behavior: by default, rates are delivered relative to USD; that means how much of the metal you get per USD, or the inverse depending on the endpoint’s semantics. We’ll explore interpretation shortly.
- Decide on units: many APIs quote “per troy ounce.” If your operations require grams, kilograms, or pounds, standardize conversions centrally to keep UI, alerts, and accounting consistent.
- Establish data freshness and caching: depending on your subscription tier, latest data update frequency varies. Cache responses appropriately to avoid unnecessary calls and to stabilize your UI during market pauses (weekends, holidays).
You can browse endpoint capabilities on the official docs at the Metals-API Documentation and secure your key at the Metals-API Website. If you’re starting now, sign up to get a free API key and experiment with the endpoints on your staging environment.
How real-time Yellow Brass pricing flows through your stack
At a high level:
- Your service calls Latest Rates to retrieve the current Yellow Brass quote (and optionally other metals in a single call for efficiency).
- For charts or historical analytics, you use the Historical Rates or Time-Series endpoint to populate backfilled datasets.
- For day-over-day alerts or intraday triggers, use Fluctuation, OHLC, and Bid/Ask as applicable to derive trend, movement, and spread.
- Normalize results to your currency and unit, and persist with timestamps for auditability and reproducibility.
To prevent surprises, validate that the symbol and unit returned match your expectations. Metals-API responses include a unit field (e.g., “per troy ounce”). Record it along with the base currency and timestamp for each price used.
Working with the Latest Rates for Yellow Brass
The Latest Rates endpoint returns current exchange rates for the metals you request. Use it to power storefront prices, trading tiles, or “current price” markers on charts.
Example curl request to fetch Yellow Brass alongside a few core benchmarks (replace YOUR_KEY and symbols with the exact Yellow Brass symbol from the symbols page):
curl -G https://metals-api.com/api/latest \
--data-urlencode "access_key=YOUR_KEY" \
--data-urlencode "base=USD" \
--data-urlencode "symbols=Y-BRASS,XAU,XAG"
Note: Always confirm the correct symbol on the Metals-API Supported Symbols page before using Y-BRASS in production.
Interpreting a Latest Rates response
The following is a representative JSON structure for Latest Rates (fields and shape are consistent across symbols; example symbols below include XAU, XAG). Your response for Yellow Brass will follow the same pattern with its symbol present in rates.
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912,
"XPD": 0.000744,
"XCU": 0.294118,
"XAL": 0.434783,
"XNI": 0.142857,
"XZN": 0.344828
},
"unit": "per troy ounce"
}
Key fields you’ll use for Yellow Brass:
- success: Boolean success flag. Always check this first.
- timestamp: Unix epoch seconds. Store for audit and cache-control decisions. Timezone is UTC by convention.
- base: “USD” by default. This means the numeric rate is expressed per USD, with unit specified separately.
- date: Date corresponding to the snapshot.
- rates: Object of symbol: value pairs. You’ll look for your Yellow Brass symbol (e.g., Y-BRASS) here.
- unit: Typically “per troy ounce.” If your UI shows grams or kg, convert. 1 troy ounce ≈ 31.1034768 grams.
Important interpretation detail: With base=USD and unit “per troy ounce,” the numeric value is “troy ounces per USD” for the given metal. To display “USD per troy ounce,” invert the value (1 / rate). Decide which representation you standardize on across your product to avoid confusion.
Caching and market calendar considerations
- Respect update cadence: Depending on plan tier, latest rates may refresh every 60 or 10 minutes (consult your plan). Avoid hammering the endpoint; memoize responses until the timestamp advances.
- Weekend/holiday behavior: Metals can have lower liquidity or static prices when markets are closed. Present the last known price, tagged with its timestamp, and avoid implying a live quote during closures.
- Retry strategy: On network errors or temporary API errors, implement exponential backoff and fall back to your most recent cached value.
Historical and Time-Series data for Yellow Brass
To backfill charts or run analytics (volatility, correlations), you’ll use Historical Rates for a single date and Time-Series to fetch a span of daily data. This is vital for brass demand forecasting in manufacturing and for tracking procurement P&L.
Fetching a specific historical date
Use Historical Rates to retrieve Yellow Brass on a past date. You’ll pass the date and your symbol, then parse the same familiar fields.
{
"success": true,
"timestamp": 1789432091,
"base": "USD",
"date": "2026-09-15",
"rates": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915,
"XPD": 0.000748
},
"unit": "per troy ounce"
}
When adapting this for Yellow Brass, request that symbol, then store:
- date: the trading day you queried.
- rates[<Y-BRASS>]: value you’ll invert if you need “USD per troy ounce.”
- unit: persist to ensure you can reconcile past computations.
Historical archives typically extend back several years. Review exact coverage details in the Metals-API Documentation, and always sanity-check missing days if a date falls on a weekend or holiday.
Time-Series for charts and analytics
The Time-Series endpoint returns a dictionary keyed by date, letting you bulk-load multiple days in one request—ideal for candlestick charts or analytics windows.
{
"success": true,
"timeseries": true,
"start_date": "2026-09-09",
"end_date": "2026-09-16",
"base": "USD",
"rates": {
"2026-09-09": {
"XAU": 0.000485,
"XAG": 0.03825,
"XPT": 0.000915
},
"2026-09-11": {
"XAU": 0.000483,
"XAG": 0.0382,
"XPT": 0.000913
},
"2026-09-16": {
"XAU": 0.000482,
"XAG": 0.03815,
"XPT": 0.000912
}
},
"unit": "per troy ounce"
}
How to use this for Yellow Brass:
- Request your date window and include the Yellow Brass symbol.
- For each date, extract rates[date][<Y-BRASS>].
- Convert to your preferred representation (USD/oz or oz/USD), apply unit conversion if displaying grams/kg, and cache locally for charting. Avoid recomputing conversions repeatedly on the client.
Performance tip: If you need a rolling month of data, fetch the last N days with Time-Series on first load, then append one day at a time using the Historical endpoint each subsequent day to keep bandwidth minimal.
Monitoring Yellow Brass movement: Fluctuation and OHLC
When you need day-over-day change, momentum, and ranges, Fluctuation and OHLC provide compact analytics-ready data. These are ideal for powering alert systems (e.g., “Yellow Brass up 2% WoW” or “Today’s high exceeded last week’s high”).
Fluctuation for percent change and delta
The Fluctuation endpoint summarizes change between two dates for each requested symbol.
{
"success": true,
"fluctuation": true,
"start_date": "2026-09-09",
"end_date": "2026-09-16",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
},
"XAG": {
"start_rate": 0.03825,
"end_rate": 0.03815,
"change": -0.0001,
"change_pct": -0.26
},
"XPT": {
"start_rate": 0.000915,
"end_rate": 0.000912,
"change": -3.0e-6,
"change_pct": -0.33
}
},
"unit": "per troy ounce"
}
Apply this to Yellow Brass:
- Request rates for Y-BRASS between the start and end dates.
- Use change_pct for quick visual signals (green/red). If your UI expects USD/oz, apply consistent inversion when interpreting start_rate and end_rate before calculating derived deltas.
- Normalize dates to UTC and reconcile with your market calendar to avoid confusing users on holiday periods.
OHLC to understand the day’s range
OHLC provides the open, high, low, and close for a given date—crucial for trading views and risk checks.
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
},
"XAG": {
"open": 0.03825,
"high": 0.0383,
"low": 0.0381,
"close": 0.03815
},
"XPT": {
"open": 0.000915,
"high": 0.000918,
"low": 0.00091,
"close": 0.000912
}
},
"unit": "per troy ounce"
}
For Yellow Brass:
- Map each of open/high/low/close to your desired quote format (e.g., USD per troy ounce) consistently.
- Generate candlesticks or compute intraday volatility proxies.
- Alert on high/low breakouts relevant to procurement or hedging policy.
Getting granular on execution: Bid/Ask spreads for Yellow Brass
When supported by your plan and available for the symbol, Bid/Ask provides a snapshot of market depth and spread. This helps evaluate slippage and cost to trade.
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": {
"bid": 0.000481,
"ask": 0.000483,
"spread": 2.0e-6
},
"XAG": {
"bid": 0.0381,
"ask": 0.0382,
"spread": 0.0001
},
"XPT": {
"bid": 0.000911,
"ask": 0.000913,
"spread": 2.0e-6
}
},
"unit": "per troy ounce"
}
How to use for Yellow Brass:
- If your downstream uses USD/oz, invert bid and ask separately; do not invert spread directly without recomputing from inverted bid/ask.
- Compute mid = (bid + ask) / 2 to stabilize UI pricing when you don’t want to show two-sided quotes.
- For execution cost estimates, multiply spread by your intended notional size and unit conversion if applicable.
Converting currencies and normalizing units for Yellow Brass
Many teams report in EUR, GBP, JPY, or local currencies. The Convert endpoint lets you transform between metals and currencies and returns a result with a clear unit context.
{
"success": true,
"query": {
"from": "USD",
"to": "XAU",
"amount": 1000
},
"info": {
"timestamp": 1789518491,
"rate": 0.000482
},
"result": 0.482,
"unit": "troy ounces"
}
Apply to Yellow Brass by substituting your target symbol and currency. Practical considerations:
- Consistency: If you standardize on “USD per troy ounce,” keep conversions consistent and centralize conversions to avoid rounding drift between services.
- Unit conversions: When displaying grams, multiply oz values by 31.1034768 (or the inverse if going grams to oz). Keep constants in config, not scattered in code.
- Taxes and logistics: If you add premiums, VAT, or freight surcharges for final retail prices, layer these after raw conversion, with each factor and timestamp logged.
Intraday, Carat, LME historicals, and specialized endpoints in context of Yellow Brass
Beyond the daily endpoints, Metals-API offers specialized features when applicable to your plan and symbol:
- Intraday: Request intraday exchange rate data for a single symbol to build finer-grained dashboards or alerts. If Yellow Brass intraday data is supported on your plan, use it to track within-day volatility.
- Carat: For gold-specific workflows (e.g., jewelry), the Carat endpoint exposes karat-based gold rates. While not directly applicable to brass, it’s beneficial if your catalog mixes brass casings with gold plating or gold findings priced by karat.
- Historical LME: For LME-traded symbols, Metals-API provides historical access dating back to 2008. If your Yellow Brass exposure correlates with a listed base metal (like copper or zinc), LME historicals can enrich your factor models.
- Lowest/Highest Price: A concise way to request the extremes for a particular date—useful for summary dashboards or monthly procurement reviews.
Consult coverage specifics and examples at the Metals-API Documentation and validate symbol eligibility on the Metals-API Supported Symbols.
Example integration flow: time-aware pricing for a Yellow Brass SKU
Consider a SKU that uses 0.725 kg of Yellow Brass. Your frontend wants to show a live materials cost in EUR per unit, updating every 30 minutes, and a 30-day change badge.
- At service startup, call Time-Series for Y-BRASS for the last 30 calendar days, base=USD.
- Convert daily oz/USD to USD/oz by inversion, then to USD/kg (1 oz troy ≈ 31.1034768 g; 1 kg = 1000 g).
- Convert USD to EUR using your internal FX feed or Metals-API currency rates if available via your plan.
- Compute 30-day change_pct from the earliest to the most recent date in the series.
- On a 30-minute cadence, call Latest Rates for Y-BRASS. Repeat the same conversion pipeline and update the display price and the badge if the latest day has changed.
- Cache responses and persist daily closes by UTC date for reproducibility.
JavaScript snippet: fetching and transforming Yellow Brass time-series
The following example illustrates how you might fetch a time-series in JavaScript, convert to a normalized USD per troy ounce representation, and prepare for charting. Replace YOUR_KEY and the symbol with the correct Yellow Brass code from the symbols list.
async function fetchYellowBrassSeries(startDate, endDate) {
const url = new URL('https://metals-api.com/api/timeseries');
url.searchParams.set('access_key', 'YOUR_KEY');
url.searchParams.set('base', 'USD');
url.searchParams.set('start_date', startDate); // YYYY-MM-DD
url.searchParams.set('end_date', endDate); // YYYY-MM-DD
url.searchParams.set('symbols', 'Y-BRASS'); // Verify symbol on symbols page
const res = await fetch(url.toString(), { method: 'GET' });
if (!res.ok) throw new Error('Network error: ' + res.status);
const data = await res.json();
if (!data.success) throw new Error('API error: ' + JSON.stringify(data));
const unit = data.unit; // typically "per troy ounce"
const series = [];
// Convert oz/USD to USD/oz by inversion, if you standardize on USD per oz
for (const [date, rates] of Object.entries(data.rates)) {
const v = rates['Y-BRASS'];
if (typeof v === 'number' && v > 0) {
const usdPerOz = 1 / v;
series.push({ date, usdPerOz, unit });
}
}
// Sort by date ascending
series.sort((a, b) => (a.date < b.date ? -1 : a.date > b.date ? 1 : 0));
return series;
}
Notes:
- Check data.success and handle structured API errors gracefully.
- Always confirm that the symbol exists for each date (some days can be missing if the market was closed).
- If you prefer grams, multiply usdPerOz by (1 / 31.1034768) for USD/gram.
Understanding base currency, units, and conversions the right way
Consistent interpretation is critical for correctness:
- Base currency: With base=USD, the “rates” values are quoted relative to USD. If the response unit is “per troy ounce,” think of the numeric rates as oz per USD, not USD per oz. If your application expects USD per oz, invert the value.
- Units: The “unit” field describes the commodity measure. Common values include “per troy ounce.” Always store and display unit, and transform centrally before presenting to users.
- Weight conversions:
- 1 troy ounce ≈ 31.1034768 grams
- 1 kilogram = 1000 grams
- USD/kg = USD/oz ÷ (1 kg in oz troy) = USD/oz ÷ (1000 / 31.1034768)
- Rounding: For consumer-facing UIs, round at display time; for ledgers and P&L, keep full precision and store the original response plus conversions.
Designing for resiliency: error handling and fallbacks
Production integrations should implement:
- Validation: Assert presence of success=true; verify unit and base match expectations.
- Graceful degradation: On API errors, serve cached values with a clear “as-of” timestamp.
- Backoff: Use exponential backoff for transient network errors; avoid tight retry loops.
- Monitoring: Track response times, error rates, and staleness (current time minus timestamp) in your observability stack.
Data engineering playbook: aggregation, storage, and recomputation
For teams handling large catalogs and multi-metal exposure:
- Batching: Request multiple symbols in one call where feasible to reduce overhead.
- Normalization pipeline:
- Ingest raw JSON and store verbatim (S3, GCS, or data lake) with timestamp partitioning.
- Transform to your canonical form (e.g., USD/oz) using deterministic conversions.
- Persist normalized series in a time-series store or relational table keyed by symbol, base, and unit.
- Index by date for fast range queries in charts and reporting.
- Reproducibility: When re-running old reports, always use the archived historical values tied to their original timestamps.
- Idempotency: Ensure that repeated runs of your ETL for a given date window produce identical results.
Security, API keys, and least privilege
Keep your Metals-API key safe:
- Never embed keys in browser code. Call Metals-API from server-side services you control or from secure backends-for-frontends.
- Use environment variables or secret managers for key storage (e.g., Vault, AWS Secrets Manager).
- Implement request-level input validation to guard against injection in query parameters.
- Log only necessary metadata; avoid logging full keys.
Get your key and explore the docs on the Metals-API Website. To see every endpoint signature and payload, open the Metals-API Documentation.
Managing quotas, caching, and performance
Efficient usage lowers latency and stays within plan quotas:
- Cache latest responses until the timestamp changes. Align your polling interval with your plan’s update cadence.
- For charts, use Time-Series to bulk-load initial data, then incremental Historical fetch for the newest day rather than full-range reloads.
- Avoid N+1 calls: request multiple symbols at once when you need several metals in a single UI view.
- Use HTTP-level caching in your API gateway or CDN for read-only endpoints if your architecture supports it.
Common pitfalls when pricing Yellow Brass
- Mixing units: Showing USD/kg in one view and USD/oz in another without clear labeling. Always display unit near the number.
- Inversion mistakes: Using oz/USD where your math expects USD/oz can invert price directions, breaking alerts and P&L. Standardize on one convention internally.
- Timezone drift: Key off UTC and store timestamps with timezones to avoid “missing” a day due to local clock rollovers.
- Comparing non-trading days: Weekend prices may be static; exclude them or mark them in analytics to avoid skewing volatility.
How Yellow Brass fits into a multi-metal analytics stack
Brass is typically an alloy influenced by base metal markets like copper and zinc. In a research context, consider:
- Correlation tracking: Use Time-Series across related metals (e.g., copper, zinc) to explain Yellow Brass movements.
- Factor models: Build regressions using industrial demand indicators, energy prices, and currency moves to forecast brass-linked costs.
- Scenario testing: Store pre- and post-event OHLC for significant macro days (rate decisions, energy shocks) to calibrate buffers.
While this article centers on Yellow Brass, gold (XAU) often acts as a macro hedge and can be a useful reference series in your dashboards. Metals-API offers consistent schemas across metals, so integrating XAU for benchmarking is straightforward.
Reference: additional example JSON responses and what they mean
The following responses are representative across metals and are directly applicable to Yellow Brass once you substitute the correct symbol. Understanding these shapes helps when building parsers and test fixtures.
Another Latest Rates example and parsing notes
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": 0.000482,
"XAG": 0.03815
},
"unit": "per troy ounce"
}
- Use timestamp for staleness detection; refresh UI only when it changes.
- Always check unit before math; persist unit in your metrics payloads.
Historical Rates example with validation
{
"success": true,
"timestamp": 1789432091,
"base": "USD",
"date": "2026-09-15",
"rates": {
"XAU": 0.000485
},
"unit": "per troy ounce"
}
- Confirm presence of your target symbol on that date. If not present, record null and mark “market closed” rather than defaulting to zero.
Time-Series with sparse dates
{
"success": true,
"timeseries": true,
"start_date": "2026-09-09",
"end_date": "2026-09-16",
"base": "USD",
"rates": {
"2026-09-09": { "XAU": 0.000485 },
"2026-09-11": { "XAU": 0.000483 },
"2026-09-16": { "XAU": 0.000482 }
},
"unit": "per troy ounce"
}
- Notice missing “2026-09-10,” “2026-09-12,” etc. Do not assume continuity; build charting code tolerant of gaps.
Fluctuation with negative change
{
"success": true,
"fluctuation": true,
"start_date": "2026-09-09",
"end_date": "2026-09-16",
"base": "USD",
"rates": {
"XAU": {
"start_rate": 0.000485,
"end_rate": 0.000482,
"change": -3.0e-6,
"change_pct": -0.62
}
},
"unit": "per troy ounce"
}
- Always interpret change_pct in the same representation your analytics expect. If you convert rates, derive change_pct from the converted values to avoid floating-point artifacts.
OHLC example with range checks
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": {
"open": 0.000485,
"high": 0.000487,
"low": 0.000481,
"close": 0.000482
}
},
"unit": "per troy ounce"
}
- Assert low ≤ open/close ≤ high. If not, log and quarantine the record for review to keep analytics clean.
Bid/Ask inversion example
{
"success": true,
"timestamp": 1789518491,
"base": "USD",
"date": "2026-09-16",
"rates": {
"XAU": { "bid": 0.000481, "ask": 0.000483, "spread": 2.0e-6 }
},
"unit": "per troy ounce"
}
- If you need USD/oz:
- bid_usd_per_oz = 1 / ask
- ask_usd_per_oz = 1 / bid
- spread_usd_per_oz = ask_usd_per_oz - bid_usd_per_oz
Practical guidance a beginner might miss
- Numbers are small: Rates like 0.000482 can look odd until you internalize that they’re oz/USD. Invert to get a familiar USD/oz number for display.
- Use decimals for currency: If your language/runtime has decimal types, prefer them to binary floats for monetary math to reduce rounding surprises.
- Auditability: Store raw JSON alongside computed fields. It makes reconciliation straightforward when stakeholders ask “why did price move on that day?”
- Feature flags: Gate premium features (Bid/Ask, Intraday) behind config checks so your app runs on multiple plan tiers without code changes.
Innovation and the future of brass pricing with data
The digitization of metal markets enables real-time procurement decisions, automated cost pass-through in pricing, and AI-driven forecasts. For Yellow Brass specifically, tying live prices to production schedules and vendor negotiations reduces latency in cost control. As intraday coverage, analytics endpoints, and cross-asset links deepen, you can:
- Automate hedging policy triggers on statistical breakouts derived from OHLC and fluctuation.
- Blend macro signals (energy, rates) with metals data to forecast cost volatility windows.
- Build “smart” BOMs that choose alternative materials on-the-fly when brass cost spikes breach thresholds.
Metals-API provides a unified schema and consistent semantics across metals, letting you extend from Yellow Brass to gold (XAU), silver, copper, aluminum, and more without re-architecting your data layer. Explore supported assets at the Metals-API Supported Symbols.
Compliance, governance, and reporting
For finance and audit readiness:
- Version your ETL and analytics logic. When changing unit conventions or conversion constants, record the effective date.
- Keep complete lineage: raw response → normalized series → dashboard metrics. Attach timestamps and base/unit meta at each step.
- Back-test changes: Before rolling unit or currency changes into production, re-run historical periods and validate that reported P&L shifts are expected.
Putting it all together for Yellow Brass (Y-BRASS)
To deliver updated Yellow Brass prices reliably:
- Discover the exact symbol on the Metals-API Supported Symbols page.
- Fetch Latest Rates on a cadence aligned with your plan, and display USD/oz (or your chosen standard) with explicit units.
- Backfill Time-Series for charts and analytics, and use Fluctuation and OHLC to drive alerts and summaries.
- Use Bid/Ask when available to estimate execution cost and set tighter pricing bands for quotes.
- Convert to grams or kilograms and local currency consistently and centrally, with careful inversion where needed.
Start integrating today—get your key from the Metals-API Website and reference the endpoint specifics in the Metals-API Documentation. For related market context and macro data comparison, you can also consult established financial data sources and analysis tools such as your preferred economic calendars or analytics platforms to complement your brass insights.
Complete curl example: pulling Yellow Brass latest and time-series
Below are two compact curl examples you can adapt. Replace YOUR_KEY and the symbol after verifying it on the symbols page.
# Latest Yellow Brass (plus gold for benchmarking)
curl -G https://metals-api.com/api/latest \
--data-urlencode "access_key=YOUR_KEY" \
--data-urlencode "base=USD" \
--data-urlencode "symbols=Y-BRASS,XAU"
# 14-day Yellow Brass time-series
curl -G https://metals-api.com/api/timeseries \
--data-urlencode "access_key=YOUR_KEY" \
--data-urlencode "base=USD" \
--data-urlencode "start_date=2026-09-03" \
--data-urlencode "end_date=2026-09-16" \
--data-urlencode "symbols=Y-BRASS"
Parse the responses following the examples earlier in this post; persist the base, unit, and timestamp to ensure clarity in reporting and downstream transforms.
Gold (XAU) as a macro benchmark alongside Yellow Brass
While your primary focus may be Yellow Brass, pairing it with gold (XAU) provides context for broader metal market sentiment and currency effects. The same endpoints and response fields apply. For instance, you can:
- Fetch XAU via Latest Rates to monitor safe-haven flows that may indirectly influence industrial metals sentiment.
- Compare XAU and Yellow Brass via the Fluctuation endpoint to understand divergence or co-movement over a period.
- Use OHLC for XAU to benchmark your “risk day” classifications and refine alert thresholds for industrial metals like brass.
Additional resources and next steps
- Review endpoints, parameters, and coverage: Metals-API Documentation
- Confirm symbols and add new ones to your portfolio: Metals-API Supported Symbols
- Get your free API key and start testing: Metals-API Website
FAQ
- How do I find the correct symbol for Yellow Brass?
Check the official list at the Metals-API Supported Symbols page. Use exactly the symbol listed for your queries. - Why does the rate look so small?
With base=USD and unit “per troy ounce,” the rates are oz/USD. Invert to get USD/oz, which is more familiar for display. - How should I handle weekends and holidays?
Expect stale or unchanged values. Display the as-of timestamp and avoid labeling the number as “live” when markets are closed. - What’s the best way to convert to kilograms?
Convert to USD/oz first (if necessary), then to USD/gram by dividing by 31.1034768, and multiply by 1000 for USD/kg. Store and reuse the conversion constants centrally. - Can I monitor volatility and daily ranges?
Yes. Use OHLC to compute intraday ranges, and Fluctuation for period-over-period percent changes. - How do I avoid hitting rate limits?
Align polling with your plan’s update frequency, cache responses until the timestamp changes, and batch multiple symbols in one request when possible.