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

NameTypeRequiredDescription
_apiKeystringyesMetals-API key
datestringyesDate in YYYY-MM-DD format (e.g., “2024-01-15”)
basestringnoBase currency (default “USD”)
symbolsstringnoComma-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

FieldTypeDescription
basestringBase currency code (e.g., USD, EUR)
datestringHistorical date in YYYY-MM-DD format
timestampnumberUnix timestamp of when prices were captured
ratesobjectMetal 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.

Regenerated from source · build May 9, 2026