Skip to main content

The official Python client for SerpApi.com.

Project description

SerpApi Python Library & Package

serpapi python library logo

Package

serpapi-python

This repository is the home of theofficial Python API wrapper for SerpApi (https://serpapi.com). This serpapi module allows you to access search data in your Python application.

SerpApi supports Google, Google Maps, Google Shopping, Bing, Baidu, Yandex, Yahoo, eBay, App Stores, and more. Check out the documentation for a full list.

Installation

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.

Usage

Let’s start by searching for Coffee on Google:

>>> import serpapi
>>> s = serpapi.search(q="Coffee", engine="google", location="Austin, Texas", hl="en", gl="us")

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 first result:

>>> s["organic_results"][0]["link"]
'https://en.wikipedia.org/wiki/Coffee'

Let’s print the title of the first result, but in a more Pythonic way:

>>> s["organic_results"][0].get("title")
'Coffee - Wikipedia'

The SerpApi.com API Documentation contains a list of all the possible parameters that can be passed to the API.

Documentation

Documentation is available on Read the Docs.

License

MIT License.

Contributing

Bug reports and pull requests are welcome on GitHub. Once dependencies are installed, you can run the tests with pytest.

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

serpapi-0.1.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

serpapi-0.1.2-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file serpapi-0.1.2.tar.gz.

File metadata

  • Download URL: serpapi-0.1.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for serpapi-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c5ac6fda3b4e149bbab0d4148e2dfcaedd1df765765e4af78de01df2b392af18
MD5 1c21f87dffaa00257abcc9f51c947352
BLAKE2b-256 cc8814a68797340ffc5b3f0e0136f409377b54eb157fe6e33e3e8cd9fd44e9dd

See more details on using hashes here.

File details

Details for the file serpapi-0.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: serpapi-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for serpapi-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 345041efc1ba13bb76645596abde7551a346be92a5a1f980bc5478e190ce7513
MD5 aa6e83da32d914d654c0e7614a19c66b
BLAKE2b-256 623a298614aa9b25a47e76796afa643d7837d43db2e44884145f85371b974124

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