# USGS Mineral Commodity Summaries Scraper (`jungle_synthesizer/usgs-mineral-commodity-summaries-scraper`) Actor

Scrape production, reserves, import-reliance, and pricing data from the USGS Mineral Commodity Summaries — the authoritative annual source for ~85 minerals including lithium, cobalt, rare earths, and graphite. Returns normalised long-format rows from official USGS ScienceBase data-release ZIPs.

- **URL**: https://apify.com/jungle\_synthesizer/usgs-mineral-commodity-summaries-scraper.md
- **Developed by:** [BowTiedRaccoon](https://apify.com/jungle_synthesizer) (community)
- **Categories:** Business, Other
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 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

## USGS Mineral Commodity Summaries Scraper

Scrapes structured production, reserves, import-reliance, and pricing data from the
[USGS Mineral Commodity Summaries](https://www.usgs.gov/centers/national-minerals-information-center/mineral-commodity-summaries) —
the authoritative annual dataset covering ~85 critical and nonfuel minerals including
lithium, cobalt, rare earth elements, graphite, nickel, and more.

Data is sourced directly from USGS ScienceBase data-release ZIPs and output as
normalised long-format rows with commodity, year, metric, value, and unit.

### What you get

Each row represents one **commodity + year + metric** observation. Salient rows
contain US-centric statistics; World rows add country-level production and reserves.

**Output fields:**

| Field | Description |
|---|---|
| `commodity` | Commodity name (e.g. "Lithium", "Cobalt", "Rare Earths") |
| `commodity_code` | USGS 5-letter code from filename (e.g. "lithi", "cobal", "rareee") |
| `year` | Data year |
| `metric` | Metric column name (e.g. "USprod_t", "Imports_t", "Price_dt", "NIR_pct") |
| `value` | Metric value as string — preserves qualifiers like ">50", "W" (withheld), "E" (estimated) |
| `unit` | Unit derived from metric suffix (metric tonnes, $/tonne, %, $/kg, count) |
| `country` | Country for world-production rows; blank for US salient rows |
| `estimate_flag` | USGS qualifier (E=estimated, W=withheld, NA=not available) |
| `mcs_year` | MCS annual release year (e.g. 2025) |
| `source_zip` | Dataset origin: `Salient_Commodity_Data` or `World_Data` |
| `metadata_abstract` | Commodity definition from FGDC XML metadata (salient rows only) |

### Key use cases

- **Supply-chain risk analysis** — track US net import reliance for critical minerals
- **Investor research** — historical production, price, and reserve trends for lithium, cobalt, REEs
- **Policy briefings** — world production by country for strategic materials
- **ESG / compliance** — identify dependency on concentrated mineral supply chains

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `maxItems` | integer | all | Maximum records to return |
| `commodity` | string | all | Comma-separated filter (e.g. "lithium,cobalt,rare earths") |
| `source_zip` | select | `all` | `all`, `salient` (US stats), or `world` (country production/reserves) |
| `mcs_year` | integer | `2025` | Which MCS annual release to fetch |

### Example output — salient row (lithium, US imports)

```json
{
  "commodity": "Lithium",
  "commodity_code": "lithium",
  "year": 2024,
  "metric": "Imports_t",
  "value": "3430",
  "unit": "metric tonnes",
  "country": "",
  "estimate_flag": "",
  "mcs_year": 2025,
  "source_zip": "Salient_Commodity_Data",
  "metadata_abstract": "This data release contains the U.S. salient statistics and world production data extracted from the LITHIUM data sheet of the USGS Mineral Commodity Summaries 2025."
}
````

### Example output — world row (lithium reserves by country)

```json
{
  "commodity": "Lithium",
  "commodity_code": "",
  "year": 2024,
  "metric": "Mine production, lithium content_reserves_2024",
  "value": "1800000",
  "unit": "metric tons",
  "country": "United States",
  "estimate_flag": "",
  "mcs_year": 2025,
  "source_zip": "World_Data",
  "metadata_abstract": ""
}
```

### Data coverage

- **~85 commodities** including all US-designated critical minerals
- **5 years of salient data** per commodity (typically 2020–2024)
- **1,250+ world production/reserve rows** across dozens of countries per commodity
- **Annual update cadence** — new MCS release typically published each January

### Technical notes

- No proxy required — USGS ScienceBase is a US government open-data portal
- Downloads ZIPs in-memory; typical run completes in under 30 seconds
- Memory: 512 MB

### Data source

[USGS Mineral Commodity Summaries 2025 Data Release](https://www.sciencebase.gov/catalog/item/677eaf95d34e760b392c4970)
Published by the USGS National Minerals Information Center.

# Actor input Schema

## `sp_intended_usage` (type: `string`):

Please describe how you plan to use the data extracted by this crawler.

## `sp_improvement_suggestions` (type: `string`):

Provide any feedback or suggestions for improvements.

## `sp_contact` (type: `string`):

Provide your email address so we can get in touch with you.

## `maxItems` (type: `integer`):

Maximum number of records to return. Leave blank to return all records.

## `commodity` (type: `string`):

Comma-separated list of commodity names or codes to filter (e.g. "lithium,cobalt,rare earths"). Leave blank for all ~85 commodities.

## `source_zip` (type: `string`):

Which USGS data-release ZIP(s) to process: "salient" (US production/imports/ exports/price/NIR per commodity), "world" (world production and reserves by country), or "all" (both). Default is "all".

## `mcs_year` (type: `integer`):

Which annual MCS release to fetch (e.g. 2025). Defaults to the latest available release (2025). Future releases will be auto-detected from the ScienceBase catalog.

## Actor input object example

```json
{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 15,
  "commodity": "lithium,cobalt",
  "source_zip": "all",
  "mcs_year": 2025
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 15,
    "commodity": "lithium,cobalt",
    "source_zip": "all",
    "mcs_year": 2025
};

// Run the Actor and wait for it to finish
const run = await client.actor("jungle_synthesizer/usgs-mineral-commodity-summaries-scraper").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 = {
    "sp_intended_usage": "Describe your intended use...",
    "sp_improvement_suggestions": "Share your suggestions here...",
    "sp_contact": "Share your email here...",
    "maxItems": 15,
    "commodity": "lithium,cobalt",
    "source_zip": "all",
    "mcs_year": 2025,
}

# Run the Actor and wait for it to finish
run = client.actor("jungle_synthesizer/usgs-mineral-commodity-summaries-scraper").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 '{
  "sp_intended_usage": "Describe your intended use...",
  "sp_improvement_suggestions": "Share your suggestions here...",
  "sp_contact": "Share your email here...",
  "maxItems": 15,
  "commodity": "lithium,cobalt",
  "source_zip": "all",
  "mcs_year": 2025
}' |
apify call jungle_synthesizer/usgs-mineral-commodity-summaries-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=jungle_synthesizer/usgs-mineral-commodity-summaries-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "USGS Mineral Commodity Summaries Scraper",
        "description": "Scrape production, reserves, import-reliance, and pricing data from the USGS Mineral Commodity Summaries — the authoritative annual source for ~85 minerals including lithium, cobalt, rare earths, and graphite. Returns normalised long-format rows from official USGS ScienceBase data-release ZIPs.\n",
        "version": "0.1",
        "x-build-id": "z0yL3pRjXqCy2ndLR"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/jungle_synthesizer~usgs-mineral-commodity-summaries-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-jungle_synthesizer-usgs-mineral-commodity-summaries-scraper",
                "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/jungle_synthesizer~usgs-mineral-commodity-summaries-scraper/runs": {
            "post": {
                "operationId": "runs-sync-jungle_synthesizer-usgs-mineral-commodity-summaries-scraper",
                "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/jungle_synthesizer~usgs-mineral-commodity-summaries-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-jungle_synthesizer-usgs-mineral-commodity-summaries-scraper",
                "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",
                "required": [
                    "maxItems"
                ],
                "properties": {
                    "sp_intended_usage": {
                        "title": "What is the intended usage of this data?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Please describe how you plan to use the data extracted by this crawler."
                    },
                    "sp_improvement_suggestions": {
                        "title": "How can we improve this crawler for you?",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide any feedback or suggestions for improvements."
                    },
                    "sp_contact": {
                        "title": "Contact Email",
                        "minLength": 1,
                        "type": "string",
                        "description": "Provide your email address so we can get in touch with you."
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "type": "integer",
                        "description": "Maximum number of records to return. Leave blank to return all records."
                    },
                    "commodity": {
                        "title": "Commodity Filter",
                        "type": "string",
                        "description": "Comma-separated list of commodity names or codes to filter (e.g. \"lithium,cobalt,rare earths\"). Leave blank for all ~85 commodities.\n"
                    },
                    "source_zip": {
                        "title": "Source ZIP",
                        "enum": [
                            "all",
                            "salient",
                            "world"
                        ],
                        "type": "string",
                        "description": "Which USGS data-release ZIP(s) to process: \"salient\" (US production/imports/ exports/price/NIR per commodity), \"world\" (world production and reserves by country), or \"all\" (both). Default is \"all\".\n"
                    },
                    "mcs_year": {
                        "title": "MCS Year",
                        "type": "integer",
                        "description": "Which annual MCS release to fetch (e.g. 2025). Defaults to the latest available release (2025). Future releases will be auto-detected from the ScienceBase catalog.\n"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
