Python client library for Google Safe Browsing API v3
While the code was developed according to official Developers Guide this is not a reference implementation. You also may want to check Acceptable Use Policy for Safe Browsing API
Instructions can be found here. Please note that v3.0 API key is different from v2.2 API. Since v4 API is out, v3.0 was renamed to 'Safe Browsing API (Legacy)'.
python setup.py install
from gglsbl import SafeBrowsingList
sbl = SafeBrowsingList('API KEY GOES HERE')
sbl.update_hash_prefix_cache()
On a first run it may take up to several hours to complete the sync
from gglsbl import SafeBrowsingList
sbl = SafeBrowsingList('API KEY GOES HERE')
sbl.lookup_url('http://github.com/')
bin/gglsbl_client.py can be used for quick testing and as a code example.
To sync local cache with Safe Browsing API omitting Acceptable Use Policy delays
gglsbl_client.py --api-key 'API KEY GOES HERE' --onetime
To look up URL
gglsbl_client.py --api-key 'API KEY GOES HERE' --check-url http://github.com/
Fore more options please see
gglsbl_client.py --help
There is a python3 port of this library maintained by Stefan.