Skip to content

Google API

Helen Burns edited this page Jan 11, 2019 · 11 revisions

Google maps have a new API key (July 2018) to use maps in web pages.

Proposed CEMAC "free" method

This can be used for small projects and for development whereby once ready the project owner would provide a key.

  1. For each project create a google account with a different email. can use the same card details
  2. Set up daily quotas to match free limits e.g. 900/day for js API (plotting on map)
    • in API platform click APIS, details on your API and set a daily limit to 900.
    • Only one should be used per project, adjust limits accordingly
  3. Secure Key by setting http refferal from desired site only
  4. Use the key in project e.g.
 <iframe width="600" height="450" frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/view?center=...&zoom=...&key=..." allowfullscreen></iframe>  
  1. An example of this in use is in the UNRESP_FORECASTING repository
  2. If this is in use it would be good practice to include a notice that after 25,000 loads this won't display
  3. implement e.g gmplot.GooglePlotter(apikey='')

NB DO NOT VERSION CONTROL THE API KEYS

FREE QUOTA LIST


USING GOOGLE API KEYS IN HTML

Tried following this this helpful gist, but no dice.

It seems browser API Keys are unavoidable, they will display in both the source code and on GitHub. You can, however, secure your API key:

  1. Set HTTP referrer. from google cloud - API overview - Credentials - API Key name - Application restrictions. HTTP referrer set to URL of site calling API

Current APIs

Set with limits to prevent charging - using Helen's personal card. The accounts can easily be transferred as only linked to one project and the card details would need to be updated.

CEMAChelenUNRESP@gmail.com - UNRESP

CEMACLivingLabDataApp@gmail.com - Living Lab