It is possible although I'm not sure if I were in your shoes I'd choose this path.
I'd recommend setting up a cron job to ping at Google (for example) every X minutes and dumping the results to a file for later.
For something more like what you're actually trying to do maybe take a look at "uptime-kuma" on GitHub. It seems to fit your needs well.