镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SerpApi Python Library & Package
[![Package](https://img.shields.io/pypi/v/serpapi?color=green)](https://pypi.org/project/serpapi) [![serpapi-python](https://github.com/serpapi/serpapi-python/actions/workflows/ci.yml/badge.svg)](https://github.com/serpapi/serpapi-python/actions/workflows/ci.yml)

Integrate search data into your AI workflow, RAG / fine-tuning, or Python application using this official wrapper for [SerpApi](https://serpapi.com).
Integrate search data into your AI workflow, RAG/fine-tuning, or Python application using this official wrapper for [SerpApi](https://serpapi.com).

SerpApi supports Google, Google Maps, Google Shopping, Baidu, Yandex, Yahoo, eBay, App Stores, and [more](https://serpapi.com).

Expand All @@ -15,7 +15,7 @@ To install the `serpapi` package, simply run the following command:
$ pip install serpapi
```

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.
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.

## Simple Usage

Expand Down Expand Up @@ -47,7 +47,7 @@ Environment variables are a secure, safe, and easy way to manage secrets.

### Error handling

Unsuccessful requests raise `serpapi.HTTPError` or `serpapi.TimeoutError` exceptions. The returned status code will reflect the sort of error that occurred, please refer to [Status and Error Codes Documentation](https://serpapi.com/api-status-and-error-codes) for more details.
Unsuccessful requests raise `serpapi.HTTPError` or `serpapi.TimeoutError` exceptions. The returned status code will reflect the sort of error that occurred; please refer to [Status and Error Codes Documentation](https://serpapi.com/api-status-and-error-codes) for more details.

```python
import os
Expand All @@ -66,7 +66,7 @@ except serpapi.HTTPError as e:
print(e.error) # "Invalid API key. Your API key should be here: https://serpapi.com/manage-api-key"
elif e.status_code == 400: # Missing required parameter
pass
elif e.status_code == 429: # Exceeds the hourly throughput limit OR account run out of searches
elif e.status_code == 429: # Exceeds the hourly throughput limit OR account ran out of searches
pass
except serpapi.TimeoutError as e:
# Handle timeout
Expand Down