Google URL shortener CLI
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This app will shorten a long URL using the service. It requires an OAuth token in order to associate its requests with your Google account so that you can log into and view the URL analytics.

prerequisites & installation

  1. A Google account
  2. Install the Google Python library
    pip install --upgrade google-api-python-client
  3. Rename client_secrets_sample.json to client_secrets.json
  4. Go to the Google Developer Console and enable the URL Shortener API
  5. Create OAuth2 client credentials for the app. For Application Type choose Other.
  6. Now that you have a client ID and secret, populate the client_secrets.json from step 1 with those values. The other 3 keys can be left as is.

That should be it, go ahead and run and happy URL shortening.

*During the first run you'll be prompted authorize the app, just follow the instructions as it should be pretty self explanatory.