Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google API returning different results than website

Tags:

google-api

When I do a site-specific search on google.com:

site:http://one-month-of-chat-logs.github.io security

I get 12 results. I signed up for a custom search engine (cx: 015271449006306103053:mz6wkimeenc) and API key, and I get only 3 results when I run the same search:

$ curl 'https://www.googleapis.com/customsearch/v1?key=$MY_API_KEY&cx=015271449006306103053%3Amz6wkimeenc&q=security'

Why do the results differ? Is my API request actually querying something different than the search I performed on google.com?

like image 927
aaronstacy Avatar asked Nov 24 '13 23:11

aaronstacy


People also ask

How do I get more than 10 results on Google API?

IF YOU ARE USING THE API Google Custom Search and Google Site Search return up to 10 results per query. If you want to display more than 10 results to the user, you can issue multiple requests (using the start=0, start=11 … parameters) and display the results on a single page.

Is there an API for Google search results?

Google Search APIs are interfaces that allow you to extract google search results. The best google search APIs often let you build websites and programs to let you access SERPs (Search Engine Results Pages). One can use these APIs to retrieve search results for specific parameters, depending upon the user's wish.

Does Google have an API?

Stay organized with collections Save and categorize content based on your preferences. Google Cloud APIs are programmatic interfaces to Google Cloud Platform services.


1 Answers

This google page has what you are looking for https://support.google.com/customsearch/answer/70392?hl=en

your results are unlikely to match those returned by Google Web Search, for several reasons:

  1. Even if a custom search engine is configured to search the entire web, it’s designed to emphasize results from your own sites.
  2. Your custom search engine doesn’t include Google Web Search features such as Oneboxes, real-time results, universal search, social feaures, or personalized results.
  3. If your custom search engine includes more than ten sites, the results may be from a subset of our index and may differ from the results of a 'site:' search on Google.com.
like image 110
Michael Avatar answered Oct 14 '22 23:10

Michael