Getting Started
To authorize your API call, append the api_key parameter to the url:
https://api.searchdata.io/v1?api_key=YOUR API KEY
After creating a Searchdata account, the account dashboard will reveal the unique API access key you can use to authenticate with the API. To do so, simply attach the api_key parameter to the API’s base URL and set it to your API access key.
Example:
https://api.searchdata.io/v1?api_key=YOUR API KEY&q=pizza
In the following code examples, we use a dummy API key of XXXXXX. Please replace it with your real API key.
If your request fails, the Searchdata will return an error in JSON format. Find to the right an example error that occurs when the API failed scraping the requested URL.
Basic Request
To scrape the results from Google’s search engine using Searchdata, simply use the API’s base endpoint and append the query you are searching for as well as your API access key as GET parameters. There is also a series of optional parameters you can choose from. In the right side box you will find an example request used to scrape for the query “pizza”.
Rendering JavaScript
Some elements are injected after the initial load, but Searchdata is capable of accessing said content using a headless browser and allows JavaScript page elements to render before delivering the final scraping result.
Proxies
Searchdata is making use of a pool of 100+ million IP addresses worldwide, making your requests impossible to unblock. We keep residential IPs together with mobile IPs in the same pool.
Searchdata supports more than 195 global geolocations your scraping request can be sent from.
What are Residential Proxies?A dedicated residential proxy is an IP address provided by an ISP (Internet Service Provider) to a homeowner. It is a real IP address attached to a physical location. So basically, whenever you move to a new location and set up your internet, your ISP will provide you with an IP address.
While these proxies are the most common proxies used on the internet, they are also much more likely to get blocked on an IP-basis when attempting to scrape data.
The main difference between datacenter and residential proxies lies in the source of the IP. All other differences that arise rely on the differences between household machines and servers.
Geolocation
Using the location OR uule parameter, you can choose specific locations where you want your request to originate from. Here is an example using the uule parameter for West New York, New Jersey, United States.
Residential Proxies Supported CountriesYou can download a full list of supported countries and 2-letter country codes using the following link
Example:
https://api.searchdata.io/v1?api_key=YOUR_API_KEY&engine=google&location=%221019999%22%2C%22New%20York%20Mills%22%2C%22New%20York%20Mills%2CMinnesota%2CUnited%20States%22%2C%2221156%22%2C%22US%22%2C%22City%22%2CActive&q=test
Device Settings
The device parameter of the API allows you to run searches on desktop
, tablet
or mobile
which can be useful as Google tends to show slightly different results based on the device used by the user.')
Example:
https://api.searchdata.io/v1?engine=google&api_key=YOUR_API_KEY&q=history&device=desktop
Conclusion
Searchdata.io is a fundamental building block in your scraping pipeline. I provides the essentials and a highly scaleable service to developers that want to scrape en masse.