Using Google MyBusiness API with python to update information

Google MyBusiness API on Python

Please note that this post will not be updated. For latest code changes, visit my github.

What does this do?

The script allows you to access your whitelisted Google MyBusiness API through python


Your project must be whitelisted by Google for Google MyBusiness API access. Note that although you’re able to grant API access to any of your existing and new projects after one project of yours gets whitelisted, it doesnt work like that. You cant use it for any other project.

Once you’re ready,
1. Visit the Google API Console:
2. In case you have multiple Google accounts, choose the appropriate acccount, whose project got whitelisted.
3. Now, choose your whitelisted project from the dropdown.
4. Choose Credentials from the left side menu
5. Create Credentials > OAuth client ID > Application type: Other > Create
6. Click Ok on the popup which shows your client ID and secret.
7. Click on the name of the Client ID you just created.
8. Click on Download JSON.
9. Rename the file from to client_secrets.json

Now run the script like this:

python3 --noauth_local_webserver

The first time you run it, and when your Credentials have expired, you will get the following prompt:

Go to the following link in your browser:

Open a web browser, paste and visit that url. Now, choose the correct google account and authorize it by entering the verification code as prompted by the app:

Enter verification code: 4/abv-xyz

If successful, you’ll get your account information on the console.

You can get a list of available API calls here:

Other useful links:

  • API console dashboard:
  • OAuth playground for testing access:
  • Information about using OAuth playground: (Scroll down to “Make a simple HTTP request”)