I'm new to using the requests library in python and I'm calling an API with to get data with set parameters. I want to be able to get all data where the 'date' field falls under a certain year. Dates are in ISO format. Is there a way to only pull records where the date field begins with 2020 for instance?
The code below obviously doesn't work because no date fields are equal to just '2020'. A sample date could be 2020-05-12.
params = {
'weather':'rainy',
'date': '2021'
}