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 the official 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.3.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: serpapi-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 b131aaed507e060753e9fac967142df213379d34f9050f327994ad3059d020bd
MD5 b28538529c846f70df2d37c341f66aeb
BLAKE2b-256 f223aeb4d293ffea308b99ba05bd5eb018ecc7fc80ec1480343359ede7d5d793

See more details on using hashes here.

File details

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

File metadata

  • Download URL: serpapi-0.1.3-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.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c3e96917f61b4e56af69836c40e3ccfd8ed1d9390bba5411d2787901b067da7d
MD5 cbbe476a7f8d0b2e107d3f8a0331cbd7
BLAKE2b-256 3df06e7843841672a484bd13fcf243cc07f911b5188363bb4a389d62bf1938c0

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