# Commodity Futures Prices: Gold, Oil, Grains and Rates (`scrapemint/commodity-futures-settlements`) Actor

Official daily futures settlement prices, keyless. Every contract month with open, high, low, settle, change, volume and open interest, or a one row summary per product with the front month and whether the curve is in contango or backwardation. Metals, energy, grains, index, rates and FX.

- **URL**: https://apify.com/scrapemint/commodity-futures-settlements.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, News
- **Stats:** 4 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 settlement rows

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Commodity Futures Prices: Gold, Oil, Grains and Rates

The settlement price is the number the futures market is marked to. Margin, options, indices and hedge accounting all reference it, and the exchange publishes one per contract per day.

This reads that official settlement report directly, keyless, so the prices are the exchange's own rather than a delayed quote scraped off a chart.

### What you get

**Curve mode** returns one row per contract month, which is the whole term structure:

| Field | Meaning |
| --- | --- |
| `product`, `productCode`, `exchange` | Gold, GC, COMEX |
| `contractMonth`, `isFrontMonth`, `isLeadMonth` | Which expiry, and whether it is the nearest or the one carrying the open interest |
| `open`, `high`, `low`, `last`, `lastPriceFlag` | The day's trade, with the bid or ask indicator kept separate from the price |
| `settle`, `change`, `changePercent`, `priorSettle` | The official settlement and the move |
| `volume`, `openInterest` | Activity and positions held |
| `spreadToFrontMonth` | What a roll or calendar spread prices off |
| `tradeDate`, `reportType`, `updateTime` | Which report, and whether it is preliminary or final |

**Summary mode** returns one row per product: the front month, the lead month, the day's total volume and open interest, how many contracts are listed and how many carry open interest, and whether the curve is in `contango` or `backwardation` with the front-to-back spread.

**Products mode** returns the exchange's product list ranked by open interest, for finding the code of anything outside the built-in map.

### Products

Codes work directly: `GC`, `SI`, `HG`, `PL`, `PA`, `CL`, `BZ`, `NG`, `RB`, `HO`, `ZC`, `ZW`, `KE`, `ZS`, `ZM`, `ZL`, `LE`, `HE`, `ES`, `NQ`, `YM`, `RTY`, `ZT`, `ZF`, `ZN`, `ZB`, `SR3`, `6E`, `6J`, `6B`, `6A`, `6C`, `6S`, `6M`.

Plain words work too: `gold`, `oil`, `brent`, `natural gas`, `wheat`, `soybeans`, `nasdaq`, `sofr`. So does a numeric product id from products mode.

This covers CME, CBOT, NYMEX and COMEX. Cotton, coffee, sugar and cocoa are listed at ICE, a different exchange, and are not available here.

### Example input

```json
{
  "mode": "curve",
  "products": ["GC", "CL", "NG"],
  "monthsPerProduct": 12
}
```

A daily dashboard across markets:

```json
{
  "mode": "summary",
  "products": ["gold", "oil", "natural gas", "corn", "ES", "ZN", "6E"]
}
```

### Three things worth knowing

**The nearest month is often not the traded one.** On a recent day gold's front month settled on 36 lots while the month behind it traded 135,087. Every row therefore carries both `isFrontMonth` and `isLeadMonth`, and summary rows report the front month and the lead month side by side, so a headline price is never taken from an expiring contract nobody holds.

**Settlements are published after the close.** Leave `tradeDate` empty and the actor walks back to the most recent day that actually has data, so a run during the session, at a weekend or on a holiday returns the last published report rather than nothing. The date used is on every row.

**A dash is not a zero.** Deferred months routinely have no open, high, low or last, but still carry a real settlement price. Those fields come back null rather than 0, and the report's own `Total` line is used for the day's totals rather than being emitted as if it were a contract month.

### Pricing

Pay per settlement row, `$0.004`. The first 2 rows of every run are free. Unknown products, dates with no report, and every note row are never charged.

Each product costs one request, so a summary across ten markets is ten requests and a few seconds.

### Related actors

- **CFTC Commitments of Traders (COT) Tracker** for who holds these futures positions
- **Crypto Futures vs Spot: Premium by Expiry and Annual Yield** for the same curve idea on crypto
- **World Economic Indicators Scraper: GDP, Inflation & More** and **US Treasury Rates** for the macro backdrop

# Actor input Schema

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

curve = one row per contract month, the full term structure. summary = one row per product with the front month and the curve shape. products = the exchange product list, for finding a code.

## `products` (type: `array`):

Codes such as GC, SI, HG, CL, BZ, NG, RB, ZC, ZW, ZS, LE, HE, ES, NQ, YM, RTY, ZT, ZF, ZN, ZB, SR3, 6E, 6J, 6B. Plain words work too, e.g. gold, oil, wheat, nasdaq. A numeric exchange product id also works.

## `tradeDate` (type: `string`):

YYYY-MM-DD. Leave empty for the most recent day with published settlements. Settlements appear after the close, so an empty value during the session returns the previous day.

## `monthsPerProduct` (type: `integer`):

Curve mode. How far down the curve to return, counting from the front month. Gold lists over thirty months, most of them untraded.

## `minOpenInterest` (type: `integer`):

Curve mode. Drop contract months nobody holds, which removes the long tail of deferred months quoted but never traded. 0 keeps everything.

## `maxRows` (type: `integer`):

Cap on rows returned across all products. Controls total cost.

## Actor input object example

```json
{
  "mode": "curve",
  "products": [
    "GC",
    "CL",
    "NG"
  ],
  "tradeDate": "",
  "monthsPerProduct": 12,
  "minOpenInterest": 0,
  "maxRows": 200
}
```

# 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 = {
    "products": [
        "GC",
        "CL",
        "NG"
    ],
    "monthsPerProduct": 12
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/commodity-futures-settlements").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 = {
    "products": [
        "GC",
        "CL",
        "NG",
    ],
    "monthsPerProduct": 12,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/commodity-futures-settlements").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 '{
  "products": [
    "GC",
    "CL",
    "NG"
  ],
  "monthsPerProduct": 12
}' |
apify call scrapemint/commodity-futures-settlements --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapemint/commodity-futures-settlements"
        }
    }
}

```

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/gafqhU1Ook56OOVYc/builds/gYKSbQxeaUPMeaR8E/openapi.json
