alex9smith / gdelt-doc-api

A Python client for the GDELT 2.0 Doc API
MIT License
91 stars 20 forks source link

Timelinvol timeline_search sometimes errors with results = {"datetime": [entry["date"] for entry in timeline["timeline"][0]["data"]]} #32

Open xpluscal opened 10 months ago

xpluscal commented 10 months ago

Sometimes the timelinevol timeline_search errors with:

results = {"datetime": [entry["date"] for entry in timeline["timeline"][0]["data"]]}
IndexError: list index out of range

I could not inspect the data or cause yet, but it happens fairly often.

Here's some sample code:

f = Filters(
      timespan= "2h",
      num_records = 100,
      keyword ="Grammy"
  )

timeline = gd.timeline_search("timelinevol", f)