3

Is it possible to restrict Google API Key by HTTP referrer (client side) OR IP address (server side)?

The image below shows where I set this in the API console. The problem is that I have to choose the restriction by type (i.e. I can not restrict by HTTP Referrer and/or IP address).

Screenshot from Google API

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449

2 Answers2

3

These are the only options that you have. You can choose one or the other not both.

Suggestion There is a feedback option in the upper right hand corner of the google developer console. What you suggest is a good idea i suggest you submit it as a feature request that it be possible to select more then one type.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
1

Why not create two API keys, one for each purpose?

John
  • 329
  • 2
  • 10
  • 1
    Many CMS plugins and third-party packages accept only one API key to do back-end and front-end work. In those cases, you cannot have two API keys. Granted those tools could be changed to accept two keys, but I am afraid that applying IP (back-end) and referrer (front-end) restriction on the key side is a much more simple and clean solution, isn't? – flaviovs Dec 10 '19 at 19:04