# Commodity Price Monitor — Energy, Metals & Agriculture (`lmfamao/commodity-price-monitor`) Actor

Real-time commodity futures prices for 24 major commodities. No API keys required.

- **URL**: https://apify.com/lmfamao/commodity-price-monitor.md
- **Developed by:** [Mao Z](https://apify.com/lmfamao) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Price Monitor — Live Energy, Metals & Agriculture Futures

**Real-time commodity futures prices for 24 major global commodities. No API keys. No browser. Just prices.**

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue?logo=apify)](https://apify.com)

---

### What problem does this solve?

You need commodity prices for trading, analysis, or dashboards. Bloomberg charges $24,000/year per seat. Refinitiv charges $22,000. TradingEconomics starts at $99/month with rate limits. Even free sources require you to build and maintain scrapers yourself.

**This actor gives you clean, structured commodity futures data in one API call. No API keys required. No browser overhead. No maintenance.**

### What you get

One run returns the latest price for every selected commodity, plus daily/weekly/monthly changes and 52-week ranges. 24 commodities across 5 categories:

| Category | Commodities |
|---|---|
| 🔥 **Energy** | WTI Crude, Brent Crude, Natural Gas, Heating Oil, RBOB Gasoline |
| 🥇 **Metals** | Gold, Silver, Copper, Platinum, Palladium |
| 🌾 **Grains** | Corn, Wheat, Soybeans, Soybean Meal, Soybean Oil, Oats |
| ☕ **Softs** | Coffee, Sugar, Cocoa, Cotton, Orange Juice |
| 🐄 **Livestock** | Live Cattle, Feeder Cattle, Lean Hogs |

### Pricing

**$2.00 per 1,000 results** — 98% cheaper than the only comparable actor on Apify Store ($100/1K).

| Run Size | Estimated Cost |
|---|---|
| All 24 commodities (1 run) | ~$0.05 |
| Daily monitoring (30 runs/month) | ~$1.50 |
| Full portfolio + indices + crypto | ~$0.10/run |

### Input

```json
{
  "categories": ["Energy", "Metals"],
  "symbols": []
}
````

| Parameter | Type | Default | Description |
|---|---|---|---|
| `categories` | array | All 5 categories | One or more of: `Energy`, `Metals`, `Grains`, `Softs`, `Livestock` |
| `symbols` | array | Empty | Custom Yahoo Finance tickers. Overrides categories. Example: `["CL=F", "GC=F"]` |

#### Quick examples

**Energy prices only:**

```json
{ "categories": ["Energy"] }
```

**Specific commodities:**

```json
{ "symbols": ["GC=F", "SI=F", "CL=F", "ZC=F"] }
```

**All commodities (default):**

```json
{}
```

### Output

Each commodity returns a single JSON record:

```json
{
  "symbol": "GC=F",
  "commodity": "Gold",
  "category": "Metals",
  "price": 2456.80,
  "currency": "USD",
  "unit": "per troy ounce",
  "change_pct_daily": 0.42,
  "change_pct_weekly": 1.85,
  "change_pct_monthly": 3.20,
  "52w_high": 2520.30,
  "52w_low": 1910.40,
  "exchange": "COMEX",
  "data_source": "Yahoo Finance",
  "timestamp": "2026-07-03 16:30:00"
}
```

### How it works

Pure HTTP. No headless browser. The actor calls Yahoo Finance's public chart API (`query1.finance.yahoo.com/v8/finance/chart/`) for each commodity in parallel. Response parsing is deterministic — every record has the same schema every time. Failures return cleanly with the remaining results.

**Data freshness:** Prices update throughout the trading day. For end-of-day settlement prices, run after 4:30 PM ET.

### Use cases

- **Commodity traders & analysts** — daily mark-to-market without a Bloomberg terminal
- **Hedge funds** — feed prices into risk models and dashboards
- **ETF issuers** — NAV benchmarking for commodity ETFs (USO, GLD, SLV, DBA)
- **Agricultural producers** — track crop prices for hedging decisions
- **Quantitative researchers** — build commodity price datasets for backtesting
- **AI agents & LLMs** — structured commodity data for MCP tools and RAG pipelines
- **Newsletter writers** — automated commodity price updates in daily digests

### Why this actor over alternatives?

| Feature | This Actor | NexGenData | jungle\_synthesizer | ParseForge |
|---|---|---|---|---|
| Price/1K results | **$2** | $100 | Pay-per-event | Per-actor |
| No API keys | ✅ | ✅ | ❌ (EIA+NASS keys) | Varies |
| All commodities | ✅ | ✅ | Energy + Ag only | Fragmented |
| Metals coverage | ✅ | ✅ | ❌ | ✅ (metals only) |
| HTTP-only (fast) | ✅ | ✅ | ✅ | ✅ |

### FAQ

**Q: Do I need a Yahoo Finance API key?**
A: No. This actor uses Yahoo's public chart API — the same one that powers Yahoo Finance's web charts. No authentication required.

**Q: How often can I run this?**
A: Yahoo Finance updates prices in real-time during market hours. For end-of-day data, run once after 4:30 PM ET. For intraday monitoring, run every 5-15 minutes.

**Q: What's the data source?**
A: Yahoo Finance v8 chart API (`query1.finance.yahoo.com`). All prices are front-month futures contract settlement/last prices. Data is for informational purposes — not for trading execution.

**Q: Can I add custom tickers?**
A: Yes. Pass any Yahoo Finance futures ticker (ending in `=F`) via the `symbols` input parameter. The actor will attempt to fetch it.

**Q: What about indices and crypto futures?**
A: Add them via custom symbols: `ES=F` (S\&P 500), `NQ=F` (Nasdaq), `BTC=F` (Bitcoin), `ETH=F` (Ethereum).

### Run via API

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")

run = client.actor("YOUR_USERNAME/commodity-price-monitor").call(run_input={
    "categories": ["Energy", "Metals"],
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
for item in items:
    print(f"{item['commodity']}: ${item['price']} ({item['change_pct_daily']:+.2f}%)")
```

```bash
curl "https://api.apify.com/v2/acts/YOUR_USERNAME~commodity-price-monitor/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"categories": ["Energy", "Metals"]}'
```

### Schedule it

Use Apify Scheduler to run this actor daily, hourly, or on a custom cron schedule. Perfect for:

- Daily commodity price newsletter
- Morning briefing dashboard
- End-of-day NAV calculation
- Live trading desk monitor

***

*Built for traders, analysts, and developers who need commodity prices without the Bloomberg price tag.*

# Actor input Schema

## `categories` (type: `array`):

Which commodity categories to fetch: Energy, Metals, Grains, Softs, Livestock. Omit to fetch all.

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

Specific Yahoo Finance tickers to fetch. Overrides categories. Example: \['CL=F', 'GC=F', 'ZC=F']

## Actor input object example

```json
{
  "categories": [
    "Energy",
    "Metals",
    "Grains",
    "Softs",
    "Livestock"
  ],
  "symbols": []
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("lmfamao/commodity-price-monitor").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("lmfamao/commodity-price-monitor").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call lmfamao/commodity-price-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lmfamao/commodity-price-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Commodity Price Monitor — Energy, Metals & Agriculture",
        "description": "Real-time commodity futures prices for 24 major commodities. No API keys required.",
        "version": "1.0",
        "x-build-id": "xzvtmdX4rTfPIzreH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lmfamao~commodity-price-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lmfamao-commodity-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/lmfamao~commodity-price-monitor/runs": {
            "post": {
                "operationId": "runs-sync-lmfamao-commodity-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/lmfamao~commodity-price-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-lmfamao-commodity-price-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "categories": {
                        "title": "Commodity Categories",
                        "type": "array",
                        "description": "Which commodity categories to fetch: Energy, Metals, Grains, Softs, Livestock. Omit to fetch all.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "Energy",
                            "Metals",
                            "Grains",
                            "Softs",
                            "Livestock"
                        ]
                    },
                    "symbols": {
                        "title": "Custom Symbols",
                        "type": "array",
                        "description": "Specific Yahoo Finance tickers to fetch. Overrides categories. Example: ['CL=F', 'GC=F', 'ZC=F']",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
