get_historical
Pack: metals-api · Endpoint: https://gateway.pipeworx.io/metals-api/mcp
Get metal prices for a specific historical date. Returns spot prices per troy ounce for that day. Useful for tracking price changes or computing returns.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
_apiKey | string | yes | Metals-API key |
date | string | yes | Date in YYYY-MM-DD format (e.g., “2024-01-15”) |
base | string | no | Base currency (default “USD”) |
symbols | string | no | Comma-separated metal symbols (e.g., “XAU,XAG”) |
Example call
Arguments
{
"_apiKey": "your-metals-api-key",
"date": "2024-01-15"
}
curl
curl -X POST https://gateway.pipeworx.io/metals-api/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_historical","arguments":{"_apiKey":"your-metals-api-key","date":"2024-01-15"}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_historical', {
"_apiKey": "your-metals-api-key",
"date": "2024-01-15"
});
More examples
{
"_apiKey": "your-metals-api-key",
"date": "2023-06-30",
"base": "GBP",
"symbols": "XAU,XCU"
}
Response shape
Always returns: base, date, timestamp, rates
| Field | Type | Description |
|---|---|---|
base | string | Base currency code (e.g., USD, EUR) |
date | string | Historical date in YYYY-MM-DD format |
timestamp | number | Unix timestamp of when prices were captured |
rates | object | Metal spot prices per troy ounce, keyed by symbol (e.g., XAU, XAG) |
Full JSON Schema
{
"type": "object",
"properties": {
"base": {
"type": "string",
"description": "Base currency code (e.g., USD, EUR)"
},
"date": {
"type": "string",
"description": "Historical date in YYYY-MM-DD format"
},
"timestamp": {
"type": "number",
"description": "Unix timestamp of when prices were captured"
},
"rates": {
"type": "object",
"description": "Metal spot prices per troy ounce, keyed by symbol (e.g., XAU, XAG)",
"additionalProperties": {
"type": "number"
}
}
},
"required": [
"base",
"date",
"timestamp",
"rates"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"metals-api": {
"url": "https://gateway.pipeworx.io/metals-api/mcp"
}
}
}
See Getting Started for client-specific install steps.