Bitly is a service that allows you to create shortened links that redirect to longer, more complex URLs.

These shortened links are easier to remember, share, and track than the original long URLs.

you could shorten URLs on the Bitly website using your own account.

URL in browser with webpage

Bitly also offers an API that allows you to shorten a URL from an app.

you’re free to integrate the Bitly API into a simple Python script.

If you don’t already have a Bitly account, create one to generate a new access token.

Bitly Dashboard Page

These include buildinga GUI calendaror aword jumble game.

Before using the API, the user will need to input the URL they would like to shorten.

you’ve got the option to use command-line arguments to input the link into the Python script.

Bitly developer API settings

you could view the full example in thisGitHub repo.

you’re free to use your script to shorten any long links before sharing it with others.

It is also important to take the steps necessary to ensure the link is safe.

Bitly generate new access token page

Command line with shortened link

Short link in browser