This Python script working with Bitly API to shorten URLs and count clicks on Bitly links.
- Python 3.6 or higher
- requests
- dotenv
- Clone repository to your local machine
git clone https://github.com/R-udren/api-bitly.git
- Go to the program directory
cd api-bitly
- Install the requirements
pip install -r requirements.txt
- After configuration launch script.
python main.py [your link]
- You can see usage by typing
python main.py -h
Before running the script, you need to set up your Bitly API token. Here's how:
- Go to Bitly's Documentation and create an account.
- Create a new access token.
- Rename the
EXAMPLE.env
file to.env
. - Open the
.env
file and replaceYOUR_BITLY_TOKEN
with your actual Bitly API token.