What is Google API? Why should a Google API be deprecated? Does it mean it is no longer available

Epsilon India
Epsilon Engineering Blog
3 min read1 day ago

By Shilpa I

We all want to effectively utilize our time in developing an application. Google has been contributing to the developer community by providing their own large pool of APIs, which we can integrate into our code to use their functionality for free with proper authentication, until they keep it available. We can explore and learn so much more through their documentation at the link below.

Google APIs Explorer | Google for Developers

The Google team keeps updating the APIs and adding more features to them, which would indirectly improve the performance of our application. Sometimes they develop new APIs that are way more presentable and have more features. When a new version of an API is released by the Google team, they try to deprecate, decommission/sunset the old APIs so that the developers who use the old API have time to upgrade to the new APIs.

First, it will be unfair to say that. It is frustrating to see any Google APIs get deprecated. As Google has an outstanding internal infrastructure to provide us with a programmatic interface, that can be added to our client libraries quite easily. Before getting very deep into it, we should know the key difference between the three terms by which Google refers to the interface that we use.

Deprecated: The deprecated library is a version of the API that will no longer be supported or maintained by developers. The Google team may have released an updated version of it. It is not recommended to use the deprecated interface, and the response from the API will be inaccurate.

Decommissioned: Once the API is decommissioned, the interface, once available, is systematically retired. The endpoints will not provide any response to requests.

Sunset: The sunset of an API means it is pulling down the curtains on their response by responding only to very few legacy requests and going into read-only mode.

Well, now we are clear on the terms that Google wishes us to know while using their APIs. Now let me share with you a scenario that our team faced while using a Google API for developing MFA (Multi-Factor Authentication).

Issue

We planned to add another layer of security to the already existing standard username-password authentication method. We researched about Google’s API that could be embedded in our code to get the JSON response and allow the user to access their information instantly by scanning the QR code from their mobile. We tried the API in our DEV environment; it worked as expected. Then our team did multiple tests in the UAT environment and received positive results. Finally, we deployed it on the PROD server, and it worked perfectly like DEV/UAT. After a few days of product validation, we found out that the QR code did not load properly at a certain time interval.

Root URL: https://chart.googleapis.com/chart? (Deprecated)

Temporary Fix and Issue Continued

We were unable to reproduce the scenario as the QR code loaded most of the time. Upon investigation, we found out the service offered by Google has been moved to the deprecation stage. First, we informed our client that you can safely ignore it for now. Deprecated APIs usually last a long time, and they will not affect any functionalities until the underlying API is removed. After a few days, the response count coming from the API decreased drastically. We had no other option but to find a solid solution that could never bring the service down.

Solution

Google themselves suggested using the ZXing (“Zebra Crossing”) API, which has an updated version of the chart. googleapi. They have also provided their code structure in the below GitHub repository.

GitHub — zxing/zxing: ZXing (“Zebra Crossing”) barcode scanning library for Java, Android

Conclusion

The best thing to do is regularly check for updates to the third-party API that we are using that might fix these kinds of issues in the future.

--

--

Epsilon India
Epsilon Engineering Blog

Leader in outcome-based marketing, with a rich, 50-year heritage in helping marketers anticipate, activate and prove measurable business outcomes.