In validate_url() we should be able to check the long url against Google's Safebrowsing API. You will need the requests library (already imported) and should make a POST request in JSON format (see jsonify) to the API in the link and check the result to see if the provided URL is in Google's list of known malware sites.
You should refer to the provided documentation to know how to format your request. Also look at main.py to see where you should get your API key from.
In
validate_url()
we should be able to check the long url against Google's Safebrowsing API. You will need therequests
library (already imported) and should make a POST request in JSON format (seejsonify
) to the API in the link and check the result to see if the provided URL is in Google's list of known malware sites.You should refer to the provided documentation to know how to format your request. Also look at
main.py
to see where you should get your API key from.