Skip to content

Commit 58d5129

Browse files
authored
Minor README update
Fixed typos, etc.
1 parent fff1fab commit 58d5129

File tree

1 file changed

+58
-57
lines changed

1 file changed

+58
-57
lines changed

README.md

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Package](https://badge.fury.io/py/google-search-results.svg)](https://badge.fury.io/py/google-search-results)
44
[![Build](https://github.com/serpapi/google-search-results-python/actions/workflows/python-package.yml/badge.svg)](https://github.com/serpapi/google-search-results-python/actions/workflows/python-package.yml)
55

6-
This Python package is meant to scrape and parse search results from Google, Bing, Baidu, Yandex, Yahoo, Home depot, Ebay and more.. using [SerpApi](https://serpapi.com).
6+
This Python package is meant to scrape and parse search results from Google, Bing, Baidu, Yandex, Yahoo, Home Depot, eBay and more, using [SerpApi](https://serpapi.com).
77

88
The following services are provided:
99
- [Search API](https://serpapi.com/search-api)
@@ -34,24 +34,25 @@ search = GoogleSearch({
3434
result = search.get_dict()
3535
```
3636

37-
This example runs a search about "coffee" using your secret api key.
37+
This example runs a search for "coffee" using your secret API key.
3838

3939
The SerpApi service (backend)
40-
- searches on Google using the search: q = "coffee"
41-
- parses the messy HTML responses
42-
- return a standardizes JSON response
40+
- Searches Google using the search: q = "coffee"
41+
- Parses the messy HTML responses
42+
- Returns a standardized JSON response
4343
The GoogleSearch class
44-
- Format the request
45-
- Execute GET http request against SerpApi service
46-
- Parse JSON response into a dictionary
47-
Et voila..
44+
- Formats the request
45+
- Executes a GET http request against SerpApi service
46+
- Parses the JSON response into a dictionary
47+
48+
Et voilà...
4849

4950
Alternatively, you can search:
5051
- Bing using BingSearch class
5152
- Baidu using BaiduSearch class
5253
- Yahoo using YahooSearch class
53-
- duckduckgo using DuckDuckGoSearch class
54-
- Ebay using EbaySearch class
54+
- DuckDuckGo using DuckDuckGoSearch class
55+
- eBay using EbaySearch class
5556
- Yandex using YandexSearch class
5657
- HomeDepot using HomeDepotSearch class
5758
- GoogleScholar using GoogleScholarSearch class
@@ -133,7 +134,7 @@ object_result = search.get_object()
133134
```
134135
[Link to the full documentation](https://serpapi.com/search-api)
135136

136-
see below for more hands on examples.
137+
See below for more hands-on examples.
137138

138139
### How to set SERP API key
139140

@@ -150,12 +151,12 @@ query = GoogleSearch({"q": "coffee", "serp_api_key": "Your Private Key"})
150151

151152
### Example by specification
152153

153-
We love true open source, continuous integration and Test Drive Development (TDD).
154-
We are using RSpec to test [our infrastructure around the clock](https://travis-ci.org/serpapi/google-search-results-python) to achieve the best QoS (Quality Of Service).
154+
We love true open source, continuous integration and Test Driven Development (TDD).
155+
We are using RSpec to test [our infrastructure around the clock](https://travis-ci.org/serpapi/google-search-results-python) to achieve the best Quality of Service (QoS).
155156

156157
The directory test/ includes specification/examples.
157158

158-
Set your api key.
159+
Set your API key.
159160
```bash
160161
export API_KEY="your secret key"
161162
```
@@ -174,7 +175,7 @@ location_list = search.get_location("Austin", 3)
174175
print(location_list)
175176
```
176177

177-
it prints the first 3 location matching Austin (Texas, Texas, Rochester)
178+
This prints the first 3 locations matching Austin (Texas, Texas, Rochester).
178179
```python
179180
[ { 'canonical_name': 'Austin,TX,Texas,United States',
180181
'country_code': 'US',
@@ -191,8 +192,8 @@ it prints the first 3 location matching Austin (Texas, Texas, Rochester)
191192

192193
### Search Archive API
193194

194-
The search result are stored in temporary cached.
195-
The previous search can be retrieve from the the cache for free.
195+
The search results are stored in a temporary cache.
196+
The previous search can be retrieved from the cache for free.
196197

197198
```python
198199
from serpapi import GoogleSearch
@@ -203,29 +204,29 @@ search_id = search_result.get("search_metadata").get("id")
203204
print(search_id)
204205
```
205206

206-
Now let retrieve the previous search from the archive.
207+
Now let's retrieve the previous search from the archive.
207208

208209
```python
209210
archived_search_result = GoogleSearch({}).get_search_archive(search_id, 'json')
210211
print(archived_search_result.get("search_metadata").get("id"))
211212
```
212-
it prints the search result from the archive.
213+
This prints the search result from the archive.
213214

214215
### Account API
215216
```python
216217
from serpapi import GoogleSearch
217218
search = GoogleSearch({})
218219
account = search.get_account()
219220
```
220-
it prints your account information.
221+
This prints your account information.
221222

222223
### Search Bing
223224
```python
224225
from serpapi import BingSearch
225226
search = BingSearch({"q": "Coffee", "location": "Austin,Texas"})
226227
data = search.get_dict()
227228
```
228-
this code prints baidu search results for coffee as a Dictionary.
229+
This code prints Bing search results for coffee as a Dictionary.
229230

230231
https://serpapi.com/bing-search-api
231232

@@ -235,7 +236,7 @@ from serpapi import BaiduSearch
235236
search = BaiduSearch({"q": "Coffee"})
236237
data = search.get_dict()
237238
```
238-
this code prints baidu search results for coffee as a Dictionary.
239+
This code prints Baidu search results for coffee as a Dictionary.
239240
https://serpapi.com/baidu-search-api
240241

241242
### Search Yandex
@@ -244,7 +245,7 @@ from serpapi import YandexSearch
244245
search = YandexSearch({"text": "Coffee"})
245246
data = search.get_dict()
246247
```
247-
this code prints yandex search results for coffee as a Dictionary.
248+
This code prints Yandex search results for coffee as a Dictionary.
248249

249250
https://serpapi.com/yandex-search-api
250251

@@ -254,28 +255,28 @@ from serpapi import YahooSearch
254255
search = YahooSearch({"p": "Coffee"})
255256
data = search.get_dict()
256257
```
257-
this code prints yahoo search results for coffee as a Dictionary.
258+
This code prints Yahoo search results for coffee as a Dictionary.
258259

259260
https://serpapi.com/yahoo-search-api
260261

261262

262-
### Search Ebay
263+
### Search eBay
263264
```python
264265
from serpapi import EbaySearch
265266
search = EbaySearch({"_nkw": "Coffee"})
266267
data = search.get_dict()
267268
```
268-
this code prints ebay search results for coffee as a Dictionary.
269+
This code prints eBay search results for coffee as a Dictionary.
269270

270271
https://serpapi.com/ebay-search-api
271272

272-
### Search Home depot
273+
### Search Home Depot
273274
```python
274275
from serpapi import HomeDepotSearch
275276
search = HomeDepotSearch({"q": "chair"})
276277
data = search.get_dict()
277278
```
278-
this code prints home depot search results for chair as Dictionary.
279+
This code prints Home Depot search results for chair as Dictionary.
279280

280281
https://serpapi.com/home-depot-search-api
281282

@@ -285,7 +286,7 @@ from serpapi import HomeDepotSearch
285286
search = YoutubeSearch({"q": "chair"})
286287
data = search.get_dict()
287288
```
288-
this code prints youtube search results for chair as Dictionary.
289+
This code prints Youtube search results for chair as Dictionary.
289290

290291
https://serpapi.com/youtube-search-api
291292

@@ -295,39 +296,39 @@ from serpapi import GoogleScholarSearch
295296
search = GoogleScholarSearch({"q": "Coffee"})
296297
data = search.get_dict()
297298
```
298-
this code prints Google Scholar search results.
299+
This code prints Google Scholar search results.
299300

300301
### Search Walmart
301302
```python
302303
from serpapi import WalmartSearch
303304
search = WalmartSearch({"query": "chair"})
304305
data = search.get_dict()
305306
```
306-
this code prints Google Scholar search results.
307+
This code prints Walmart search results.
307308

308309
### Search Youtube
309310
```python
310311
from serpapi import YoutubeSearch
311312
search = YoutubeSearch({"search_query": "chair"})
312313
data = search.get_dict()
313314
```
314-
this code prints Google Scholar search results.
315+
This code prints Youtube search results.
315316

316-
### Search Apple Store
317+
### Search Apple App Store
317318
```python
318319
from serpapi import AppleAppStoreSearch
319320
search = AppleAppStoreSearch({"term": "Coffee"})
320321
data = search.get_dict()
321322
```
322-
this code prints Google Scholar search results.
323+
This code prints Apple App Store search results.
323324

324325
### Search Naver
325326
```python
326327
from serpapi import NaverSearch
327328
search = NaverSearch({"query": "chair"})
328329
data = search.get_dict()
329330
```
330-
this code prints Google Scholar search results.
331+
This code prints Naver search results.
331332

332333
### Generic search with SerpApiClient
333334
```python
@@ -336,7 +337,7 @@ query = {"q": "Coffee", "location": "Austin,Texas", "engine": "google"}
336337
search = SerpApiClient(query)
337338
data = search.get_dict()
338339
```
339-
This class enables to interact with any search engine supported by SerpApi.com
340+
This class enables interaction with any search engine supported by SerpApi.com
340341

341342
### Search Google Images
342343

@@ -352,8 +353,8 @@ for image_result in search.get_dict()['images_results']:
352353
pass
353354
```
354355

355-
this code prints all the images links,
356-
and download image if you un-comment the line with wget (linux/osx tool to download image).
356+
This code prints all the image links,
357+
and downloads the images if you un-comment the line with wget (Linux/OS X tool to download files).
357358

358359
This tutorial covers more ground on this topic.
359360
https://github.com/serpapi/showcase-serpapi-tensorflow-keras-image-training
@@ -375,7 +376,7 @@ for offset in [0,1,2]:
375376
print(str(news_result['position'] + offset * 10) + " - " + news_result['title'])
376377
```
377378

378-
this script prints the first 3 pages of the news title for the last 24h.
379+
This script prints the first 3 pages of the news headlines for the last 24 hours.
379380

380381
### Search Google Shopping
381382

@@ -393,12 +394,12 @@ for shopping_result in data['shopping_results']:
393394

394395
```
395396

396-
this script prints all the shopping results order by review order.
397+
This script prints all the shopping results, ordered by review order.
397398

398399
### Google Search By Location
399400

400-
With SerpApi, we can build Google search from anywhere in the world.
401-
This code is looking for the best coffee shop per city.
401+
With SerpApi, we can build a Google search from anywhere in the world.
402+
This code looks for the best coffee shop for the given cities.
402403

403404
```python
404405
from serpapi import GoogleSearch
@@ -416,9 +417,9 @@ for city in ["new york", "paris", "berlin"]:
416417

417418
### Batch Asynchronous Searches
418419

419-
We do offer two ways to boost your searches thanks to `async` parameter.
420-
- Blocking - async=false - it's more compute intensive because the search would need to hold many connections. (default)
421-
- Non-blocking - async=true - it's way to go for large amount of query submitted by batch (recommended)
420+
We offer two ways to boost your searches thanks to the`async` parameter.
421+
- Blocking - async=false - more compute intensive because the search needs to maintain many connections. (default)
422+
- Non-blocking - async=true - the way to go for large batches of queries (recommended)
422423

423424
```python
424425
# Operating system
@@ -489,19 +490,19 @@ print('all searches completed')
489490

490491
This code shows how to run searches asynchronously.
491492
The search parameters must have {async: True}. This indicates that the client shouldn't wait for the search to be completed.
492-
The current thread that executes the search is now non-blocking which allows to execute thousand of searches in seconds. The SerpApi backend will do the processing work.
493-
The actual search result is defer to a later call from the search archive using get_search_archive(search_id).
493+
The current thread that executes the search is now non-blocking, which allows it to execute thousands of searches in seconds. The SerpApi backend will do the processing work.
494+
The actual search result is deferred to a later call from the search archive using get_search_archive(search_id).
494495
In this example the non-blocking searches are persisted in a queue: search_queue.
495-
A loop through the search_queue allows to fetch individual search result.
496-
This process can be easily multithreaded to allow a large number of concurrent search requests.
497-
To keep thing simple, this example does only explore search result one at a time (single threaded).
496+
A loop through the search_queue allows it to fetch individual search results.
497+
This process can easily be multithreaded to allow a large number of concurrent search requests.
498+
To keep things simple, this example only explores search results one at a time (single threaded).
498499

499500
[See example.](https://github.com/serpapi/google-search-results-python/blob/master/tests/test_example.py)
500501

501502
### Python object as a result
502503

503504
The search results can be automatically wrapped in dynamically generated Python object.
504-
This solution offers a more dynamic solution fully Oriented Object Programming approach over the regular Dictionary / JSON data structure.
505+
This solution offers a more dynamic, fully Oriented Object Programming approach over the regular Dictionary / JSON data structure.
505506

506507
```python
507508
from serpapi import GoogleSearch
@@ -516,7 +517,7 @@ assert r.search_parameters.engine, "google"
516517
```
517518

518519
### Pagination using iterator
519-
Let's collect links accross multiple search result pages.
520+
Let's collect links across multiple search results pages.
520521
```python
521522
# to get 2 pages
522523
start = 0
@@ -568,20 +569,20 @@ Examples to fetch links with pagination: [test file](https://github.com/serpapi/
568569

569570
### Error management
570571

571-
SerpAPI keeps error mangement very basic.
572+
SerpApi keeps error management simple.
572573
- backend service error or search fail
573574
- client error
574575

575-
If it's a backend error, a simple message error is returned as string in the server response.
576+
If it's a backend error, a simple error message is returned as string in the server response.
576577
```python
577578
from serpapi import GoogleSearch
578579
search = GoogleSearch({"q": "Coffee", "location": "Austin,Texas", "api_key": "<secret_key>"})
579580
data = search.get_json()
580581
assert data["error"] == None
581582
```
582-
In some case, there is more details availabel in the data object.
583+
In some cases, there are more details available in the data object.
583584

584-
If it's client error, then a SerpApiClientException is raised.
585+
If it's a client error, then a SerpApiClientException is raised.
585586

586587
## Change log
587588
2021-12-22 @ 2.4.1

0 commit comments

Comments
 (0)