Automate API query with single-date restriction

Copper Contributor

I'm trying to fetch from a web platform via an API key/documentation they provided that returns XML. I got it to work, but the issue is that they have a required "date" parameter. 

 

URL.xml?code=abcd&api_key=12345&date=2022-12-1

 

Even if I could put a range, I'm not sure if it'll let me postdate the end. At bare minimum, I need to access two years of past data to start from scratch. That's 700+ queries. 

 

I'm not super skilled with this, so need some help. Do I:

 

1- set up a parameter query that constantly adds today's date? When it runs (at midnight, I assume) wouldnt it just replace yesterday's data? 

 

2- Is there a way to set a wide range? Would this make it "live" or would it still need to be triggered somehow? 

 

3- Script something that automatically queries with today's date and appends to an existing file? This seems the most likely and safest bet, but I wouldn't know where to start. 

 

I'm okay with "live" being daily, as the data I need is based on daily events, anyway. My only other concern is that each line of the data also then needs a request from a Google Maps API source. If it repopulates the entire date range every day just to add one day, it'd cost me a fortune in Google API requests--and exponentially so each day. Not an option. 

 

Any help would be appreciated. 

 

Thanks! 

0 Replies