Java GDS API v2


GDAPI is a simple java api for access desktop search from any other java application.
Google Desktop Search is a desktop search application that provides full text search over your email, computer files, chats and web pages you've viewed. (
GDAPI v2 uses COM Query API of Google Desktop.

GDAPI v1 is the old implementation that uses the deprecated XML Query API of Google Desktop.


Download the latest release from


JGDQuery query = new JGDQuery("gmail"); // constructs a new query (registration of GDAPI is started if it's the first time)
query.setNum( 5 );
Results results = query.execute();
int count = results.getCount();
out.println("count = " + count);
List l = results.getResult();
for (Iterator i = l.iterator(); i.hasNext();) {
GoogleDesktopIndexable element = (GoogleDesktopIndexable);
out.println(" > " + element );

System.out.println ( element.get_content() );



GDAPI must be installed in the same machine that Google Desktop. So it requires Windows XP, Windows 2000 SP 3+ or Windows Vista.
The minimum version of Google Desktop supported is 5.0
The minimum version of Java supported is 1.5


Unpack ZIP archive released, then add all JAR files to CLASSPATH.
Note that x86 directory must be in the same directory that jacob.jar (this version uses only x86 compilation of jacob native dll)

GDAPI v2 needs to be registered by each user in their computers (It is mandatory for Desktop API). This is an authomatic process but needs user confirmation. A cookie will be stored in a file into x86 directory. This cookie represents a register handler.

GDAPI v2 was not tested into any application server. Any comments or information about this well be welcomed.


GDS API javadoc


Thanks to Arne Solheim for his great code.

This software uses:

- Jacob (Java COM Bridge) 1.13 at
License: GNU Library or Lesser General Public License (LGPL)
Thanks to Dan Adler, clay_shooter and team for this good software.

Copyright 2005,2006 The Apache Software Foundation.

License: Licensed under the Apache License, Version 2.0 (