How to get Google API key and Google oAuth 2.0 client ID

Posted by & filed under Google, PHP.

Google API key is too important to use all the google services like Google maps, Google URL shortener, Google calender and etc.. in your application. Google uses this API key for authentication purpose when we making request to the Google Services from our application.

Here is the steps to create your Google API.

Steps :

1. To get API key from google, please you go through following URL .

Now it asks you to login, so please login with your gmail account user name and password. Once you logged in you will get following page.

Google API key - Console Page

2. Please click on create new project button, and now it list all the google services.

Google Services List

Google Services List

Now find the Google services you needed (Google Maps,URL shortener API and etc..), and click on OFF button to turn it on. So that we can use that in our application.

note : I am going to use URL shortener API google service in one of my application, so I am going turn it on that service.

In the following screen it asks you agree conditions, please check the “I Agree” checkbox and click on Accept button.

get google API-Google Service Agreement Page

Google Service Agreement Page

3. Now click on API access on the top left menu, it ask you to create an OAuth 2 client ID and click on it.


how to create Google oAuth 2 client ID

Create Google oAuth 2.0 Client ID

Please enter product name and logo, and click on next to continue.

how to create google oAuth 2.0 client id 1

Create Google oAuth 2.0 Client ID

Now choose application type as web application, as well eneter your site URL. Finally click on create client ID.

Create Google oAuth 2 client ID 2

how to create Google oAuth 2 client ID

You are successfully created Google API key and Google oAuth 2.0 Client ID.

how to get google api key and oAuth 2.0 client ID

Google APIkey and oAuth 2.0 client ID


I am going to use this Google API key in my next tutorial on Google URL Shortener API service application. Please refer that tutorial..

Leave your feedback in comment box if you came across any diffculty…..



Download Premium Only Scripts & 80+ Demo scripts Instantly at just 1.95 USD per month + 10% discount to all Exclusive Scripts

If you want any of my script need to be customized according to your business requirement,

Please feel free to contact me [at] muni2explore[at]

Note: But it will be charged based on your customization requirement

Get Updates, Scripts & Other Useful Resources to your Email

Join 10,000+ Happy Subscribers on feedburner. Click to Subscribe (We don't send spam)
Every Email Subsciber could have access to download 100+ demo scripts & all future scripts.

%d bloggers like this:

Get Instant Script Download Access!