Download file before polling sensor

A website publishes air pollution data via downloadable CSV files. Right now, I have cron running a bash script every hour to do that, extract what I need, and write it as JSON in a file read by HA’s file sensor. I know I can use an HA automation instead of cron, but I’m wondering if there is a way to link it to the sensor polling directly, so it becomes a pre-condition.

I’m new here, so I apologize if I’m missing something obvious.

if you use a command line sensor you could call a version of your bash script that doesn’t output the JSOn data to a file, but to stout.
just reading the JSON file with a file sensor would also be fine, as long as the cron runs often enough.

This seems like the most efficient way. Thanks a lot!