Skip to main content
https://readthedocs.org/projects/google-alerts/badge/?version=latest https://badge.fury.io/py/google-alerts.svg https://img.shields.io/badge/License-MIT-yellow.svg

The google-alerts Python module provides an abstract interface for the Google Alerts service. Google does not provide an official API for this service, so interactions are done through web scripting.

WARNING: Your account password will be obfuscated and saved on the file system. Additionally, post-authentication, a session cookie will also be saved. These can be stolen and re-used to compromise your account. As a best practice, register a new email to manage alerts.

Quick Start

Install the library:

pip install google-alerts or python setup.py install

Save your configuration:

google-alerts setup --email <your.mail@foo.com> --password 'password'

Create a monitor:

google-alerts create --term "hello world" --delivery 'rss' --frequency 'realtime'

List monitors:

google-alerts list

Delete a monitor:

google-alerts delete --id '89e517961a3148c7:c395b7d271b4eccc:com:en:US'

Sample Code

This sample code shows some of the range of functionality within the module:

from google_alerts import GoogleAlerts

# Create an instance
ga = GoogleAlerts('your.email@gmail.com', '**password**')

# Authenticate your user
ga.authenticate()

# List configured monitors
ga.list()

# Add a new monitor
ga.create("Hello World", {'delivery': 'RSS'})

# Modify an existing monitor
ga.modify("89e517961a3148c7:c395b7d271b4eccc:com:en:US", {'delivery': 'RSS', 'monitor_match': 'ALL'})

# Delete a monitor
ga.delete("89e517961a3148c7:c395b7d271b4eccc:com:en:US")

Example Output

Below is an example monitor:

[{
    "term": "hello world",
    "user_id": "09738342945634096720",
    "language": "en",
    "monitor_id": "89e517961a3148c7:c395b7d271b4eccc:com:en:US",
    "region": "US",
    "rss_link": "https://google.com/alerts/feeds/09738342945634096720/9663349274289663466",
    "delivery": "RSS",
    "match_type": "BEST"
}]

Features

  • Add new monitors (RSS or Mail)

  • Modify existing monitors

  • Delete monitors by ID or term

  • List all monitors with details

Changelog

11-11-18

  • Feature: Add a new command line argument to seed a session through the browser

  • Change: Added python version detection to the manage script as well

10-13-18

  • Feature: Detect when user changes between Python versions during setup

  • Bugfix: Setup process appears to finally be bug-free, screw python2 support

07-10-18

  • Feature: Added the ability to set the frequency when creating alerts

  • Bugfix: Fixed frequency settings when using the mail delivery method

05-30-18

  • Change: Explicitly detect when a CAPTCHA is being thrown

05-28-18

  • Feature: Take advantage of the config file concept inside of the class

  • Feature: Authenticate users with a session file if it’s available

  • Change: Tell Chrome to avoid using Javascript so we get the old form

05-25-18

  • Change: Added headers to all calls to look like less of a bot

  • Bugfix: Wrapped a problem area when inspecting the forms in a page

  • Bugfix: Handled setup error for Python3

04-29-18

  • Feature: Allow users to setup exact match queries

  • Change: Added support for Python3

  • Bugfix: Removed extra calls causing an error in the decrypt process

04-26-18

  • Feature: Added a command line utility to the code for easy testing

  • Bugfix: Removed clobbering error inside of delete routine

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

google-alerts-0.2.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

google_alerts-0.2.0-py3.6.egg (28.5 kB view details)

Uploaded Egg

google_alerts-0.2.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

google_alerts-0.2.0-py2.7.egg (28.8 kB view details)

Uploaded Egg

google_alerts-0.2.0-py2-none-any.whl (13.5 kB view details)

Uploaded Python 2

File details

Details for the file google-alerts-0.2.0.tar.gz.

File metadata

  • Download URL: google-alerts-0.2.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.6.5

File hashes

Hashes for google-alerts-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6f770381f093c7cb2e9a7919cec079f7469cc58aba740444e402b91bdfd0252e
MD5 2ac1c209c270a53770bcef50a6d5759c
BLAKE2b-256 a3ec3ce7190819f89d049012450b9e5c1437342435e010dcab6500409ca08109

See more details on using hashes here.

File details

Details for the file google_alerts-0.2.0-py3.6.egg.

File metadata

  • Download URL: google_alerts-0.2.0-py3.6.egg
  • Upload date:
  • Size: 28.5 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/2.7.10

File hashes

Hashes for google_alerts-0.2.0-py3.6.egg
Algorithm Hash digest
SHA256 c1a9b579b842e0e5d0580405e6904823b6a716ad40f374c5ec05ba521210478c
MD5 373ce722e596f0026dbed51d7ec8ff1f
BLAKE2b-256 c594340adc3820954e0f2f2353837ce79c1593bf7925f00cb0acdb09e13b39e5

See more details on using hashes here.

File details

Details for the file google_alerts-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: google_alerts-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.6.5

File hashes

Hashes for google_alerts-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 511ce6c83a631e9cd9de91faa3dea478fdd1b66b56ebcc98468e41be63bca96b
MD5 aa287552a21ac2bc24a05adc90096d3b
BLAKE2b-256 d4cc7e2e0f74418df3598c86a3d869c7e1994ce1c837c0233e29a39446ab8c91

See more details on using hashes here.

File details

Details for the file google_alerts-0.2.0-py2.7.egg.

File metadata

  • Download URL: google_alerts-0.2.0-py2.7.egg
  • Upload date:
  • Size: 28.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/2.7.10

File hashes

Hashes for google_alerts-0.2.0-py2.7.egg
Algorithm Hash digest
SHA256 34fffcda0ce3743353e14cf373ffbea26e9984aa33d37d351d0e048c713fa15b
MD5 8b7d1ebd525d080e64094792e79c7486
BLAKE2b-256 660a6477336e7e4abf71c5cb0fc2ad545ab21ea4534805921d97dc8d08ccc0d4

See more details on using hashes here.

File details

Details for the file google_alerts-0.2.0-py2-none-any.whl.

File metadata

  • Download URL: google_alerts-0.2.0-py2-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.6.5

File hashes

Hashes for google_alerts-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 6d6322740ead91f7a7381f9f5ba92457ec16c2b9821635e3cc9c3346ad94df7e
MD5 7631bd509b13dc046d253cec9db28640
BLAKE2b-256 f6626b1f476d7cdab97ca4ce6e31a6d5a8f1a4337ab8d3ec427d1900eb9f5e7b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page