OverView
we’re going to write a python script to get short URLs using Bit.ly
get the API from BITLY
signup to bitly.com and login to the dashboard, then click on API
section and click on create API
ref to the image below:
follow the instructions:
- click on settings after login
- click on API
- Enter your password and then
- click on generate token.
save the token as we will be using it on our script.
next is to get the group ID, to get this follow the instruction below:
- click on settings
- click on groups, click on the the group name
in my case, I’ll be clicking on main
then
copy the ID
shown in URL.
and that’s it!!!
now you have all the things you need to edit on script:
API and the Group ID.
now copy the script and add those info, delete ‘{}’ from {token}// like the example here
'Authorization': 'Bearer {TOKEN}'
to 'Authorization': 'Bearer yourtokenhere'
add group id
in line 11
and you’re good to go