
URLhaus Has a Free API — Check If Any URL Is Malicious (With Python)
You know that feeling when someone sends you a link and you're not sure if it's safe? There's a free API for that. URLhaus by abuse.ch maintains a database of malicious URLs — phishing sites, malware distributors, C2 servers — and lets you check any URL against it. No API key needed. Quick Start import requests def check_url ( url ): """ Check if a URL is in the URLhaus malware database. """ resp = requests . post ( ' https://urlhaus-api.abuse.ch/v1/url/ ' , data = { ' url ' : url } ) data = resp . json () if data [ ' query_status ' ] == ' no_results ' : return { ' status ' : ' clean ' , ' url ' : url } return { ' status ' : ' MALICIOUS ' , ' url ' : url , ' threat ' : data . get ( ' threat ' , ' unknown ' ), ' tags ' : data . get ( ' tags ' , []), ' date_added ' : data . get ( ' date_added ' , '' ), ' reporter ' : data . get ( ' reporter ' , '' ) } # Check a URL result = check_url ( ' http://example.com ' ) print ( f ' Status: { result [ " status " ] } ' ) What URLhaus Tracks 1M+ mali
Continue reading on Dev.to Python
Opens in a new tab



