Reputation: 1066
Not sure what I'm doing wrong here. I have been following these instructions fully.
Anyways, I am trying to use Google custom search API. I have my API and CS key. I enter the following, with appropriate info filled in, but it says I am missing the q parameter when I am clearly not. Any ideas what I am doing wrong?
curl https://www.googleapis.com/customsearch/v1?key=INSERT_YOUR_API_KEY&cx=017576662512468239146:omuauf_lfve&q=lectures
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required parameter: q",
"locationType": "parameter",
"location": "q"
}
],
"code": 400,
"message": "Required parameter: q"
}
}
Upvotes: 2
Views: 3017
Reputation:
The Google API states that "q" or the query is necessary to run.
Parameter name Value Description Required query parameters cx string The custom search engine ID to use for this request. q string Query
https://developers.google.com/custom-search/v1/cse/list
Upvotes: 1
Reputation: 3551
The colon in the cx parameter must be URL encoded., i.e. 017576662512468239146%3Aomuauf_lfve
. Using jQuery $.get with a params object will do this for you if you like.
Upvotes: 1