I'm having difficulty figuring out the right format for URL calls to a Google Custom Search Engine (CSE) to return results in XML (using their free service for 100 calls per day). I've set up an account and CSE. So now I have a public URL https://www.google.com/cse/publicurl?cx=010317493064298903457:5bsx2whinf8
to search BBC news. But I can't figure out from the documentation how to develop the URL call to return results in XML format..
https://www.google.com/cse/publicurl?cx=010317493064298903457:5bsx2whinf8&q=london&start=0&num=10&output=xml_no_dtd
(based on the code provided in the CSE setup options) gives results in html frame.
http://www.google.com/search?start=0&num=10&q=london&client=google-csbe&output=xml_no_dtd&cx=010317493064298903457:5bsx2whinf8
(following the XML API examples) also returns HTML.
Very grateful for an idea where I'm going wrong.
Cracked. The minimum working URL formula I've got to work is a concatenation of the following strings:
You should end up with something looking like this:
"https://www.googleapis.com/customsearch/v1?q=London+UK&cx=018475493028468909364:ldifwlodnso&key=AOgsDiRlzY7GDCKC5Th7yKutv-7Hd4-IDehl_Sp"
.. with results in json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With