Published in


Making Authenticated Calls To Google Discovery API

Sometimes a Google API and the associated Discovery Document is early release or somehow otherwise restricted to specific Google Cloud Projects. To use the API the caller must somehow inform the API endpoint of the originating Google Cloud Project. This is done through the API Key.

First this only works if the Google team grants access to the API to the Google Cloud Project making the call. User or service doesn’t matter as long as the allowed project is used to create either credential.

To make API calls work a header with the project API key must be provided. The API Key can be created and downloaded on the project credentials page.

The key must then be injected into the call. That’s it!

An full stack StarThinker example is:

  1. Add it to the recipe or as a global value for all API calls.
    Global: starthinker_assets/ -> STARTHINKER_API_KEY
  2. Key propagates to the API call.
  3. Key propagates to the Auth call.
    If caching, be sure to isolate keys.
    Keys can be read globally for all API calls.
  4. Optionally if using just the Discovery API, add the key to the GET request.

This took a bit to figure out as it is intuitive but not explicit. Hopefully this is a time saver for some of the partner teams out there testing out early release APIs from Google.



At gTech, we believe every ad operations team should be faster, nimbler, and able to use all their data sources to drive client impact. To that end, we’ve created StarThinker, a simple and intuitive web UI that allows users to create, edit, run, and schedule data pipelines consis

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store