Take the 2-minute tour ×

I am looking for a Google Apps API that allows me to retrieve all domain names associated with the Google Apps instance. I am looking for the programmatic equivalent of this: https://www.google.com/a/cpanel/gcompany.nl/DomainSettingsDomains

As an added bonus it would be really nice if there is also a way to check if a given domain name is used as an Alias or in a Multi-domain configuration.

Additional requirements:

  • I need this API to be available using a Google App Engine app (Java).
  • the API must allow authentication using OAUTH.
  • The owner of the app is NOT a Google Apps Reseller (no special privileges).
  • The app only needs readonly access.
share|improve this question

2 Answers 2

up vote 0 down vote accepted

Your answer is correct. There's a issue requesting an API call to retrieve the domains associated with an instance. I'd suggest starring it: http://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=2278

The "lightest weight" retrieve all users function is the Retrieve All Organization Users since only the primary email and Org is returned for each user, not details like first and last name, suspended status, admin status, etc: https://developers.google.com/google-apps/provisioning/#retrieving_organization_users_experimental

domain aliases and secondary domains which have no users won't be returned by this functionality of course.


share|improve this answer
Thanks, I found that the UserProfiles API is actually quite fast. Not getting any domain names that have no accounts in them is ok for this particular project. The only 'issue' is that a script could be used to reset the primary email address to one of the aliases making it difficult to see which domain a user actually belongs to. –  moin Nov 26 '12 at 10:12

I could not locate a Google Apps API to do this. Too bad.

The next best thing is to either use the Provisioning API or User Profiles API, fetch all (user) entries, take the PRIMARY Email address for each entry and parse that to get the domain name.

This is pretty messy, especially if you've got a Google Apps domain with tens of thousands of users.

share|improve this answer

Your Answer


