Skip to main content

this pip package is meant to scrape and parse Google results using SERP API. Feel free to fork this repository to add more backends.

Project description

This Python package is meant to scrape and parse Google results using SERP API. Feel free to fork this repository to add more backends.

Simple Example

from lib.google_search_results import GoogleSearchResults
query = GoogleSearchResults({"q": "coffee"})
html_results = query.get_html()

Set SERP API key

GoogleSearchResults.SERP_API_KEY = "Your Private Key"

Or

query = GoogleSearchResults({"q": "coffee", "serp_api_key": "Your Private Key"})

Example with all params and all outputs

query_params = {
  "q": "query",
  "google_domain": "Google Domain",
  "location": "Location Requested",
  "device": device,
  "hl": "Google UI Language",
  "gl": "Google Country",
  "safe": "Safe Search Flag",
  "num": "Number of Results",
  "start": "Pagination Offset",
  "serp_api_key": "Your SERP API Key"
}

query = GoogleSearchResults[query_params]
query.params_dict["location"] = "Portland"

html_results = query.get_html()
json_results = query.get_json()
json_results_with_images = query.get_json_with_images()

Example of Python Dictionary Output (GoogleSearchResults#get_dictionary)

dictionary_results = query.get_dictionary()
dictionary_results_with_images = query.get_dictionary_with_images()

Project details


Download files

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

Source Distribution

google_search_results-1.3.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

google_search_results-1.3.1-py2-none-any.whl (4.3 kB view details)

Uploaded Python 2

File details

Details for the file google_search_results-1.3.1.tar.gz.

File metadata

  • Download URL: google_search_results-1.3.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.11.1 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.10

File hashes

Hashes for google_search_results-1.3.1.tar.gz
Algorithm Hash digest
SHA256 37f455823be717cac9dba435eaaf3ec3e9ea3853a6d219df2f3735e6546f6c8e
MD5 2b64cfaec6859c2b8f24d3eea62e8026
BLAKE2b-256 cf8c9d995727240cbe602e8ceb85b78479f4d5c6223996681cd1b3c1b563659c

See more details on using hashes here.

File details

Details for the file google_search_results-1.3.1-py2-none-any.whl.

File metadata

  • Download URL: google_search_results-1.3.1-py2-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.11.1 setuptools/38.4.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/2.7.10

File hashes

Hashes for google_search_results-1.3.1-py2-none-any.whl
Algorithm Hash digest
SHA256 0f36e00c6d239f926026f8b524cc0032d492f3128e0659729c2331fc0b255046
MD5 f88f44bbd4482c997602a86cdcca9816
BLAKE2b-256 4e7ab5ce49c384f91d3f17daac1a936276d2aca34eb61b8a90dd0d94fbb6375a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page