# Commodity Prices API - Metals, Lithium, Agriculture, Forest (`nabeelbaghoor/metals-commodity-prices-api`) Actor

Commodity price assessments and history from the Fastmarkets Physical Prices and Market Data APIs: base and steel metals, lithium, cobalt and battery raw materials, agriculture and forest products. Low, mid, high, forecasts, instruments, references. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/metals-commodity-prices-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Business, Developer tools, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 price or forecast point returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Commodity Prices API - Metals, Lithium, Agriculture, Forest

Pull Fastmarkets commodity price assessments, price history, forecasts, instruments and reference data into clean dataset rows with your own Fastmarkets API credentials.

Works with the Fastmarkets Physical Prices API v2 and Market Data API v1 on api.fastmarkets.com, as documented in their Swagger definitions and the Fastmarkets help centre: GET /physical/v2/Prices for the latest or given date price, GET /physical/v2/Prices/history for a time series with optional forecasts and revisions, GET /physical/v2/Instruments and GET /physical/v2/References for the catalogue and reference lists, and GET /marketdata/v1/Prices, /Prices/History and /Instruments for exchange and market instruments. Each price becomes one row with the symbol, date, assessment date, low, mid, high and list price, change since previous and year ago, revision, preliminary and appraisal flags, assessment period and pricing rationale, plus the full Fastmarkets record. Download as JSON, CSV or Excel, schedule it daily, or feed it into your own procurement, risk or pricing models. Bring your own API key.

BYOK, not live-tested: every route, parameter and response field comes from Fastmarkets' published Swagger definitions and help centre, and every route was confirmed to exist on api.fastmarkets.com, but the actor has not been run against a live Fastmarkets subscription.

### What it does

- **Physical prices**: the latest price assessment, or the assessments on dates you give, for up to 500 symbols a run, such as aluminium scrap, steel, copper, nickel, lithium carbonate and hydroxide, cobalt, graphite, rare earths, pulp, paper, lumber, panels, grains and oilseeds. Choose the assessed value or a weekly, monthly, quarterly or yearly average, and convert to a target currency or unit.
- **Physical price history**: a time series between two dates, on assessment days or weekdays with carry forward, with optional revision history and 24 month forecasts as their own rows.
- **Physical instruments**: symbol, description, commodity, product, location, price type, currency, unit, incoterm, frequency, status, launch date, Bloomberg tickers and methodology link. Leave symbols empty to list every instrument your subscription covers.
- **Reference data**: currencies, units of measure, price calculation types, incoterms, commodities and sources, with IDs to use as conversion targets and filters.
- **Market data prices, history and instruments**: bid, mid and ask for exchange and market instruments such as LME copper cash (XL-CA-FRC.O), by interval or count, plus instrument type, maturity, lot size and delay class.
- **Read only**: only GET routes are called; nothing in your Fastmarkets account changes.
- **Pay only for results**: an unknown or unlicensed symbol, an empty range or a refused request gives one free row that says why.

### How to get credentials

Fastmarkets API access is part of a Fastmarkets data subscription. Your Fastmarkets account manager or support team issues an API service name and service key. Paste them into Service name and Service key, or set the DATA_API_SERVICE_NAME and DATA_API_KEY secrets. The actor exchanges them at auth.fastmarkets.com for an access token for the scope the mode needs (fastmarkets.physicalprices.api or fastmarkets.marketdata.api), once per run, and renews it on a 401. You can also paste a ready access token into Service key and leave Service name empty. Secrets go only to Fastmarkets and are never logged. Missing or rejected credentials end the run cleanly with a status message.

### Input

| Field | Modes | Description |
| --- | --- | --- |
| `mode` | all | `physicalPrices`, `physicalHistory`, `physicalInstruments`, `references`, `marketPrices`, `marketHistory` or `marketInstruments` |
| `symbols` | price and instrument modes | Instrument symbols, one per line (up to 500 a run) |
| `dates` | physicalPrices | YYYY-MM-DD dates; empty for the latest price |
| `fromDate`, `toDate` | physicalHistory | Date range, from date required |
| `priceCalculationType` | physical prices and history | None, WeightedAverageOfTrades, WeeklyAverage, MonthlyAverage, QuarterlyAverage, YearlyAverage |
| `averageToDateStrategy` | physical prices and history | exclude, explicit, include |
| `calendarType`, `carryForward` | physicalHistory | AssessmentDays or Weekdays, carry the last price forward |
| `revisionHistory`, `forecastType` | physicalHistory | Previous revisions, F24M forecast |
| `fields` | physical modes | Optional extra fields such as pricingRationale |
| `targetCurrency`, `targetUnitOfMeasure` | physical prices and history | Conversion targets such as USD and Tonne |
| `referenceTypes` | references | Currency, UnitOfMeasure, PriceCalculationType, Incoterm, Commodity, Source |
| `marketFields` | market prices and history | Fields such as bid, mid, ask |
| `startTime`, `interval`, `count` | marketHistory | Start time, a days:hours:minutes:seconds span or a count |
| `maxResults` | all | Row ceiling for the run (default 100) |
| `requestsPerMinute` | all | Pacing, default 60 |
| `serviceName`, `apiKey` | all | Your Fastmarkets service name and service key (or an access token in `apiKey`) |

An input set for a mode that does not take it is left off with a warning, never sent.

Example: monthly averages for two aluminium instruments in 2026, converted to euros.

```json
{
    "mode": "physicalHistory",
    "symbols": ["MB-AL-0012", "MB-AL-0003"],
    "fromDate": "2026-01-01",
    "toDate": "2026-09-30",
    "priceCalculationType": "MonthlyAverage",
    "targetCurrency": "EUR",
    "fields": ["pricingRationale", "midChangeSincePrevious"],
    "maxResults": 200
}
```

### Example output

An illustrative physical price row, shaped like the documented Prices response (values are an example). The full price is kept under `record`.

```json
{
    "mode": "physicalPrices",
    "modeLabel": "Physical prices",
    "recordType": "price",
    "input": "MB-AL-0012",
    "found": true,
    "symbol": "MB-AL-0012",
    "date": "2026-10-20",
    "assessmentDate": "2026-10-20T12:00:00+00:00",
    "priceCalculationType": "None",
    "low": 38.0,
    "mid": 38.5,
    "high": 39.0,
    "midChangeSincePrevious": -1.2,
    "midChangeSincePreviousProportion": -0.0302,
    "revision": 0,
    "preliminaryPrice": false,
    "appraisalPrice": false,
    "assessmentPeriod": "14-20 Oct 2026",
    "pricingRationale": "Scrap grades continue to move up.",
    "note": null,
    "record": { "symbol": "MB-AL-0012", "date": "2026-10-20", "low": 38.0, "mid": 38.5, "high": 39.0 }
}
```

### FAQ

#### What is the Fastmarkets Physical Prices API?

Fastmarkets is a price reporting agency for metals, battery raw materials, agriculture and forest products, publishing assessments under brands such as Metal Bulletin, American Metal Market, Industrial Minerals and RISI. The Physical Prices API serves those assessments, their history, forecasts and instrument metadata to subscribers.

#### What is the difference between the Physical Prices API and the Market Data API?

The Physical Prices API carries Fastmarkets' own assessed prices (low, mid, high and list) for physical commodities, with MB style symbols such as MB-AL-0012. The Market Data API carries exchange and market instruments, such as LME copper cash official, with bid, mid and ask fields and timestamps.

#### Do I need my own Fastmarkets subscription?

Yes. This is a bring-your-own-key actor: it calls Fastmarkets with your service name and key, under your subscription and its terms. You only see instruments your subscription covers; others come back as free rows marked Forbidden or NotFound.

#### How do I find the right symbols?

Run Physical instruments or Market data instruments with no symbols to list every instrument your credentials can see, with descriptions, commodities, locations and units. Symbols also appear on the methodology and price pages of the Fastmarkets platform.

#### Can I get monthly or weekly averages?

Yes. Set the price calculation type to WeeklyAverage, MonthlyAverage, QuarterlyAverage, YearlyAverage or WeightedAverageOfTrades where the instrument supports it, and use the average to date setting for periods still in progress.

#### Can I get lithium, cobalt or nickel price forecasts?

Physical price history with forecast type F24M returns Fastmarkets' 24 month forecast points as rows with recordType forecast, where your subscription includes forecasts.

#### What do I pay?

Pay per result: 0.01 USD per price or forecast point, 0.006 USD per instrument and 0.005 USD per reference value. Unknown or unlicensed symbols, empty ranges and refused requests are never charged. Your Fastmarkets subscription is billed separately by Fastmarkets.

### Pricing

| Event | Price | Charged for |
| --- | --- | --- |
| `price-record` | 0.01 USD | Each physical price, historical price, forecast point or market data price |
| `instrument-record` | 0.006 USD | Each physical or market data instrument |
| `reference-record` | 0.005 USD | Each reference value |

### Keyword map

commodity price API, metal prices API, lithium price API, cobalt price API, battery raw materials prices, steel price data, aluminium scrap prices, nickel price history, pulp and paper prices, lumber price data, agriculture commodity prices, price assessment history, commodity price forecasts, Fastmarkets API, Metal Bulletin prices, LME copper prices.

### Terms and data use

Fastmarkets data is licensed under your agreement with Fastmarkets (the Fastmarkets Standard Terms plus your order form). The Standard Terms license the data for your internal business use by your Authorised Users, and a contractor working for you counts as an Authorised User (1(c), 3(a)). They forbid redistributing the data to third parties (3(b)), using it to build a competing product, and using it with artificial intelligence tools or models without Fastmarkets' prior consent (1(g), 3(c)), and require you to delete it when your subscription ends (7(c)). The terms set no limit on how long you keep data during your subscription. Run this actor with your own credentials, keep the results inside your organisation, do not share or resell them, do not load them into AI tools or models unless Fastmarkets has agreed, and delete the dataset when your subscription ends. This actor is not affiliated with or endorsed by Fastmarkets.

# Actor input Schema

## `mode` (type: `string`):

Physical prices returns the latest (or given date) price assessment for each symbol. Physical price history returns a time series over a date range, with optional forecasts and revisions. Physical instruments lists instrument details (all your subscription covers when no symbols are given). Reference data lists currencies, units, price calculation types, incoterms, commodities or sources. The three market data modes read the Fastmarkets Market Data API: latest prices, price history and instruments for exchange and market instruments such as XL-CA-FRC.O.

## `symbols` (type: `array`):

Fastmarkets instrument symbols, one per line, up to 500 a run, sent 25 to a request. Physical Prices symbols look like MB-AL-0012; Market Data symbols look like XL-CA-FRC.O. Required for the price modes; leave empty in an instruments mode to list everything your subscription covers.

## `dates` (type: `array`):

Physical prices only. Optional YYYY-MM-DD dates, one per line. Leave empty for the latest available price.

## `fromDate` (type: `string`):

Physical price history only, required. Start of the range as YYYY-MM-DD, such as 2026-01-01.

## `toDate` (type: `string`):

Physical price history only. End of the range as YYYY-MM-DD. Leave empty for up to the latest price.

## `priceCalculationType` (type: `string`):

Physical prices and history. None returns the assessed value; the others return Fastmarkets' calculated averages where the instrument supports them.

## `averageToDateStrategy` (type: `string`):

Physical prices and history. Whether averages for a period still in progress are returned.

## `calendarType` (type: `string`):

Physical price history only. Optional. Weekdays with carry forward fills days without an assessment.

## `carryForward` (type: `boolean`):

Physical price history only. Carries the last assessed price forward over days without a new one.

## `revisionHistory` (type: `boolean`):

Physical price history only. Adds previous revisions of each price (kept under record).

## `forecastType` (type: `string`):

Physical price history only. Optional. Adds Fastmarkets forecast price points as rows with recordType forecast, where your subscription includes forecasts.

## `fields` (type: `array`):

Physical modes. Optional extra fields, one per line, such as pricingRationale, assessmentPeriod, appraisalPrice, midChangeSincePrevious or midChangeSincePreviousProportion.

## `targetCurrency` (type: `string`):

Physical prices and history. Optional ISO 4217 code, such as USD or EUR, to convert every price at the assessment date rate. Run Reference data with Currency for the supported codes.

## `targetUnitOfMeasure` (type: `string`):

Physical prices and history. Optional unit code, such as Tonne, to convert every price. Run Reference data with UnitOfMeasure for the supported codes.

## `referenceTypes` (type: `array`):

Reference data only. The reference lists to return.

## `marketFields` (type: `array`):

Market data prices and history. The price fields to return, such as bid, mid and ask. Fields an instrument does not define are left out by Fastmarkets.

## `startTime` (type: `string`):

Market data price history only. Optional ISO-8601 date or date-time. Leave empty to count back from now.

## `interval` (type: `string`):

Market data price history only. A span as days:hours:minutes:seconds, such as 30:00:00:00 for 30 days. A negative span with a start time reads back from it. Give this or the count, not both.

## `count` (type: `integer`):

Market data price history only. Optional number of prices instead of an interval. Fastmarkets marks this parameter for removal in a future version.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for.

## `requestsPerMinute` (type: `integer`):

Pacing. A rate limit answer is waited out and retried; a used up allowance ends the run.

## `serviceName` (type: `string`):

Your own Fastmarkets API service name, issued by Fastmarkets with the service key. Stored as a secret. You can instead set the DATA_API_SERVICE_NAME environment secret.

## `apiKey` (type: `string`):

The service key that goes with the service name. The pair is exchanged at auth.fastmarkets.com for an access token, reused for the whole run. You can paste a ready access token here instead and leave the service name empty. Stored as a secret, sent only to Fastmarkets, never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "physicalPrices",
  "symbols": [
    "MB-AL-0012",
    "MB-AL-0003"
  ],
  "priceCalculationType": "None",
  "averageToDateStrategy": "exclude",
  "carryForward": false,
  "revisionHistory": false,
  "referenceTypes": [
    "Commodity"
  ],
  "marketFields": [
    "bid",
    "mid",
    "ask"
  ],
  "interval": "30:00:00:00",
  "maxResults": 100,
  "requestsPerMinute": 60
}
```

# Actor output Schema

## `records` (type: `string`):

One row per record returned for the chosen mode.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "symbols": [
        "MB-AL-0012",
        "MB-AL-0003"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/metals-commodity-prices-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "symbols": [
        "MB-AL-0012",
        "MB-AL-0003",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/metals-commodity-prices-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "symbols": [
    "MB-AL-0012",
    "MB-AL-0003"
  ]
}' |
apify call nabeelbaghoor/metals-commodity-prices-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/metals-commodity-prices-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dxxtxcRd0Zz2jXJJX/builds/t9EvNytSZiSdlgx82/openapi.json
