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

# Google Search Results in Python

This Python package is meant to scrape and parse Google results using [SERP API](https://serpapi.com). Feel free to fork this repository to add more backends.

## Simple Example
```python
from lib.google_search_results import GoogleSearchResults
query = GoogleSearchResults({"q": "coffee", "location": "Austin,Texas"})
json_results = query.get_json()
```

## Set SERP API key

```python
GoogleSearchResults.SERP_API_KEY = "Your Private Key"
```
Or
```python
query = GoogleSearchResults({"q": "coffee", "serp_api_key": "Your Private Key"})
```

## Example with all params and all outputs

```python
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)

```python
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.2.4.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

google_search_results-1.2.4-py2-none-any.whl (4.1 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for google_search_results-1.2.4.tar.gz
Algorithm Hash digest
SHA256 b21b997c97ff4ae8929df8b5a0c08d52b0346d51307176454f7e75dcaa71d2dd
MD5 66180af475e2c59fbe2540bc95ec5471
BLAKE2b-256 48c24767ac10b0b783b9c4d9abeba4bc10b46d0da655de0bd55c6e2b1bddf8dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: google_search_results-1.2.4-py2-none-any.whl
  • Upload date:
  • Size: 4.1 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.2.4-py2-none-any.whl
Algorithm Hash digest
SHA256 35222bfe56c8c90f0f13ea8f4d16e49ed8f689db31c78998ff3f401c6128e2d4
MD5 a4f531ffa7ba2724bf0f1b18fec8d15b
BLAKE2b-256 5e419e736178a5cf4a0ef0442cba27e78ad3409faeb01698015ed46049a02fa4

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