Keep API Call as low as necessary

Hi,
We have developed a Delphi application that uses FNC Maps to interact with Google maps.
Our Customer gets now costs for the Google Directions and Geocoding API usage. They ask us to try reduce this costs.
What possibilities do we have to keep the API calls as low as possible?
Thanks for any Hint

Hi,

FNC Maps allow to combine different service providers for map view, geocoding, and directions.
This feature may be used to optimize the pricing, without making any changes in the code.

In our app we allow customers to configure all supported by FNC Maps providers (7),
and additionally select which service provider may be used for specific request type.
Additionally, we allow configure FNC maps providers access per user ID.
So different users of our app will see 3 different drop-down lists for view, geocoding, directions service.

First, I would suggest to collect the information about actual # of requests and current price.
then do some research and compare rates from different providers,
and switch to that provider if they offers a better rate.

Also, we save all requests in DB. And before sending a new request -
we check if similar request was sent in the past and data already available,
and just read value from DB.
We apply some iterations, when comparing GPS.
For example, if Lon/Lat is close to what is already stored in DB - we can use Address from History tables (DB).

When saving API keys in Setup table (DB), we use TMS Cryptography pack.

Regards

Hi,

These are good suggestions from Oleg to keep API costs down.
Make sure to keep API requests to a minimum and if possible save data from recurring requests.
If you are geocoding addresses before using them in your directions requests, please note that the Google Directions API allows to provide string addresses as parameters for the directions request. This way you can avoid the geocoding requests.

We are also preparing a series of blog posts that compare costs between different supported mapping services in TMS FNC Maps. This could help you pick the service that offers the best rates for your specific application.
I'll add a link to the blog posts here after publication.

Hi,
Thanks for the suggestions, I will try to adapt my code accordingly.
One additional question: Is there a way to get a log every time an API call is made? That way I could accumulate and store the count monthly and show usage in my application. Maybe I could set a limit in the application settings so I can show the user when they start incurring costs.
Thanks in advance for any Hint

Unfortunately there is no built-in functionality available to log API calls. You'll have to manually log each call to GetGeocoding and GetDirections in your code.