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
[![Build Status](https://travis-ci.org/serpapi/google-search-results-python.svg?branch=master)](https://travis-ci.org/serpapi/google-search-results-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()
```
## Example of Python Dictionary Output (GoogleSearchResults#get_dictionary)
```python
dictionary_results = query.get_dictionary()
```
[![Build Status](https://travis-ci.org/serpapi/google-search-results-python.svg?branch=master)](https://travis-ci.org/serpapi/google-search-results-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()
```
## Example of Python Dictionary Output (GoogleSearchResults#get_dictionary)
```python
dictionary_results = query.get_dictionary()
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file google_search_results-1.3.0-py2-none-any.whl
.
File metadata
- Download URL: google_search_results-1.3.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834547305dd3ee28770fb24b0660e086b9ffe5a043b0e07b8c5ea6ffb8476b9a |
|
MD5 | 94a31c051ab32bb702222b39d0083572 |
|
BLAKE2b-256 | 60d4d391a3076e0818fc4165dc3bd021b8786c6d65c45055625da41c0991591d |