How do I access the XML from the Google Mini / GSA?

January 26, 2006 in Google Mini,GSA,Q&A,XML API | Comments (8)

As well as the standard web interface, the Google Mini and Google Search Appliance have an XML interface which gives you a results set back in XML.

To access the XML, you use a scripting language to use HTTP GET with a particular URL:

For XML without a DTD:
http://www.miniaddress.com/search?q=searchphrase&output=xml_no_dtd &client=collectionname&site=collectionname

Where ‘www.miniaddress.com’ is the address of your search appliance (this can also be an IP address,) ‘collectionname’ is the name of your collection, and ‘searchphrase’ is what you are searching for.

If you want the DTD, change output=xml_no_dtd to output=xml

You can set lots of flags in the URL to do things like change the start number of the results set, or change the encoding of the results coming back to UTF-8 or latin. You can look up the various flags in the GSA XML reference.

Comments (8)

RSS feed for comments on this post.

  1. Comment by Steve Harrison — April 13, 2007 @ 9:45 pm

    “You can look up the various flags in the GSA XML reference.”

    Hi, it seems like that reference link no longer exists. And good alternatives? I’ve been tasked to consume th’ XML via .NET 2.0 (c#). Thanks.

  2. Comment by Paul — April 16, 2007 @ 8:13 am

    Thanks Steve, I’ve updated the link to the new home of the XML doc

  3. Comment by Mike Des — May 18, 2007 @ 12:36 pm

    Could you be kind enough to post a PHP example of this could you?

    Thanks

  4. Comment by Paul — May 18, 2007 @ 1:08 pm

    Hi Mike,

    I can happily show the fopen or cURL way of getting the XML back, but I won’t be putting up the PHP code for parsing the XML or doing anything with it, because I usually get to charge clients for that. Admittedly, that’s the PHP4 code. If you’re getting the choice, it’d be much easier for you to do the work in PHP5 where the XML parsing is much better.

    Cheers

    Paul

  5. Comment by hazarth — December 21, 2007 @ 10:42 am

    i implemented gsa search functionality to my appilications
    while searching with “testing” the output is not comming

  6. Comment by Peter Knaggs — July 16, 2012 @ 9:09 am

    Both GSA XML reference links are broken.

  7. Comment by Paul — July 17, 2012 @ 10:07 am

    Hi Peter, I’ve updated the link to the new home for the GSA XML documentation

    I do wish Google would put in re-directs for this stuff. You’d think they’d understand the need for that, what with being a search engine and suggesting other people do it.

  8. Comment by Sebastian Felix Schwarz — August 30, 2012 @ 2:48 pm

    Hi, i have a problem getting the FULL XML from my GSA!
    Putting my query in the Browser-Adress-Field it returns the right XML with all item. Using CURL only returns the META-Content WITHOUT the RES-Node.

    0.022841
    angelschein

    What happend? I tried also: file_get_contents() … no success.

Leave a comment

Sorry, the comment form is closed at this time.