alex9smith / gdelt-doc-api

A Python client for the GDELT 2.0 Doc API
MIT License
100 stars 23 forks source link

Search which yields 0 results.. throws error #1

Closed PAG-ASAP closed 3 years ago

PAG-ASAP commented 3 years ago

Example:

from gdeltdoc import GdeltDoc, Filters

from gdeltdoc import Filters, near, repeat

f = Filters( start_date = "2020-05-01", end_date = "2020-05-02", num_records = 250, keyword = "George Floyd", domain = "theguardian.com", country = "US" )

gd = GdeltDoc()

Search for articles matching the filters

articles = gd.article_search(f)

Get a timeline of the number of articles matching the filters

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

############################# Error Message ################################### KeyError Traceback (most recent call last)

in 16 17 # Search for articles matching the filters ---> 18 articles = gd.article_search(f) 19 20 # Get a timeline of the number of articles matching the filters c:\python\python37\lib\site-packages\gdeltdoc\api_client.py in article_search(self, filters) 60 articles = self._query("artlist", filters.query_string) 61 ---> 62 return pd.DataFrame(articles["articles"]) 63 64 KeyError: 'articles'
alex9smith commented 3 years ago

This got fixed in ea03c6b - thanks for raising the issue and @FelixKleineBoesing for the fix