5 min readUpdated Mar 2, 2026

trendTimeline Documentation

Purpose

The trendTimeline logic is designed to retrieve and present timeline data regarding the volume, tone, and geographical distribution of specific queries using the GDELT (Global Database of Events, Language, and Tone) DOC 2.0 API. It allows users to analyze trends over a specified timespan, providing insights into event patterns and sentiment expressed in the media, based on their search criteria.

Settings

The trendTimeline logic consists of several configurable settings that dictate its behavior and influence its output. Each setting is detailed below:

1. query

2. timespan

3. timelineMode

4. smoothing

5. country

6. theme

7. language

How It Works

The trendTimeline logic operates by utilizing the GDELT DOC 2.0 API to fetch relevant timeline data based on user-defined parameters. When the logic is executed:

  1. The settings are configured from the provided config object or from the inputs object if the configuration is missing.
  2. The code checks if a query has been supplied; if not, it returns an error indicating that no search query was provided.
  3. Assuming a valid query is present, it calls the getTimeline function with the compiled configuration settings to fetch the relevant data.
  4. The response is processed; if data is found, it returns the timeline data. If no data is returned, it provides a default response with a date, value of 0, and an empty series.
  5. If an error occurs during the data retrieval, it returns an error message as part of the output.

Use Cases & Examples

Use Case 1: Monitoring Brand Sentiment

A marketing team wants to monitor the sentiment related to their brand over the past month on social media. By using the trendTimeline, they can analyze how their marketing campaigns are impacting public perception over time.

Use Case 2: Event Analysis for Crisis Management

Government officials need to analyze the volume of reports related to a crisis event (like a natural disaster) to understand media coverage and public response. The trendTimeline can be configured to focus on volume data for a specific geographical area.

Use Case 3: Research in Media Studies

Academics studying media trends can leverage the trendTimeline to investigate how coverage of specific topics changes over time, taking into consideration different tones and how they vary by country.

Detailed Example Configuration:

For the second use case, here’s how the trendTimeline might be configured:

json
{
    "query": "hurricane",
    "timespan": "30d",
    "timelineMode": "volume",
    "smoothing": 1,
    "country": "US",
    "theme": "dark",
    "language": "en"
}

In this configuration, the trendTimeline will retrieve the last 30 days' worth of media volume data concerning hurricanes in the United States.

Additional Considerations

This structured documentation will assist users in effectively implementing and utilizing the trendTimeline component to derive actionable insights from media data.