Skip to content

Examples Overview

Practical examples demonstrating py-gdelt usage.

Python Examples

Located in examples/ directory:

Core Client

  • basic_client_usage.py - Comprehensive client usage
  • events_endpoint_example.py - Events queries
  • gkg_example.py - GKG data access
  • ngrams_example.py - NGrams queries
  • download_gdelt_files.py - File downloading

REST APIs

  • context_api_example.py - Context API
  • geo_api_example.py - GEO API
  • tv_api_example.py - TV and TVAI APIs

BigQuery

  • query_mentions.py - Mentions via BigQuery
  • bigquery_example.py - General BigQuery usage

Jupyter Notebooks

Located in notebooks/ directory:

  • 01_getting_started.ipynb - Introduction
  • 02_advanced_patterns.ipynb - Production patterns
  • 03_visualization.ipynb - Data visualization

Running Examples

# Python examples
python examples/basic_client_usage.py
python examples/context_api_example.py

# Jupyter notebooks
jupyter lab notebooks/

See Basic Usage and Advanced Patterns for code snippets.