In my app i create programmatically multiple VM instances for a period of time then i delete them and i need to know before creating the instance how much it's going to cost per minute (or hour)
I'm asking if there is an API that takes the configuration of the VM instance and gives back the pricing information?
If the answer is no, what is the best way to obtain the pricing information of a VM instance?
In my research i found this online pricing calculator but i need an API, and this API that lists all the SKUs of the GCP by service and if it is theoretically possible to search through the SKUs of Compute Engine to find the resources i'm using and then calculate the pricing from that, i don't think it's ideal.
The only way is the one you found - using SKUs and Cloud Billing API.
You can find that similar question has already been answered here.