Skip to main content

API wrapper for the Google Custom Search JSON API. https://developers.google.com/custom-search/v1/overview

Project description

CircleCI Build Status Codestyle PyPI version Issues LICENSE Downloads Python

async-cse

Asyncio API wrapper for the Google Custom Search JSON API.

Installation

Want stable releases?

pip3 install -U async_cse

Living on the edge? Want hotfixes?

pip3 install -U git+https://github.com/crrapi/async-cse

Usage

import async_cse

client = async_cse.Search("Your API Key") # create the Search client (uses Google by default!)

results = await client.search("Python", safesearch=False) # returns a list of async_cse.Result objects

print(results[0].title, results[0].description, results[0].url, results[0].image_url) # Title, snippet, URL, and Image URL

await client.close() # Run this when cleaning up.

Getting image results

import async_cse

client = async_cse.Search("Your API Key") # create the Search client (uses Google by default!)

results = await client.search("Python", safesearch=False, image_search=True) # returns a list of async_cse.Result objects

print(results[0].title, results[0].description, results[0].url, results[0].image_url) # Title, snippet, URL, and Image URL

await client.close() # Run this when cleaning up.

To use Search objects with a custom search engine, provide the ID of the search engine.

async_cse.Search("Your API Key", engine_id="015786823554162166929:mywctwj8es4")

SafeSearch can also be turned off by setting safesearch=False when using the search() method.

Getting an API key

You can get an API key by going here and scrolling down to the API key section. API key

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
async_cse-0.2.8.tar.gz (4.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page