von Johannes Klampfl
Working in the Online Marketing field often requires exporting data from different Google sources. This blog article series will therefore start with an introduction to Google APIs and how to access them.
Webanalyse steht für Messbarkeit und ist die Grundlage für langfristige Erfolgskontrolle und Effizienzsteigerung Ihrer (Online) Marketing Aktivitäten.
Mehr ErfahrenThis blog article focuses on a Node.js implementation, which means some links will direct you to the corresponding Node.js documentation. Nevertheless the main part will be generic and applies to all programming languages.
When reading through the official Google documentation it seems that the term “Google APIs” is used for the complete set of APIs, and “Google Cloud APIs” or just “Cloud APIs” is used for the sub set of APIs related to the Google Cloud Platform. This blog article series will address all Google APIs. Just to name a few: Campaign Manager 360 API, Google Analytics Reporting API, BigQuery API etc.
There are two options to get a list of these APIs, but it seems that these options do not list the same/complete set of APIs (Google Cloud Marketplace: 314 APIs vs. API Library: 414 APIs). I would recommend using the dedicated API Library page, but wanted to show an alternative for non GCP users.
One way to get a collection of Google Cloud APIs is via the Google Cloud Marketplace.
This marketplace is a collection of software products and services available on GCP. The link above in addition contains a filter which reduces the results to only display Google products. You do not need to have a GCP account or be logged in to be able to see this API overview. Clicking on one of the displayed Google Cloud APIs will reveal important links e.g. to the documentation, API explorer etc. and inform about pricing (if applicable).
Screenshot of the Google Cloud Marketplace, Source: e-dialog
Just as a side note: There is no separate entry for most Google Cloud Platform service APIs. An example to make it clear: you will not find an entry for “BigQuery API” only the GCP service “BigQuery” can be found, which then references BigQuery API documentation.
Google Cloud Marketplace search result for ‚BigQuery‘, Source: e-dialog
The second method to get a list of the Google APIs is via the Google Cloud Platform console and the menu item: GCP > APIs and services > Library.
How to find the GCP API Library, Source: e-dialog
All these Google APIs can only be accessed via the Google Cloud Platform. When you want to use one of them, the corresponding API needs to be enabled first within: GCP > APIs & Services > Enabled APIs and services > + Enable APIs and Services. All enabled Google APIs for the selected project will be listed up on the same page.
Enable APIs and services in GCP, Source: e-dialog
Many Google APIs can be accessed via the Google APIs explorer, which offers a great way to interact with API methods without writing code. It can be used for debugging and learning purposes. To use this tool, the activation of the corresponding API as explained above is not required.
Google recommends using their Client Libraries to interact with their APIs. If the rare situation occurs that these libraries do not meet your specific needs, you can write your own code to access those APIs directly.
While there are dedicated mobile Firebase client libraries available, this article tries to focus on a Node.js implementation, which offers two different client libraries.
The recommended and newer library is called “Google Cloud Client Libraries”. These libraries support REST and gRPC, handle authentication and provide an intuitive and consistent style across all APIs and languages. Currently the following list shows 116 APIs which can be accessed via the Node.js client.
In the background these clients use the dependency “Google Auth Library” for handling authentication, which offers the following authentication methods:
The second and older library is called “Google API Client Libraries”. Google recommends only using these libraries if the “Google Cloud Client Library” does not support the desired language. These libraries support REST (not gRPC) and handle authentication. The following page offers documentation for 228 APIs accessible via Node.js.
These libraries support the following ways to authenticate to Google APIs:
Each Google API has different quotas, which means API usage will be capped based on defined thresholds. Quotas and usage can be viewed via GCP > IAM and admin > Quotas or via GCP > APIs and services > select an API > QUOTAS tab. It is possible to reduce your own quota limits (e.g. to save costs) or request an increase via a form.
Review API quota in GCP, Source: e-dialog
Wir freuen uns auf Ihre Anfrage und beraten Sie gerne unverbindlich! Füllen Sie dazu einfach das Kontaktformular aus oder rufen uns direkt an.
Jetzt kontaktierenNewsletter
Holen Sie sich unsere Online Marketing-Insights und Trends direkt in Ihr Postfach!