# Rare Minerals Supply Chain Tracker (`ntriqpro/critical-minerals-supply-monitor`) Actor

Track where critical minerals come from and how supply chains are affected by geopolitical events, sanctions, and disasters.

- **URL**: https://apify.com/ntriqpro/critical-minerals-supply-monitor.md
- **Developed by:** [daehwan kim](https://apify.com/ntriqpro) (community)
- **Categories:** AI, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

$200.00 / 1,000 charged per successful mineral supply chain analys

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

## Critical Minerals Supply Chain Monitor

Monitor critical mineral supply chain risks using USGS, Federal Register, and OECD data. Real-time risk scoring, regulatory compliance tracking, and country dependency analysis.

### Features

#### 1. Mineral Risk Score (`mineral_risk_score`)
Calculate comprehensive risk scores (0-100) for individual minerals:
- **Concentration Index**: Production concentration across top producers
- **Geopolitical Risk**: Country-level political/sanctions risk
- **Substitutability**: Ease of switching to alternative materials
- **Mitigation Strategies**: Actionable recommendations

Supported minerals: Lithium, Cobalt, Nickel, Rare Earth Elements, Copper, Manganese, Tungsten, Vanadium, Graphite, Beryllium, and more.

#### 2. Supply Chain Scan (`supply_chain_scan`)
Batch analyze multiple minerals (or all if empty):
- Risk categorization (CRITICAL / HIGH / MODERATE / LOW)
- Summary statistics and average risk score
- Sorted results by risk level

#### 3. High-Risk Minerals (`high_risk_minerals`)
Quick identification of CRITICAL and HIGH risk minerals:
- Filtered results for immediate attention
- Full analysis data for each high-risk mineral

#### 4. Regulatory Monitor (`regulatory_monitor`)
Track Federal Register documents for critical minerals:
- Real-time regulatory changes
- Filter by department (Commerce, Defense, Interior, EPA)
- Abstract summaries and publication dates
- Direct links to official documents

#### 5. Regulatory Scan (`regulatory_scan`)
Monitor regulations across multiple minerals simultaneously:
- Batch regulatory tracking
- Error handling for unavailable minerals
- Consolidated view of compliance requirements

#### 6. Country Dependency (`country_dependency`)
Analyze mineral production by country:
- List of minerals a country produces
- Estimated global production share
- Geopolitical risk assessment
- Top applications by mineral

#### 7. Compare Countries (`compare_countries`)
Comparative analysis across multiple nations:
- Production concentration metrics
- Risk level comparison
- Top minerals by country
- Supply chain vulnerability assessment

#### 8. Concentration Analysis (`concentration_analysis`)
Deep-dive into supply concentration risk:
- Herfindahl-Hirschman Index (HHI)
- Risk producer identification
- Concentration level classification
- Individual producer risk profiles

### Input Parameters

#### For Single Mineral Analysis
```json
{
  "tool": "mineral_risk_score",
  "mineral": "lithium"
}
````

#### For Batch Mineral Analysis

```json
{
  "tool": "supply_chain_scan",
  "minerals": ["lithium", "cobalt", "nickel"]
}
```

#### For Country Analysis

```json
{
  "tool": "country_dependency",
  "country": "China"
}
```

#### For Regulatory Tracking

```json
{
  "tool": "regulatory_monitor",
  "mineral": "rare-earths"
}
```

### Output Format

All outputs include:

- `success`: Boolean indicating successful analysis
- `timestamp`: ISO 8601 timestamp of analysis
- Tool-specific data fields

Example mineral risk score output:

```json
{
  "success": true,
  "mineral": "Lithium",
  "riskScore": 92,
  "riskLevel": "CRITICAL",
  "analysis": {
    "concentrationIndex": 85,
    "geopoliticalRisk": 45,
    "substitutability": 25,
    "criticalityScore": 92
  },
  "topProducers": ["China", "Australia", "Chile", "Argentina", "Zimbabwe"],
  "uses": ["Batteries", "Ceramics", "Glass", "Pharmaceuticals"],
  "mitigations": [
    "Diversify supply chains away from top 2-3 producers",
    "Invest in recycling and circular economy solutions",
    "Support R&D for substitute materials",
    "Implement supply chain visibility and traceability",
    "Develop long-term contracts with stable suppliers"
  ],
  "timestamp": "2024-03-27T10:30:00.000Z"
}
```

### Data Sources & Attribution

#### USGS Mineral Commodity Summaries

- **Source**: https://minerals.usgs.gov/minerals/pubs/commodity/
- **License**: Public Domain (U.S. Government)
- **Data**: Production statistics, uses, top producers, substitutability
- **Attribution**: U.S. Geological Survey (USGS)

#### Federal Register

- **Source**: https://www.federalregister.gov/api/v1/
- **License**: Public Domain (U.S. Government)
- **Data**: Regulatory documents, policy announcements, compliance notices
- **Attribution**: Federal Register (GPO)

#### OECD Data

- **Source**: https://data-explorer.oecd.org/
- **License**: Creative Commons Attribution 4.0 International (CC BY 4.0)
- **Data**: Economic indicators, trade statistics, policy research
- **Attribution Required**: © OECD. All rights reserved. https://www.oecd.org/

### Pricing

**Pay-per-use model**: $0.05 USD per successful analysis

- One charge per Actor run regardless of tool selected
- No charge for failed runs
- Bulk analysis covered by single charge

### Use Cases

1. **Supply Chain Risk Management**: Monitor dependencies on specific countries
2. **Investment Due Diligence**: Score critical mineral exposure for portfolio companies
3. **Policy Compliance**: Track regulatory changes affecting supply chains
4. **Strategic Sourcing**: Identify alternative suppliers and materials
5. **Geopolitical Intelligence**: Monitor sanctions and supply disruption risks

### Technical Stack

- **Runtime**: Node.js 20
- **Framework**: Apify SDK v3
- **API Clients**: Axios for HTTP requests
- **Deployment**: Docker (Apify Platform)

### Error Handling

- **Timeouts**: 30-second timeout on external API calls with graceful degradation
- **Invalid Inputs**: Clear error messages for missing required parameters
- **API Failures**: Fallback suggestions when Federal Register API unavailable
- **No charge on error**: Failed runs don't incur billing

### Development

```bash
## Install dependencies
npm install

## Run locally
npm start

## Build for Apify
apify push --force
```

### Contributing

Report issues or suggest improvements via Apify Actor forum.

### License

Apache License 2.0

***

**Last Updated**: March 2024
**Version**: 1.0.0

# Actor input Schema

## `tool` (type: `string`):

Select the analysis tool to run

## `mineral` (type: `string`):

Name of a single mineral (required for mineral\_risk\_score and concentration\_analysis)

## `minerals` (type: `array`):

Array of mineral names for batch analysis (required for supply\_chain\_scan, high\_risk\_minerals, regulatory\_scan)

## `country` (type: `string`):

Country name for dependency analysis (required for country\_dependency)

## `countries` (type: `array`):

Array of country names for comparative analysis (required for compare\_countries)

## Actor input object example

```json
{
  "tool": "supply_chain_scan",
  "mineral": "lithium",
  "minerals": [],
  "country": "China",
  "countries": []
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("ntriqpro/critical-minerals-supply-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("ntriqpro/critical-minerals-supply-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 ntriqpro/critical-minerals-supply-monitor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Rare Minerals Supply Chain Tracker",
        "description": "Track where critical minerals come from and how supply chains are affected by geopolitical events, sanctions, and disasters.",
        "version": "1.0",
        "x-build-id": "olbcpVpzAwIdULccm"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ntriqpro~critical-minerals-supply-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ntriqpro-critical-minerals-supply-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/ntriqpro~critical-minerals-supply-monitor/runs": {
            "post": {
                "operationId": "runs-sync-ntriqpro-critical-minerals-supply-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/ntriqpro~critical-minerals-supply-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-ntriqpro-critical-minerals-supply-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",
                "required": [
                    "tool"
                ],
                "properties": {
                    "tool": {
                        "title": "Analysis Tool",
                        "enum": [
                            "mineral_risk_score",
                            "supply_chain_scan",
                            "high_risk_minerals",
                            "regulatory_monitor",
                            "regulatory_scan",
                            "country_dependency",
                            "compare_countries",
                            "concentration_analysis"
                        ],
                        "type": "string",
                        "description": "Select the analysis tool to run",
                        "default": "supply_chain_scan"
                    },
                    "mineral": {
                        "title": "Mineral Name",
                        "type": "string",
                        "description": "Name of a single mineral (required for mineral_risk_score and concentration_analysis)",
                        "default": "lithium"
                    },
                    "minerals": {
                        "title": "Multiple Minerals",
                        "type": "array",
                        "description": "Array of mineral names for batch analysis (required for supply_chain_scan, high_risk_minerals, regulatory_scan)",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "country": {
                        "title": "Country Name",
                        "type": "string",
                        "description": "Country name for dependency analysis (required for country_dependency)",
                        "default": "China"
                    },
                    "countries": {
                        "title": "Multiple Countries",
                        "type": "array",
                        "description": "Array of country names for comparative analysis (required for compare_countries)",
                        "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
