Search code examples
restgoogle-custom-search

Google Search API - getting "regular" Google result


I want to do some Google searches and get the same result as I would search on www.google.se (I'm in Sweden). I've created a Google API account to get an API key here, https://code.google.com/apis/console/b/0/.

I call the API like this:

https://www.googleapis.com/customsearch/v1?key=KEY&cx=013036536707430787589:_pqjad5hr1a&gl=se&cr=se&googlehost=google.se&q=bästa espressomaskin&alt=json

However this gives different results from searching on "bästa espressomaskin" like I normally would, and I can't figure out why.

The second question I have is about the parameter "cx". What is it actually and what does it do? I just used the one provided at the Google API introduction site.

I also want more than 10 results, my API Console account has some dollars on it, but how do I make it possible to set my "num"-parameter to more than 10?

Thanks


Solution

  • cx is the Google key you get for signing up for their custom search service. It allows you to customize your search. See here for more information: https://developers.google.com/custom-search/v1/getting_started

    As for results, Google says in their documentation that your results may vary. See here for more information: http://support.google.com/customsearch/bin/answer.py?hl=en&answer=2633385