问题
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?
回答1:
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:
- Even if a custom search engine is configured to search the entire web, it’s designed to emphasize results from your own sites.
- Your custom search engine doesn’t include Google Web Search features such as Oneboxes, real-time results, universal search, social feaures, or personalized results.
- 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.
来源:https://stackoverflow.com/questions/20182667/google-api-returning-different-results-than-website