hi Jeremy Geerdes,
thank you very much.But there is still a question ,the url
http://code.google.com/apis/console can't open.
when i run following java application:how can i get the client key??
public class GoogleAPITest {
public static void main(String[] args) {
String clientKey = "xxxxx"; //client key
String query = "search content";//search content
GoogleSearch s = new GoogleSearch();
s.setKey(clientKey);
try {
s.setQueryString(query);
s.setLanguageRestricts("lang_cn");
GoogleSearchResult r = s.doSearch();
System.out.println("Google Search Results:" + r.toString());
FileWriter fw = new FileWriter("result.txt");
fw.write(r.toString());
fw.close();
} catch (GoogleSearchFault f) {
System.out.println("The call to the google Web APIs failed:\n" +
f.toString());
} catch (Exception e) {
e.printStackTrace();
System.out.println("wo,it's wrong!");
}
}
}
thanks again.
2011/9/29 Jeremy Geerdes <[email protected]>
> Depending on which library you're using, you will likely need to send an
> HTTP_REFERER header as well, which will require a valid website. Generally,
> we recommend setting up - at the very least - a single page on a free
> hosting service. This page should contain some basic information about your
> non-web application, including a way to contact you in the event that
> something goes wrong and Google needs to contact you. You can then use this
> page's URL to generate your API key.
>
> All of that said, you should be advised of two things:
>
> The API key is not actually required for the AJAX APIs family. This
> includes Search, Feeds, Language, etc.
>
> Most of the AJAX APIs family has been deprecated, including Search (e.g.,
> Web, Image, Local) and Language. This means that, while Google will continue
> to support them, the support will be minimal. And you can expect the
> services to be discontinued at some point prior to May 2014. Notably, the
> Language API will be shut down in December 2011. The successors to these
> services do require API keys, but they are NOT the same eys that you can
> obtain through the old signup form. Instead, you need to utilize the API
> Console to activate these services. You can check that out at
> http://code.google.com/apis/console
>
> Jeremy R. Geerdes
> Generally Cool Guy
> Des Moines, IA
>
> For more information or a project quote:
> [email protected]
>
> If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan
> Church!
>
> On Sep 29, 2011, at 7:23 AM, yunke liu wrote:
>
> > now i want to get google license key used in java application.
> > how can i get the key?
> > in following url
> http://code.google.com/intl/zh-CN/apis/loader/signup.html
> > , it need a "
> > My web site URL",but my program is just a java class.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Google AJAX APIs" group.
> > To post to this group, send email to
> > [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > To view this message on the web, visit
> > http://groups.google.com/group/google-ajax-search-api?hl=en_US
> > For more options, visit this group at
> > http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Google AJAX APIs" group.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> To view this message on the web, visit
> http://groups.google.com/group/google-ajax-search-api?hl=en_US
> For more options, visit this group at
> http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
To view this message on the web, visit
http://groups.google.com/group/google-ajax-search-api?hl=en_US
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en