Skip to main content

This is for google custom search api.

Project description

google-custom-search

Downloads !DOCS

How to use this package.

Next version can search image.

first please install this package

pip install google-custom-search

sample code

import google_custom_search

google=google_custom_search.custom_search(apikey="your api_key", engine_id="your engine_id")
# if image is True, it's can search, but you need to setting at google console search

result=google.search("Hello")

# get a list of title.
for title in result.titles:
  print(title)

# get a list of link.
for url in result.urls:
  print(url)

# get a list of displayLink.
for i in result.display_urls:
  print(i)

# get a list of htmlTitle.
for i in result.html_titles:
  print(i)

# get a list of snippet.
for i in result.snippets:
  print(i)

sample code async version

import asyncio
import google_custom_search

google=google_custom_search.custom_search(token="your api_key", engine_id="your engine_id", image=True)
# if image is True, it's can search, but you need to setting at google console search

async def main():
  result=await google.search_async("word!")
  for i in result.titles:
    print(i)
  for i in result.urls:
    print(i)
  for i in result.display_urls:
    print(i)
  for i in result.html_titles:
    print(i)
  for i in result.snippets:
    print(i)

loop = asyncio.get_event_loop() 
loop.run_until_complete(main())

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

google-custom-search-0.1.4.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

google_custom_search-0.1.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file google-custom-search-0.1.4.tar.gz.

File metadata

  • Download URL: google-custom-search-0.1.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for google-custom-search-0.1.4.tar.gz
Algorithm Hash digest
SHA256 35a6d6bf562898166f49efb12a26784ece8829ca63b4162903570c66262c0db9
MD5 27e04edf94cbd0d62441e8b910f45482
BLAKE2b-256 4925b62cfb89415203729c71949bca4543a295a6c7a3634b90236324e4438f38

See more details on using hashes here.

File details

Details for the file google_custom_search-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: google_custom_search-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for google_custom_search-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e9db1ebc5c8910f35e7569c05ead158f9a91676a1cb6f69cce540a80bc80979e
MD5 c0918d96f089ccafa6b373b90e511ea9
BLAKE2b-256 8fa2c260d7140c882ca48d260f787ed9f4fb84612b26f79dd3e511c3d1ddc17f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page