4 min readUpdated Mar 2, 2026

Image Search Documentation

Purpose

The imageSearch logic facilitates the retrieval of news images from the GDELT Visual Global Knowledge Graph (VGKG) based on a user-defined query. It processes the request and delivers image URLs alongside their corresponding source metadata, thus allowing users to leverage visual data effectively for various analytics and reporting purposes.

Settings

The imageSearch logic includes several configurable settings that determine its behavior and output. Below are the settings explained exhaustively:

1. query

2. timespan

3. maxRecords

How It Works

When executed, the imageSearch logic accepts an input object containing user-defined config parameters. The logic performs the following steps:

  1. Configuration Setup: It initializes the searchConfig object, setting up the search parameters using the values from config or inputs, falling back on defaults if necessary.
  2. Validation: It checks if a valid search query has been provided. If not, it returns an error message indicating the absence of the query.
  3. Image Retrieval: The function asynchronously calls getImageCollage with the populated searchConfig object. This integration contacts the GDELT service to fetch relevant images.
  4. Response Formatting: Based on the outcome of the image retrieval, it formats and returns the results:
    • If images are found, it returns them in an array.
    • If no images are found, it returns a default message indicating the absence of images.
    • In case of any errors during the process (e.g., network issues), it captures the error message and returns it.

Expected Data

The imageSearch function expects the following input data:

Use Cases & Examples

Use Case 1: Journalism

A news organization could utilize imageSearch to pull relevant images for recent stories. By querying specific keywords related to ongoing news events, journalists can acquire up-to-date images to enhance their articles.

Use Case 2: Social Media Analysis

A social media analyst might want to visualize the media associated with particular trending topics. By setting the query to these trending topics, they can collect various images for analysis and presentation.

Example Configuration

Scenario: A marketing team wants to analyze images associated with a newly launched product over the past week.

json
{
  "inputs": {
    "query": "New Product Launch",
  },
  "config": {
    "timespan": "1w",
    "maxRecords": 50
  }
}

This configuration enables the marketing team to efficiently analyze relevant imagery surrounding their product launch within a specific timeframe.