Hazel + Google Photos API

I have synced a folder of photos on my computer to Google Photos. i want to monitor that folder for changes, then use the Google Photos API to search for the added/modified photo in Google Photos, and add the photo to an album depending on the metadata tags in the photo. So, if the Rating tag is 5, add the photo to a 5 star album in Google Photos. What’s the best way to run Google Photos API calls like this from Hazel? It’s a REST based API that used JSON.
I don’t really know if I need to create a JavaScript script of sorts outside of Hazel, and then have Hazel call that script? But I would need to pass parameters to the script somehow. Or if I can just do it all in an embedded script in hazel? Any direction on how to go about this using Hazel would be much appreciated! I think I can code it up once I figure out the framework and environment I should be using to use the API.
I don’t really know if I need to create a JavaScript script of sorts outside of Hazel, and then have Hazel call that script? But I would need to pass parameters to the script somehow. Or if I can just do it all in an embedded script in hazel? Any direction on how to go about this using Hazel would be much appreciated! I think I can code it up once I figure out the framework and environment I should be using to use the API.