6 min readUpdated Mar 2, 2026

gkgSearch Documentation

Overview

The gkgSearch component is designed to query articles from the GDELT Global Knowledge Graph (GKG) based on specified themes and search queries. It allows users to utilize categorized theme presets or enter custom themes, facilitating precise and informed searches within a defined timespan and various parameters.

Purpose

The primary purpose of the gkgSearch component is to retrieve relevant articles from the GDELT database that match specific keywords or theme criteria. This component can be valuable for users needing to analyze media data, conduct research, or gather insights based on global news trends.

Settings

The gkgSearch logic component features several configurable settings, which allow users to tailor their search experience. Below is an exhaustive description of each setting:

1. Theme

2. Query

3. Timespan

4. Max Records

5. Sort

6. Country

7. Language

How it Works

When the gkgSearch function is executed, it orchestrates the following steps:

  1. Input Collection: It collects input values from inputs and config for themes and queries.

  2. Query Construction: A search configuration object (searchConfig) is built by combining the theme, query, and additional parameters such as timespan, max records, sort options, country, and language.

  3. Validation: The function checks if at least one of the theme or query parameters has been provided. If not, it returns an error message prompting the user to supply either a GKG theme or a search query.

  4. Article Retrieval: It calls the searchArticles function using the constructed searchConfig object to fetch relevant articles.

  5. Error Handling: If an error occurs during the API call, the function captures the error message and returns it as part of the output.

  6. Data Output: The output returns either the list of articles that match the search criteria or a default message indicating no results were found.

Use Cases & Examples

Use Cases

  1. Market Research: A business analyst can use this component to gather insights on public sentiment related to a specific product by querying articles containing the product name as a keyword. The articles can help identify trends and consumer feedback.

  2. Event Tracking: Journalists could use the gkgSearch to monitor coverage of significant events, such as a climate change conference, by searching using specific GKG themes related to the event.

  3. Academic Research: Researchers could search for articles on particular themes, like "social media impacts on youth," to support their thesis with relevant literature and case studies.

Example Configuration

Use Case - Monitoring Public Sentiment on a Product Launch

Objective: A company wants to track public response to its new product launch, launching a campaign to measure customer reaction through news articles.

Configuration Data:

json
{
    "inputs": {},
    "config": {
        "theme": "Product Launch",
        "query": "New XYZ Product",
        "timespan": "7d",
        "maxRecords": 100,
        "sort": "datedesc",
        "country": "US",
        "language": "en"
    }
}

Explanation:

By configuring gkgSearch in this manner, the company can effectively gather insights from varied news articles, helping them analyze customer trends and public relations effectively.