T
T
Taras Labiak2014-05-25 18:10:21
Google Custom Search
Taras Labiak, 2014-05-25 18:10:21

Is it possible to use the Google Custom Search API to search for more than just certain URL patterns?

You need to add image search to the site (from any sites) using the Google Custom Search API, but here's the problem - the url template is required (parameter cx or cref)

GET https://www.googleapis.com/customsearch/v1?q=xbox&key={YOUR_API_KEY}
 
{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "conditionNotMet",
    "message": "Need to provide a Custom Search Engine ID. Missing cx or cref parameter.",
    "locationType": "header",
    "location": "If-Match"
   }
  ],
  "code": 412,
  "message": "Need to provide a Custom Search Engine ID. Missing cx or cref parameter."
 }
}

Is it possible to search all sites using this API?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andreyv, 2014-07-18
@kissarat

Yes, for this you need to create a search engine here - https://www.google.com/cse/all and tell it what to search on the entire Internet. The identifier of this PS must be used in the cx parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question