Skip to main content

microurl is a python module to create minfied urls

Project description

python library for url minification.


  • Google
    • URL Minifier
  • Bitly
    • URL Minifier


Install microurl via pip

$ pip install microurl

Or, if you want the code that is currently on GitHub

git clone git://
cd microurl
python install

Starting Out

First, you’ll want to head over to google or bily or supr and register an application!

After you register, grab your applications Consumer Key and Consumer Secret from the application details tab.

First, you’ll want to import your desired minfier from microurl

from microurl import google_mini

Basic Usage

Function definitions (i.e. google_mini()) can be found by reading over microurl/

minified = google_mini('validurl', 'Google_API_KEY')

its as simple as that.

Authentication for bitly

from microurl import bitlyauthentication

authentication = bitlyauthentication(client_id,client_secret,redirect_uri)


open auth_url in your browser.After authorizing app, you will be redirected to redirect_url with code perameter.

access_token=authentication.get_accesstoken_from_code(code) # code that you get to redirect_url in the above step

Authentication using username and password

access_token=authentication.get_accesstoken_from_username_pwd(bitlyusername or login email,password)

Basic Usage

Function definitions (i.e. shorturl()) can be found by reading over microurl/

from microurl import bitlyapi

bitly=bitlyapi(access_token) # access_token is getting from previous steps

minified=bitly.shorturl(longurl,domain)['url'] # domain is optional here

To get detail information of bitlylink.

bitly.url_info(bitlylink,expand_user='True | False',hash='one or more bitly hashes') # expand_user,hash are optional here

To get the number of clicks on a single bitly link.


# here except bitlylink all are optional

To get the number of shares on a single bitly link.


# here except bitlylink all are optional

To get loggedin user info


To get user link history in reverse chronological order.


# here all fields are optional

Questions, Comments, etc?

Our hope is that microurl is so simple that you’d never have to ask any questions, but if you feel the need to contact us for this (or other) reasons, you can hit us up at

Want to help?

microurl is useful, but ultimately only as useful as the people using it (say that ten times fast!). If you’d like to help, write example code, contribute patches, document things on the wiki, tweet about it. Your help is always appreciated!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for microurl, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size microurl-0.0.6.tar.gz (12.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page