Google Contacts directory scraper

Collects all the contacts listed in your organization's directory in Google Contacts. This works for non-personal Google accounts, e.g. your student account, and will collect all names in your school district or university.

This will ask to save a CSV file to store the contacts in, then open a Google sign-in screen. Make sure to select an account in the organization you want to scrape (e.g. your school account). Then, leave this page open and wait. To avoid rate limits, this page will scrape 1000 contacts every second. It will eventually unceremoniously finish, and you can find the contacts in the CSV file you saved.

Most Frequent Names is designed to work with the CSV file produced by this page. You can use it to find the most common or longest names on your campus. You can also download the example dataset (gzipped), which contains 133k contacts from UC San Diego in October 2024.

The default values above are from my school account for UC San Diego. It should work for any UC San Diego student, at least until I graduate. For other organizations, you can follow these steps to create your own client ID and API key:

  1. Create or select an existing project on the Google Cloud console.

  2. Follow the steps in Google's People API JavaScript quickstart guide.

    1. Enable the People API.

    2. Set the OAuth consent screen to be for users internal to the organization. Under "Authorized domains," put sheeptester.github.io so the OAuth screen works on this page.

      On the "Scopes" screen, add the People API …/auth/directory.readonly scope, which should show up under "Your sensitive scopes."

    3. Create an OAuth client ID. Make sure to add http://sheeptester.github.io under "Authorized JavaScript origins" so this web page can use it. Copy that client ID here.

    4. Create an API key and paste it above.

  3. Click the "Authorize" button.