Skip to main content

Searchdata Python SDK

Project description

Searchdata Python SDK

SearchData is an API that allows scraping various search engines such as Google, Bing, Yandex, etc. while using rotating proxies to prevent bans. This SDK for Python makes the usage of the API easier to implement in any project you have.

Installation

Run the following command in the main folder of your project:

pip install searchdata

API Key

To use the API and the SDK you will need an API Key. You can get one by registering at Searchdata

Classes

This SDK provides a class for each search engine from searchdata.io. Here is the list:

Class Usage
SearchdataGoogleSearch google searches
SearchdataBingSearch bing searches
SearchdataYandexSearch yandex searches
SearchdataGoogleAutocomplete google autocomplete searches
SearchdataGoogleEvents google events searches
SearchdataGoogleJobs google jobs searches
SearchdataGoogleJobsListing google jobs listing searches
SearchdataGoogleMaps google maps searches
SearchdataGoogleMapsReviews google maps reviews searches
SearchdataGoogleProduct google product searches
SearchdataGoogleReverseImage google reverse image searches
SearchdataGoogleScholar google scholar searches
SearchdataGoogleScholarAuthor google scholar author searches
SearchdataGoogleScholarCite google scholar cite searches
SearchdataGoogleScholarProfiles google scholar profiles searches
SearchdataLocations locations api

Usage

Using the SDK it's quite easy. An example of a GET call to the API is the following:

from searchdata import SearchdataLocations, SearchdataGoogleSearch

searchdataGoogleSearch = SearchdataGoogleSearch('YOUR_API_KEY')
locationsAPI = SearchdataLocations()

response = locationsAPI.execute("Austin", 1)
locations = response.json()
location = locationsAPI.process_location(locations[0])
searchdataGoogleSearch.set_q("Test")
searchdataGoogleSearch.set_location(location)
searchdataGoogleSearch.set_lr('lang_en|lang_ar')
response = searchdataGoogleSearch.execute()

# print(response.status_code)
# print(response.headers);
print(response.json());

Alternatively, you can use the function executeRaw, which will allow you to send the parameters in an associative array:

from searchdata import SearchdataLocations, SearchdataGoogleSearch

searchdataGoogleSearch = SearchdataGoogleSearch('YOUR_API_KEY')
locationsAPI = SearchdataLocations()

response = locationsAPI.execute("Austin", 1)
locations = response.json()
location = locationsAPI.process_location(locations[0])
response = searchdataGoogleSearch.executeRaw({
    'q': 'test',
    'device': 'mobile',
    'lr': 'lang_en|lang_ar',
    'location': location
})

# print(response.status_code)
# print(response.headers);
print(response.json());

For a better understanding of the parameters, please check out our documentation.

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

searchdata-1.0.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

searchdata-1.0.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file searchdata-1.0.1.tar.gz.

File metadata

  • Download URL: searchdata-1.0.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for searchdata-1.0.1.tar.gz
Algorithm Hash digest
SHA256 edf6cb2b69b6dcf25219e6bb337a2c13890894766a4ca873eed7b133bdb127aa
MD5 d2b586bf2889f8c79197b1b31d7f3509
BLAKE2b-256 91f34284ce9ec51959d9f531d4ee3f46926317286016bebce8b1349adf237def

See more details on using hashes here.

File details

Details for the file searchdata-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: searchdata-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for searchdata-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 209f49f50ec285eb918fa51c83df9069c6c9e9f06ce13c5be28c28f686eec380
MD5 0cd7d02b4470f38f011159739b8236a7
BLAKE2b-256 95dc39c22536ebd927875b3eb95079b9b3fb0bcef87192c09fbc931aa01fae1d

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