MetalAlert data in Excel and the API
Pull the current probabilities and the price history into a workbook that refreshes on demand, or read them from your own systems. API access is included in the Organization plan.
How it works
An administrator of your organization creates an API key in the MetalAlert app (Account, then API & Excel). A workbook uses that key to read the data through Excel's Power Query, so a refresh brings in the latest numbers without copying anything by hand. Data is updated on weekdays.
Set up in Excel
- In the app, open Account, then API & Excel, and create a key. Name it after the workbook or team that will use it. The key is shown once.
- In Excel, choose Data, Get Data, From Other Sources, Blank Query, then Advanced Editor.
- Paste the recipe below, replace
PASTE-YOUR-KEY-HEREwith your key, and choose Done. If Excel asks how to connect, pick Anonymous: the key is sent in the request header. - Choose Close & Load. Use Refresh any time for the latest data.
let
Key = "PASTE-YOUR-KEY-HERE",
Source = Csv.Document(
Web.Contents("https://api.metalalert.ai/api/v1/signals", [Headers = [Authorization = "Bearer " & Key], Query = [format = "csv"]]),
[Delimiter = ",", Encoding = 65001]
),
Promoted = Table.PromoteHeaders(Source, [PromoteAllScalars = true]),
Typed = Table.TransformColumnTypes(Promoted, {{"probability", type number}, {"threshold_pct", Int64.Type}, {"horizon_months", Int64.Type}})
in
Typed
The app shows the same recipe with your new key already filled in.
What you can read
Base address: https://api.metalalert.ai/api/v1. Add format=csv for CSV (best for Excel); the default is JSON.
/signals: the current probabilities, one row per metal, horizon, direction and threshold, with the date they were updated./signals/history: daily snapshots of those probabilities. Options:metal,from,to./prices/dailyand/prices/monthly: LME cash prices. Options:metal,from,to. The default is the last 365 days./backtest: what each model predicted against what happened. Requiresmetal; optionalhorizon_months,direction,threshold_pct./metals: the tracked metals.
Dates are written as YYYY-MM-DD. A request returns at most 20,000 rows; for CSV the response header X-Next-Offset gives the offset to request the next page. The machine-readable description is at /api/v1/openapi.json.
Using the API from your own systems
Send the key in the Authorization header on every request:
curl -H "Authorization: Bearer YOUR-KEY" "https://api.metalalert.ai/api/v1/signals?format=csv"
Limits and keeping keys safe
- Each key may make 60 requests per minute and 5,000 per day. Over the limit the API answers 429 and a
Retry-Afterheader says when to try again. - Anyone who can open a workbook can read the key inside it, so treat the file as a secret and use one key per workbook or team. An administrator can revoke a key at any time and workbooks using it will stop refreshing.
- Keys work only while your organization's subscription is active, and are for your organization's internal use. See section 9 of the Terms of Service.
Not on the Organization plan yet?
Join as a beta tester or book a walkthrough, and tell us your team wants API and Excel access.