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.4.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: serpapi-0.1.4.tar.gz
  • Upload date:
  • Size: 12.5 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.4.tar.gz
Algorithm Hash digest
SHA256 3758e9c8cad6bc72dd9db96f055812e7fc385b158357a4837cd39eb6e6223f4c
MD5 05450f672972460eca056480070cdffe
BLAKE2b-256 42c24c5ff37cd63cbfbbb8a8d4e4f19e96fc0b215c73e2fe98556f8f597cdec3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: serpapi-0.1.4-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.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b14062ff8560b120e33919ff6c8d4104df19a83de1b74e65f047806b7ad68abb
MD5 8b44c90cd0969d8f3a14124ce8a00205
BLAKE2b-256 db11666b8acb353a8a440eea8c0371d11278ec254a9289e5743fc021d9f45949

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