BitLy url shortner
@ Animesh Roy | Tuesday, Nov 29, 2022 | 1 minutes read | Update at Tuesday, Nov 29, 2022

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:

img

follow the instructions:

  1. click on settings after login
  2. click on API
  3. Enter your password and then
  4. 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:

img

  1. click on settings
  2. click on groups, click on the the group name

in my case, I’ll be clicking on main then

img

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


© 2010 - 2024 Classroom

Reading Stuffs

Social Links

YOU CAN REUSE MY CONTENT