The Search API endpoint: https://seo-api.p.rapidapi.com/v1/search/{query
For search the minimum query must have the q
parameter.
The News API endpoint : https://seo-api.p.rapidapi.com/v1/news/{query
This example is a simple search for the keyword “president election”. The query should be properly url encoded. So the query will end up being q=president+election
curl command:
curl -H "x-rapidapi-key: CHANGE_API_KEY" -H "x-rapidapi-host: seo-api.p.rapidapi.com" https://seo-api.p.rapidapi.com/v1/search/q=president+election
To specify the number of results to return specify the query parameter num
. To return 50 results use num=50
. To return 100 use num=100
. The default is 10 and the maximum is 100.
curl command to return the top 75 results:
curl -H "x-rapidapi-key: CHANGE_API_KEY" -H "x-rapidapi-host: seo-api.p.rapidapi.com" https://seo-api.p.rapidapi.com/v1/search/q=president+election&num=75
Use the parameter lr
to return the results in a specific language. To return results in English use lr=lang_en
. To return the results in Spanish use lr=lang_es
.
curl example to return results in French
curl -H "x-rapidapi-key: CHANGE_API_KEY" -H "x-rapidapi-host: seo-api.p.rapidapi.com" https://seo-api.p.rapidapi.com/v1/search/q=president+election&lr=lang_fr
To limit the search results from a certain location use cr
. For example limit the results in the Australia use cr=AU
. Or to limit the results in Canada use cr=CA
.
curl example to return results in Germany
curl -H "x-rapidapi-key: CHANGE_API_KEY" -H "x-rapidapi-host: seo-api.p.rapidapi.com" https://seo-api.p.rapidapi.com/v1/search/q=president+election&cr=DE
All these parameters can be combined to perform advance queries.
curl to query top 100 results for the keyword “coffee” in Spain
curl -H "x-rapidapi-key: CHANGE_API_KEY" -H "x-rapidapi-host: seo-api.p.rapidapi.com" https://seo-api.p.rapidapi.com/v1/search/q=coffee&cr=ES&num=100
The documentation for Serply is also powering this Google Search API.
Use this guide by Moz for more advance Google Search Parameters