Forum Academy Marketplace Showcase Pricing Features

Combining Google API calls?

I’m using Google Timezone API and Google Maps API.

For timezone I currently have:

  • An input box with API call returning UTC offset
  • Another input box with API call returning daylight savings offset
  • A text box with API call returning the timezone name

The above is done with 3x API calls, however this is essentially the same API call with each element is displaying a different component of the result. I would imagine this would be possible to be done in 1 API call, however currently I’m using 3 API calls.

The same for maps - i’m displaying directions on a map and also in an input box I’m showing round trip mileage. 2 API calls currently but again I imagine this should be possible to be done in 1?

How can i combine all these API calls? Eg for my timezone one, do the API call once and then save somewhere all of the results (UTC offset, daylight savings offset, timezone name,… etc)

Thanks