Search code examples
javascriptphpgoogle-apiapi-key

How to find a Google API key in file?


I have been given a Google API key that is allegedly being used in one of our company's sites. However, I cannot confirm which one.

Besides using the "Find in Files" feature in Notepad++, and literally searching each folder on the server, is there a simpler way to confirm which site is using a Google API key?

I cannot search the entire drive because it will freeze everything up.


Solution

  • Download the projects from the server

    1 - Try to search for google api call instead of key. Open the project using IDE ( neatbeans or phpstorm ) Run a search for a (googleapis URL) with a little patient you cant spot where the api call is fired

    2 - check package manager ex: package.json / bower.json / composer.json if the application is using google sdk check the configuration required for the sdk and you will be able to find the key location if you follow the documentation

    3 - ask for the google account used and get the key.