welcome everybody ππ
Today I will share with you how to shorten a link using Python language and cutt.ly api
In an easy and simple way
step 1
you need to create an account in cutt.ly
create account from here
step 2
click on API and select "API key"
step 3
click on "manage API"
step 4
Generate api key
click on "OK"
step 5
Now you have api key you can use it to shorten links
copy this key
step 6
use the api key in this code with any link you want to shorten it
import requests
api_key = 'Your API Key'
url = 'https://www.flaticon.com/uicons/interface-icons'
r = requests.get(f'http://cutt.ly/api/api.php?key={api_key}&short={url}')
print(r.json())
result
"""
{'url': {'status': 7, 'fullLink': 'https://www.flaticon.com/uicons/interface-icons',
'date': '2023-08-12', 'shortLink': 'https://cutt.ly/hwf2vorm',
'title': 'UIcons: 18,000+ Free icons, SVG and icon font. Awesome icons for any project'}}
"""
Now we're done π€
Don't forget to like and follow π
Support us on PayPal