# Changelog of GDELT News Search: Global Articles by Keyword, Site, Country (`fecklesspleb/gdelt-news-search`) Actor

- **URL**: https://apify.com/fecklesspleb/gdelt-news-search/changelog.md
- **Full Actor documentation**: https://apify.com/fecklesspleb/gdelt-news-search.md

## Changelog

### 2026-11-13: 0.2.3 r9 (wording only)

- README, actor.json `description` and input-schema text: dropped "monitoring" / "monitors" (Lex: no recall-alert, monitoring or "official" pitches). README now says "Use it for PR tracking and research...". actor.json description says "Only-new mode." (was "Only-new mode for monitoring."). Input `onlyNew` says "For scheduled runs..."; `stateKey` says "several scheduled runs can run side by side."
- The r8 CHANGELOG bullet is corrected to match the code (no code change): when both the DOC API and the files were used, the status row's `source` is the DOC API URL and the files URL joined by " and " (`https://api.gdeltproject.org/api/v2/doc/doc and https://data.gdeltproject.org/gdeltv3/gal/`). Only invalid input (nothing requested) has no `source` field. The r8 HANDOFF already stated this correctly.
- tests/test_package.py: the README wording assertion now matches the sentence without "monitoring".
- Version stays 0.2.3. No code, pricing, schema-shape or behaviour change.

### 2026-11-13: 0.2.3 r8 (Lex's optional fixes)

- README: `sourceCountry` now reads "Outlet's country as assigned by GDELT (by domain suffix, main country covered, or registration)". The sources paragraph links GDELT's "Mapping the Media" post for the 2018 outlet list and adds that titles and image links come from the publishers' pages, and that GDELT's terms cover GDELT's data, not publishers' rights in headlines or images.
- Status rows now cite the source actually used: the DOC 2.0 API citation with `source` set to the DOC API URL when only the DOC API was used; the GDELT Article List citation with `source` set to the files URL in fallback "only" mode; a neutral GDELT citation with `source` set to the DOC API URL and the files URL (joined by " and ") when both were used; and a neutral GDELT citation with no `source` field when the input was invalid (nothing was requested). RUN_SUMMARY `legalNote` follows the same rule. Item rows are unchanged.

### 2026-11-13: 0.2.3 (r7, raw-file fallback)

- New raw-file fallback (my_actor/fallback.py, input `fallback`, default `auto`). When the DOC 2.0 API keeps answering HTTP 429, timing out or failing to connect, the run searches the GDELT Article List (GAL) raw files on data.gdeltproject.org (one gzip JSON-lines file per minute, written in the first minutes after every quarter hour) for the same time window, newest first (oldest first for dateasc), and filters them locally. Rows from it carry `dataSource: "gal_files"`, `publishedDate` and a `matchNote`; DOC rows now carry `dataSource: "doc_api"` and `publishedDate: null`.
- What the fallback honours: words, "phrases", `(a OR b)` and `-word` on title and description only; exact domains; languages (mapped to the files' language codes); source countries through GDELT's May 2018 outlets-by-country list (downloaded only when that filter is set; outlets missing from it are left out). It is not used (the 0.2.2 behaviour applies) for tone filters, the relevance or tone sorts, other GDELT operators, unknown language names or windows ending before 2020. `fallback: "only"` with such an input is an input error (free status row).
- Timing with the fallback available: the DOC API phase ends 40 s (default run) or 75 s (larger runs) after the start, 429 waits included; after a first DOC page, a later 429 streak hands over after 3 tries or 30 s of waiting. The file search stops starting requests 75 s (default run) or 165 s (larger runs) after the start (at least 60 s after a hand-over that follows DOC pages), or 20 s before the platform timeout. File requests are sequential, one connection, at least 0.05 s apart, 2 tries, 30 s timeout, after a robots.txt check of data.gdeltproject.org (none there, HTTP 404). With `fallback: "off"` or an input the fallback cannot honour, timing and retries are exactly as in 0.2.2.
- Stop messages describe the real mix of errors. "kept answering X after N tries" is used only when every try failed the same way; otherwise e.g. "failed 3 tries (RemoteProtocolError x1, HTTP 429 x1, ConnectTimeout x1; last: ConnectTimeout)". A time-budget stop after failed tries now names those tries too.
- The free status row for an empty run names the DOC API failure, what the fallback searched (files read, quarter hours) or why it was not used. RUN_SUMMARY gains `dataSource`, `docApiStopKind`, `docApiStopped` and a `fallback` object (mode, possible, skippedBecause, used, pushed, httpRequests, http404, filesRead, fileBytes, linesRead, quartersInWindow, quartersScanned, scannedFrom, scannedTo, complete, stopKind, stopped). The status message adds how many articles came from the files.
- dataset_schema.json now describes every row field (all optional, string or null; `recordType` item/status; `dataSource` doc_api/gal_files/null; no required fields) and shows `dataSource` in the overview table. Input schema: new `fallback` select. User-Agent version 0.2.3. README: fallback, its limits, sources and the updated slow-run note. Price, events, memory and title unchanged.

### 2026-11-12: 0.2.2 (output schema only)

- Added .actor/output_schema.json (dataset items plus the RUN_SUMMARY record) and linked it from actor.json as outputSchema; Apify requires an output schema to make an Actor public. Added a test that checks both. No code, input, pricing or README change.

### 2026-11-12: 0.2.2 r5 (README only)

- README states that runs can be slow (up to about 3 minutes, even the default run) because of GDELT's rate limit, and that waiting is not charged. No code change.

### 2026-11-12: 0.2.2

- Retry, warning and status log lines now go to Actor.log (they were on a Python module logger at INFO and did not appear in Apify run logs). API keys are never logged.
- HTTP 429 recovery stays inside GDELT's "one request every 5 seconds" rule, with no proxy: honour Retry-After when present; otherwise exponential backoff with jitter, starting at 10 seconds (never below 5.5) and growing 20, 40, then 60 seconds. Two requests are never less than 5 seconds apart. The same request is retried up to 6 times or about 3 minutes total, then the run stops with the free status row and is not charged. The default {} run stays a single fast request when GDELT is not rate-limiting.
- README Limits section describes this retry behaviour and what GDELT's own 429 text (and the official DOC 2.0 docs) do and do not say about other 429 causes.

### 2026-11-12: 0.2.1

- Actor title shortened to 63 characters or fewer (Apify's limit): "GDELT News Search: Global Articles by Keyword, Site, Country".
- The run status message now uses the real HTTP request count (`httpRequests` in RUN_SUMMARY, retries included), not the page count, so it no longer says "(0 requests)" when requests were made.
- Every retry (timeouts, 5xx, connection errors, 429s) is logged with the reason (status code or exception class), the attempt number and the wait. API keys are never logged.
- README: GDELT rate limits can make a run return 0 items; those runs end with the free status row and are not charged.
- Price is final, set by Mike: $0.001 per article (was $0.002), no start fee; status rows free.

### 2026-11-12: 0.2

- Removed the third-party search-engine comparison from the README. The listing now describes the Actor as a GDELT metadata search for media monitoring, PR tracking and research, with news metadata from an open dataset whose terms allow commercial reuse.
- Quoted the GDELT DOC 2.0 docs' wording that a start or end date-time "must be within the last 3 months", and noted that the same docs also say the API searches back to January 1, 2017.
- Dropped the always-null `tone` output field (ArtList mode never returns a tone). Tone filters (`toneMin`, `toneMax`), tone sort orders and the `toneFilter` echo still work. The field is gone from the dataset schema, sample output, README field list and tests.

### 2026-11-12: 0.1

- First version (private, not published). GDELT DOC 2.0 API in ArtList mode: query, domain, source country, source language and tone filters, time span or start/end date-time, newest/oldest/relevance/tone sort, up to 5,000 articles per run by moving the time window, only-new mode with a named key-value store.
- One request every 5.5 seconds at most (GDELT asks for one every 5 seconds), backoff on HTTP 429, and a free status row instead of a failed run when GDELT keeps refusing.
- Never an empty dataset: a free status row (recordType "status") on no results, invalid input, robots.txt refusal, rate-limit stop or a zero cost limit. Decided by an in-code write counter.
- Pay per event (proposed): $0.002 per article; status rows free. Respects the maximum cost per run.
