Configure search queries using Filters
mainAll search queries are constructed using a gdeltdoc.Filters object. You must provide either a date range (start_date and end_date) or a timespan.
Note on Dates: start_date and end_date can be strings in YYYY-MM-DD format or UTC datetime objects. Using datetime allows for second-level granularity. The API officially supports the most recent 3 months of articles; older requests are not guaranteed to return data.
from gdeltdoc import Filters, near, repeat
f = Filters(
start_date = "2020-05-01",
end_date = "2020-05-02",
num_records = 250,
keyword = "climate change",
domain = ["bbc.co.uk", "nytimes.com"],
country = ["UK", "US"],
theme = "GENERAL_HEALTH",
near = near(10, "airline", "carbon"),
repeat = repeat(5, "planet")
)