Skip to content

API Interaction

Client

class cse.Engine(api_key: str,*, engine_id: str="015786823554162166929:mywctwj8es4", image_engine_id: str="015786823554162166929:szgrbbrrox0", session: aiohttp.ClietSession=None)

Atributes

api_key

Get your Google API Key from here

Type:

str

engine_id

Type:

Optional[str]

image_engine_id

Type:

Optional[str]

session

Type:

Optional[aiohttp.ClientSession]

Method

await search(query: str,*, safesearch=True, image_search=False)

Search for a query

Parameters:

  • query (str) - The query you want to search for

  • safesearch (Optional[bool]) - It won't search for NSFW content if True.

    Default: True

  • image_search (Optional[bool]) - It won't get any image if False

    Default: False

Returns:

  • Return Type:

    Optional[list]

Close

await close()

Close the connection

Parameters: None

Result

class cse.Result

title

The title of the search result

Returns:

  • Type:

    Optional[str]

description

A short description of your search result

Returns:

  • Type:

    Optional[str]

url

The link of your search result

Returns:

image_url

The image link of your search result

Returns:

  • Type:

    Optional[str]