Test script to only return values less than 5 minutes old

I have a GET request returning a list of files from a folder. This folder will always have new files in it, and the API is looping often.

I would like to know if there’s a way where I can set a script to only return files less than 5 minutes old.

I’m very new to this and learning on the fly. Trying to get answers on my own, this is one of 3 things holding me up from finishing this project.

thanks for the help!

Are you in control of the API?

Does the API include the time and date stamp?

If not, can it?

If you do have control, this is better controlled at the API level. Code the five minutes rule as an option in the API.

If you can’t do in in the API, then you are limited in what control you have in the GET command. You can only really get all of the data and then filter on it afterwards. Which still relies on data like a timestamp.

I am not in full control of the API, so I can’t code the five minutes rule as an option unfortunately. The GET command I’m running does return a timestamp down to the second, so I can filter afterwards, honestly just learning how to code and haven’t been able to figure out the filtering part.

Can you post an example response (anonymised appropriately)?

Sure someone can help with the filter given the response structure.