Shrink. Share. Earn how to make money from Python and adfocus API

Free Python Code - Apr 26 - - Dev Community

Hi 🙂🖐

In this post, I will share with you how to make money from Python
and adfocus API

Step 1

Create account from here

Step 2

Go to https://adfoc.us/tools/api

Step 3

import requests
url = ''
api_key = 'Your API key' # from step 2

endpoint = f'http://adfoc.us/api/?key={api_key}&url={url}'

res = requests.get(url = endpoint)
print(res.text)

Enter fullscreen mode Exit fullscreen mode

The only required variable to send is url= which contains the full URL of the link to shrink.

If there is NO error, the API will return an AdFoc.us shortened URL.
If there is an error, the API will return 0.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .