Google Custom Search API Hangs Error

I am new to stackoverflow, so please be patient with me :)

I am trying to access using the Google UI API. But I come back that I do not understand.

My request is as follows:

https://www.googleapis.com/customsearch/v1?&key=********&q=red%2Bsox&cx=**********&start=0&num=10&cr=countryCA&lr=lang_fr&client=google-csbe&output=xml_no_dtd 

And will it work out?

 string '{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Value"}],"code": 400,"message": "Invalid Value"}}' (length=172) 

What am I doing wrong? I want the result from Google to appear.

Thank you in advance:)

+6
source share
1 answer

You do not have cx. Take a look at the answer. It happens that this api is mainly used to add search options for your site, you need to specify a custom search engine (for example, search only your site). If you want this to be done by searching the Internet by code, you need to do this. Add a fake site (where you would add a search text box), configure it (do a search on the Internet or on your site or something else), and then delete the fake site

Refresh

God, I just saw this. I'm sorry. Well, the problem is that you start at 0. Valid 1. Replace start = 0 at start = 1, and I think it would be nice for you to go. Take a look at this for valid values ​​for the start parameter of the official page.

+4
source

All Articles