Introducing the Google My Business API

Google My Business is helping businesses around the world connect with their customers when they search for them on Google. Today we’re introducing the Google My Business API to make it easier for large businesses and third parties to integrate with the Google My Business platform and publish updates to customers on Google Search & Maps. For example, you can now set your special hours for the holiday season and update them across all of your locations using the Google My Business API.

Through the new Google My Business API, developers can:

  • Create business locations with information such as name, address, phone number, category, business hours, and more
  • Manage special hours
  • Mark a business location as permanently closed
  • Manage business photos
  • List, invite and remove managers on locations and business accounts
  • Read listing state to identify Google updated, duplicate and suspended locations
  • Search/Filter locations by name, category and label
  • Set the service area for a business either by specifying a point and radius or Place IDs

Here's a sample java function that creates a new location and sets special holiday hours:
public static Location createLocation(String accountName) throws Exception {
  Location location = new Location();

  // Street address
  Address address = new Address();
  List addressLines = Arrays.asList("740 Valencia Street");
  address.setLocality("San Francisco");

  // Business hours
  BusinessHours businessHours = new BusinessHours();
  List periods = new ArrayList<>();
  List days = Arrays.asList("Monday", "Tuesday", "Wednesday", "Thursday", "Friday");
  for (String day : days) {
    TimePeriod period = new TimePeriod();

  // Special hours
    Date christmasEve = new Date().setYear(2015).setMonth(12).setDay(24);
    Date christmasDay = new Date().setYear(2015).setMonth(12).setDay(25);
    List periods = new ArrayList<>();
    periods.add(new SpecialHourPeriod()
    periods.add(new SpecialHourPeriod()
   SpecialHours specialHours = new SpecialHours()


  location.setLocationName("Dandelion Chocolate");
  location.setPrimaryPhone("415 349-0942");
  location.setPrimaryCategory(new Category().setCategoryId("gcid:chocolate_shop"));

  // Create Location
  CreateLocationRequest createLocationRequest = new CreateLocationRequest();
  // RequestId is a unique id for each location created
  Mybusiness.Accounts.Locations.Create createLocation =
      mybusiness.accounts().locations().create(accountName, createLocationRequest);

  Location createdLocation = createLocation.execute();

  System.out.printf("Created Location:n%s", createdLocation.toPrettyString());
  return createdLocation;
When special hours are set in Google My Business, we will tell customers that they’re seeing holiday-specific opening hours on Google:

To learn more about the Google My Business API and to apply for access, visit our developer page.

Questions or feedback? Contact the API team on the Google My Business API Forum.

Posted by Aditya Tendulkar, Product Manager, Google My Business