The command-line interface for the GDELT Project — built for agents, optimized for automation.
The GDELT Project monitors news media from nearly every country in 100+ languages, updating every 15 minutes. It's the largest open dataset of global human society, tracking events, sentiment, themes, and entities across the world's news.
Traditional GDELT access requires complex API calls and manual data wrangling. GDELT CLI provides:
- Agent-First Design — Structured JSON output, machine-readable help, predictable exit codes
- Local Analytics — DuckDB-powered queries on downloaded data, no API limits
- Smart Caching — SQLite cache reduces redundant API calls
- MCP Server — Expose GDELT as tools for AI assistants (Claude, etc.)
- Zero Config — Sensible defaults, works out of the box
# One-line install (downloads binary or builds from source)
curl -fsSL https://raw.githubusercontent.com/neul-labs/gdelt-cli/main/install.sh | bash
# Or with Cargo
cargo install --git https://github.com/neul-labs/gdelt-cli
# Or build locally
git clone https://github.com/neul-labs/gdelt-cli
cd gdelt-cli
cargo build --release# Search recent news
gdelt doc search "climate change" --max-records 10
# Get geographic data for events
gdelt geo search "protests" --timespan 7d
# Download and sync local data
gdelt data sync --days 7
# Query local events database
gdelt events query --country US --start 2024-01-01
# Get machine-readable help
gdelt --help-jsonGDELT CLI is designed for programmatic use by AI agents, scripts, and automation pipelines.
All commands support multiple output formats:
gdelt doc search "elections" -o json # JSON (default for pipes)
gdelt doc search "elections" -o jsonl # JSON Lines (streaming)
gdelt doc search "elections" -o csv # CSV
gdelt doc search "elections" -o table # Human-readable table# Get complete command schema as JSON
gdelt --help-json
# Get schema for a specific command
gdelt schema command doc.search
# List all available tools (MCP-compatible)
gdelt schema tools| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Validation error |
| 3 | Network error |
| 4 | API error |
| 5 | Rate limited |
| 10 | Database error |
| 11 | Cache error |
| 20 | Not found |
GDELT_OUTPUT=json # Default output format
GDELT_QUIET=1 # Suppress non-essential output
GDELT_NO_CACHE=1 # Bypass cache
GDELT_TIMEOUT=60 # Request timeout in seconds# Full-text search
gdelt doc search "artificial intelligence"
# With filters
gdelt doc search "AI" \
--timespan 7d \
--country US \
--lang english \
--tone-min -5 --tone-max 5 \
--max-records 100
# Timeline analysis
gdelt doc timeline "bitcoin" --mode tone --timespan 30d
# Word cloud data
gdelt doc wordcloud "cryptocurrency" --timespan 24h# Point data for mapping
gdelt geo search "earthquake" --format point
# Heatmap data
gdelt geo search "protests" --format heatmap --timespan 7d# Search TV clips
gdelt tv search "president" --timespan 24h
# Station coverage
gdelt tv stations --country US# Download historical data
gdelt data download --start 2024-01-01 --end 2024-01-31 --type events
# Sync latest updates
gdelt data sync
# Query local events
gdelt events query \
--actor USA \
--event-code 14* \
--goldstein-min -10 \
--limit 100
# Query GKG (Global Knowledge Graph)
gdelt gkg query --theme POLITICS --person "Biden"
# Trend analysis
gdelt analytics trends "Ukraine" --granularity day --days 90
# Entity extraction
gdelt analytics entities --type person --min-count 10
# Sentiment analysis
gdelt analytics sentiment "elections" --by region# View statistics
gdelt db stats
# Export data
gdelt db export events --format parquet --output events.parquet
# Run custom SQL
gdelt db query "SELECT COUNT(*) FROM events WHERE quad_class = 4"
# Optimize database
gdelt db vacuumGDELT CLI can run as an MCP (Model Context Protocol) server, exposing GDELT data as tools for AI assistants.
# Start MCP server (stdio transport)
gdelt serve
# With configuration
gdelt serve --port 8080When running as an MCP server, the following tools are exposed:
gdelt_search— Search news articlesgdelt_timeline— Get volume/tone over timegdelt_geo— Geographic event datagdelt_events_query— Query local events databasegdelt_gkg_query— Query Global Knowledge Graphgdelt_analytics— Run trend/sentiment analysis
Add to ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"gdelt": {
"command": "gdelt",
"args": ["serve"]
}
}
}Run GDELT sync as a background service:
# Start daemon
gdelt daemon start --sync --mcp
# Check status
gdelt daemon status
# View logs
gdelt daemon logs --tail 100
# Stop daemon
gdelt daemon stop
# Install as system service
gdelt daemon install --systemd # Linux
gdelt daemon install --launchd # macOSGenerate diplomatic intelligence briefings for any country using the gdelt-briefing.sh script. This leverages Claude Code with GDELT data to produce comprehensive country briefings.
# Basic usage - country name required
./gdelt-briefing.sh <country> [capital]
# Examples
./gdelt-briefing.sh Indonesia Jakarta
./gdelt-briefing.sh Ukraine Kyiv
./gdelt-briefing.sh BrazilBriefings are saved to briefings/<country>/ in the project directory.
- Claude Code CLI (
claude) must be installed and configured - The
/briefingskill must be available
Configuration file: ~/.config/gdelt/config.toml
[general]
default_format = "json"
timezone = "UTC"
[network]
timeout_secs = 30
retries = 3
rate_limit_rps = 5.0
[cache]
enabled = true
max_size_mb = 500
[cache.ttl]
doc_search = "1h"
geo = "24h"
[database]
memory_limit = "2GB"
[defaults.doc]
timespan = "24h"
max_records = 75
sort = "hybrid-rel"| Directory | Contents |
|---|---|
~/.local/share/gdelt/ |
DuckDB database, downloaded files |
~/.cache/gdelt/ |
API response cache (SQLite) |
~/.config/gdelt/ |
Configuration files |
# Clone repository
git clone https://github.com/neul-labs/gdelt-cli
cd gdelt-cli
# Build debug
cargo build
# Build release
cargo build --release
# Run tests
cargo test
# Build with MCP support
cargo build --release --features mcpsrc/
├── api/ # GDELT API clients (DOC, GEO, TV)
├── analytics/ # Trend, sentiment, entity analysis
├── cli/ # Command definitions and handlers
├── config/ # Configuration schema
├── daemon/ # Background sync service
├── data/ # Download and import logic
├── db/ # DuckDB and SQLite interfaces
├── mcp/ # MCP server implementation
├── models/ # Data models and CAMEO codes
└── error/ # Error types and exit codes
# All tests
cargo test
# With output
cargo test -- --nocapture
# Specific test
cargo test test_validate_dateGDELT uses CAMEO (Conflict and Mediation Event Observations) codes. Quick reference:
| Code | Category | Goldstein |
|---|---|---|
| 01 | Make public statement | 0.0 |
| 02 | Appeal | 3.0 |
| 03 | Express intent to cooperate | 4.0 |
| 04 | Consult | 1.0 |
| 05 | Diplomatic cooperation | 3.5 |
| 06 | Material cooperation | 6.0 |
| 07 | Provide aid | 7.0 |
| 08 | Yield | 5.0 |
| 09 | Investigate | -0.5 |
| 10 | Demand | -5.0 |
| 11 | Disapprove | -2.0 |
| 12 | Reject | -4.0 |
| 13 | Threaten | -7.0 |
| 14 | Protest | -6.5 |
| 15 | Exhibit force posture | -7.5 |
| 16 | Reduce relations | -6.0 |
| 17 | Coerce | -7.0 |
| 18 | Assault | -9.0 |
| 19 | Fight | -10.0 |
| 20 | Mass violence | -10.0 |
# List all codes
gdelt events codes list
# Search codes
gdelt events codes search "protest"
# Describe a code
gdelt events codes describe 14MIT License — see LICENSE for details.