# Geopolitical Risk Tracker - Country Tension Score (`ntriqpro/geopolitical-tension-monitor`) Actor

Monitor political tensions, conflicts, and international disputes between countries. Plan business activities safely.

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

## Pricing

$200.00 / 1,000 geopolitical tension queries

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

## Geopolitical Tension Monitor

Real-time geopolitical risk assessment combining news intelligence, governance indicators, travel advisories, trade data, and sanctions information.

### What This Does

Analyzes any country's geopolitical risk by aggregating 5 authoritative public data sources:
- **GDELT Project**: Real-time news event data with sentiment analysis
- **US State Department**: Official travel advisory levels
- **World Bank WGI**: Governance indicators (political stability, voice & accountability, regulatory quality)
- **UN Comtrade**: International trade flow data
- **US Treasury OFAC**: Active sanctions and entity lists

Returns a **composite tension score (0-100)** where:
- **0-25**: Low tension (stable, low risk)
- **25-50**: Moderate tension (elevated caution recommended)
- **50-75**: High tension (significant concerns)
- **75-100**: Critical tension (extreme risk, active conflict/sanctions)

### Input

```json
{
  "countryCode": "UA"
}
````

- `countryCode` (required): Two-letter ISO country code (e.g., "UA" = Ukraine, "RU" = Russia, "TW" = Taiwan, "SG" = Singapore, "US" = United States)

### Output

```json
{
  "query": { "countryCode": "UA" },
  "gdelt": {
    "newsCount30d": 8420,
    "avgTone": -4.2,
    "topHeadlines": [
      {
        "date": "2026-04-08",
        "sourceUrl": "https://...",
        "tone": -6.5
      },
      ...
    ]
  },
  "stateDept": {
    "advisoryLevel": 4,
    "levelLabel": "Do Not Travel"
  },
  "worldBankWGI": {
    "politicalStability": -2.1,
    "voiceAccountability": 0.2,
    "regulatoryQuality": 0.5
  },
  "comtrade": {
    "totalExportsUsd": 41230000000,
    "yoyChange": -15.2
  },
  "ofac": {
    "activeSanctionsPrograms": 1,
    "sdnEntityCount": 1240
  },
  "tensionScore": 87,
  "sources": [
    "The GDELT Project (CC-BY 4.0)",
    "US Department of State (Public Domain)",
    "The World Bank WGI (CC-BY 4.0)",
    "UN Comtrade (CC-BY 3.0 IGO)",
    "US Treasury OFAC (Public Domain)"
  ],
  "disclaimer": "..."
}
```

### How The Tension Score Works

Weighted formula combining 5 indicators:

| Indicator | Weight | Interpretation |
|-----------|--------|-----------------|
| GDELT Average Tone | 30% | Negative sentiment = higher tension |
| Political Stability Index | 30% | Lower stability = higher tension |
| State Dept Advisory Level | 20% | Higher level (1-4) = higher tension |
| Trade YoY Change | 10% | Declining exports = higher tension (economic shock) |
| OFAC Sanctions Count | 10% | Active programs = higher tension |

**Example:**

- Ukraine (high conflict): GDELT tone -5.2, advisory level 4, PS index -2.0 → Score 87/100
- Singapore (stable): GDELT tone +1.2, advisory level 1, PS index +1.8 → Score 12/100

### Data Sources & Attribution

All data is from publicly available sources:

1. **GDELT Project** (CC-BY 4.0)
   - Real-time global news event database
   - Covers 65+ languages, 200+ countries
   - Updated continuously, 30-day rolling window

2. **US Department of State Travel Advisories** (Public Domain, 17 U.S.C. § 105)
   - Official travel warnings and guidance
   - Levels: 1 (Normal), 2 (Increased Caution), 3 (Reconsider), 4 (Do Not Travel)

3. **World Bank Worldwide Governance Indicators** (CC-BY 4.0)
   - Institutional quality and governance measures
   - Covers 200+ countries annually
   - Indicators: Political Stability, Voice & Accountability, Regulatory Quality

4. **UN Comtrade** (CC-BY 3.0 IGO)
   - International merchandise trade statistics
   - 200+ countries, monthly updates

5. **US Treasury OFAC Sanctions List** (Public Domain)
   - Active sanctions programs
   - Specially Designated Nationals (SDN) list
   - Updated daily

### Legal Disclaimer

**⚠️ NOT geopolitical advice, travel advice, or investment guidance.** This Actor provides historical data aggregation and analysis only.

- Does NOT predict conflicts, wars, or political events
- Does NOT recommend travel, trading, or investment decisions
- Does NOT replace official government travel warnings or diplomatic advisories
- Does NOT constitute legal, political, or risk management advice
- For active emergencies, consult: [travel.state.gov](https://travel.state.gov)
- Historical data does not predict future developments

### Example Queries

#### High-Tension Country

```bash
apify call --input='{"countryCode":"UA"}'
## Expected score: 80-95 (active conflict)
```

#### Moderate-Tension Country

```bash
apify call --input='{"countryCode":"MX"}'
## Expected score: 40-60 (cartel activity, regional instability)
```

#### Stable Country

```bash
apify call --input='{"countryCode":"SG"}'
## Expected score: 5-20 (high stability, regional hub)
```

### Pricing

- **$0.20 USD per query** (20% to Apify platform, 80% to developer)
- Billed only on successful queries
- No charge on API errors

### API Integration

```bash
curl -X POST "https://api.apify.com/v2/acts/{actor-id}/runs" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "countryCode": "UA"
    }
  }'
```

### Performance Notes

- First query: ~3-5 seconds (cold start)
- Subsequent queries: ~1-2 seconds
- Timeout: 30 seconds per run
- Rate limit: Governed by Apify platform

### Supported Countries

Actor supports all 2-letter ISO country codes. Common geopolitical interest countries:

**High-Risk**: RU, IR, KP, SY, CU, VE, ZW, BY, MM
**Moderate-Risk**: UA, PS, LB, YE, SO, MX, CO, TH, CN
**Stable**: US, GB, FR, DE, CA, AU, NZ, SG, JP, KR, TW

See full list: [ISO 3166-1 alpha-2 codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)

### Updates & Maintenance

- GDELT data: Real-time (updated continuously)
- World Bank WGI: Annual (latest year available)
- State Dept advisories: Manual updates from official source
- OFAC list: Daily from US Treasury
- Comtrade: Monthly updates with ~2 month lag

### Support

For issues or questions:

- Documentation: See this README
- Data attribution: See "Data Sources & Attribution" section
- Terms of Use: Apify Platform ToS + individual data source licenses (all CC-BY or Public Domain)

***

**Version:** 1.0\
**Last Updated:** 2026-04-08\
**Developer:** NtriqPRO\
**License:** ISC (source code), CC-BY 4.0 + Public Domain (data)

# Actor input Schema

## `countryCode` (type: `string`):

Two-letter ISO country code (e.g., 'UA' for Ukraine, 'RU' for Russia, 'TW' for Taiwan, 'SG' for Singapore). Required.

## Actor input object example

```json
{
  "countryCode": "UA"
}
```

# 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 = {
    "countryCode": "UA"
};

// Run the Actor and wait for it to finish
const run = await client.actor("ntriqpro/geopolitical-tension-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 = { "countryCode": "UA" }

# Run the Actor and wait for it to finish
run = client.actor("ntriqpro/geopolitical-tension-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 '{
  "countryCode": "UA"
}' |
apify call ntriqpro/geopolitical-tension-monitor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Geopolitical Risk Tracker - Country Tension Score",
        "description": "Monitor political tensions, conflicts, and international disputes between countries. Plan business activities safely.",
        "version": "1.0",
        "x-build-id": "VCBJz1CSuFfVOaFmV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/ntriqpro~geopolitical-tension-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-ntriqpro-geopolitical-tension-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~geopolitical-tension-monitor/runs": {
            "post": {
                "operationId": "runs-sync-ntriqpro-geopolitical-tension-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~geopolitical-tension-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-ntriqpro-geopolitical-tension-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": [
                    "countryCode"
                ],
                "properties": {
                    "countryCode": {
                        "title": "Country Code (ISO 2-letter)",
                        "type": "string",
                        "description": "Two-letter ISO country code (e.g., 'UA' for Ukraine, 'RU' for Russia, 'TW' for Taiwan, 'SG' for Singapore). Required."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
