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

Uploaded Source

File details

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

File metadata

  • Download URL: searchdata-1.0.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for searchdata-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2333cb360e4471887b1872a2856ca20bb6e76016b062e397e55609f65e969707
MD5 86310ac91d38306736bf1794c6a13744
BLAKE2b-256 b582186322a0005bbe36a10e8e03b12b5081146881f018970e0034665f9ed975

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