Skip to content
/ gglsbl Public
forked from afilipovich/gglsbl

Python client library for Google Safe Browsing API

License

Notifications You must be signed in to change notification settings

wsuen/gglsbl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gglsbl

Python client library for Google Safe Browsing API v3

Disclaimer

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

Quick start

Get Google API key

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)'.

Install the library
    python setup.py install
To sync local hash prefix cache
    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

URL lookup
    from gglsbl import SafeBrowsingList
    sbl = SafeBrowsingList('API KEY GOES HERE')
    sbl.lookup_url('http://github.com/')

CLI Tool

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

Running on Python3

There is a python3 port of this library maintained by Stefan.

About

Python client library for Google Safe Browsing API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.8%
  • Protocol Buffer 2.2%