You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository is the home of the official Python API wrapper for [SerpApi](https://serpapi.com). This `serpapi` module allows you to access search data in your Python application.
12
-
13
-
[SerpApi](https://serpapi.com) supports Google, Google Maps, Google Shopping, Bing, Baidu, Yandex, Yahoo, eBay, App Stores, and more. Check out the [documentation](https://serpapi.com/search-engine-apis) for a full list.
6
+
SerpApi supports Google, Google Maps, Google Shopping, Baidu, Yandex, Yahoo, eBay, App Stores, and [more](https://serpapi.com).
14
7
8
+
Query a vast range of data at scale, including web search results, flight schedules, stock market data, news headlines, and [more](https://serpapi.com).
15
9
16
10
## Installation
17
11
@@ -23,32 +17,33 @@ $ pip install serpapi
23
17
24
18
Please note that this package is separate from the legacy `serpapi` module, which is available on PyPi as `google-search-results`. This package is maintained by SerpApi, and is the recommended way to access the SerpApi service from Python.
25
19
26
-
## Usage
20
+
## Simple Usage
27
21
28
22
Let's start by searching for Coffee on Google:
29
23
30
-
```pycon
31
-
>>> import serpapi
32
-
>>> s = serpapi.search(q="Coffee", engine="google", location="Austin, Texas", hl="en", gl="us")
33
-
```
34
-
35
-
The `s` variable now contains a `SerpResults` object, which acts just like a standard dictionary, with some convenient functions added on top.
Let's print the title of the first result, but in a more Pythonic way:
37
+
The `results` variable now contains a `SerpResults` object, which acts just like a standard dictionary, with some convenient functions added on top.
45
38
46
-
```pycon
47
-
>>> s["organic_results"][0].get("title")
48
-
'Coffee - Wikipedia'
49
-
```
39
+
This example runs a search for "coffee" on Google. It then returns the results as a regular Python Hash.
40
+
See the [playground](https://serpapi.com/playground) to generate your own code.
41
+
42
+
The SerpApi key can be obtained from [serpapi.com/signup](https://serpapi.com/users/sign_up?plan=free).
50
43
51
-
The [SerpApi.com API Documentation](https://serpapi.com/search-engine-apis) contains a list of all the possible parameters that can be passed to the API.
44
+
Environment variables are a secure, safe, and easy way to manage secrets.
45
+
Set `export SERPAPI_KEY=<secret_serpapi_key>` in your shell.
46
+
Python accesses these variables from `os.environ["SERPAPI_KEY"]`.
0 commit comments