Posts tagged ‘API’

September 3, 2011

Prediction API Part 2

Motivation

In my initial coverage of the Google Prediction API, I was very curious why Google would be so magnanimous as to open up this API for public use. This is a plausible answer from Google:

We do not describe the actual logic of the Prediction API in these documents, because that system is constantly being changed and improved. Therefore we can’t provide optimization tips that depend on specific implementations of our matching logic, which can change without notice.

An older prediction API

Based on some of the user comments in the Google group for the Prediction API, I would guess that it is one of the more difficult of all Google APIs to understand and use. Similarly, it will probably be challenging to get meaningful results. A great deal more information is available in the Prediction API developer guide. It includes an example (with detailed instructions): An application for movie recommendations.

Requirements

Google advises that all the following are prerequisite for using the Prediction API:

  • an active Google Storage account
  • an APIs Console project with both the Google Prediction API and the Google Storage for Developers API activated

And of course, a Google account! See getting started for further details.

Free but not forever

Nor is the Prediction API free of charge indefinitely. According to the initial terms, usage is free for all users for the first six months, up to the following limits per project:

  • Predictions: 100 predictions/day
  • Hosted model predictions: Hosted models have a usage limit of 100 predictions/day/user across all models
  • Training: 5MB trained/day
  • Streaming updates: 100 streaming updates/day
  • Lifetime cap: 20,000 predictions

This free quota expires at the end of the six month introductory period. The introductory periods begins the day that Google Prediction is activated for a project in the Google APIs console. Remember that charges associated with Google Storage must be included to figure total cost. Presumably this is an API that Google won’t be deprecating without replacement any time soon. However, there is a separate Terms of Service for the Prediction API, which does give Google the right to do exactly that. I think that is standard language though, as Google is not contractually bound to support a free, or even paid but unprofitable service unless explicitly specifically stated.

Summary

The Google Prediction API is probably best used as a sandbox. It may be helpful for deciding whether one wants to use machine learning for predictive purposes. If one decides to go ahead with this approach, there are probably more suitable alternatives than the Google Prediction API for an application intended for production use.

July 21, 2011

Maps minus the map

With the approach of Google’s massive API deprecation at year-end, I have paid closer attention than ever to Google products. (The API deprecation news was followed by an announcement about winding down Google Labs earlier this week).

I really enjoy Google Maps, whose API is among the deprecated. While reading more about it, I happened to notice a most unusual looking Google-esque map.

This had that distinctive look and feel of Kotke to me. Although the image, see below, appeared on the Programmable Web blog, I promptly unearthed evidence that was highly suggestive of a Kotke origin. The title revealed all.

Google Maps without the Map

Google styles in maps

Showing off Google styles in Google Maps. Without the map.

I highly recommend giving it a try. Visit Maps without the Map for entrée. Try accessing some of the usual Google Maps features, like Streetview. I was pleasantly surprised at how well the version without the map, so to speak, is integrated with the real Google Maps. The sans map version uses JavaScript along with some CSS-like functionality for color choices.*

For explanatory details see the Programmable Web post (September 2010).

For visual fun, play with this image gallery of Google Maps Styles, and this excellent tutorial** on how to get the most out of Google Map Styles in general.

For specific usage guidelines, review the Google Maps Styles documentation.

Notes

*    Take a look at the map footer. The plain white Google logo featured in the sans map version is amusing!
**  I found the Google Maps Styles tutorial (May 2011) on the rather excellent BestFromGoogle website, an unofficial Google-themed blog. It is much more substantive than my own modest Google hobby blog. Features include code snippets, various tutorials and other cool stuff, in a readable, well-designed format.

July 10, 2011

Prediction API

The recent release of the Google Prediction API Version 1.2 seemed oddly, well, magnanimous to me! Given the investment of intellectual capital and resources, I am surprised that Google would be so generous.  Allowing access to the Prediction API means that Google is giving access to its in-house machine learning algorithms to external users.

1939 Ford pick-up truck

1939 Ford pick-up truck will not likely use the Google Prediction API though other Ford products will

The official Google Code blog post, Every app a smart app, dated 27 April 2011, suggested many possible uses for the Prediction API. Some of the more interesting included:

The last item on the list has the potential, but not certainty, of causing serious privacy concerns. I’m guessing that customer feedback based on structured data is another potential use for the API.

I noticed that Ford Motor Company has plans for the Prediction API, specifically for commuters driving electric vehicles (EV). Apparently, there is a fair amount of “EV anxiety” due to limitation on range of travel. The Prediction API could be used to mitigate those concerns. AutoBlog is an online publication for automobile enthusiasts. It featured a great slide show demonstrating how Ford intends to make use of the Google Prediction API.

The Prediction API is available on Google Code. This is not the first release of the Prediction API. I’m uncertain whether versions before 1.2 were restricted in some way. (Google often grants API access to developers initially, and later, after ironing out any bugs or unexpected problems, opens the product to the public.)

Do be aware that a Google Storage account is required for access. Visit the Google API Console to get started.

June 27, 2011

Google Translation Story Continues

Last month, developers whose applications and websites depended on the Google Translate API and the underlying Google machine translation were shocked by an unexpected announcement.

Google Says Translate and other APIs WILL be deprecated

Google APIs are deprecated all the time. Usually they are replaced with comparable services or APIs.

But that morning was not like anything else. That morning became cruel and sad when the world heard the news. The linguists and webmasters were taken aback, shocked and stuttered in disbelief. The world learnt on May 26, 2011 that Google is no longer going to support its free machine translator also known as Google Translate

via Lackuna.com: Slaughtering Machine Translators – Who Is Going To Replace Google? 

The Translate API documentation on Google Code makes the situation very clear:

The Google Translate API has been officially deprecated as of May 26, 2011. Due to the substantial economic burden caused by extensive abuse, the number of requests you may make per day will be limited and the API will be shut off completely on December 1, 2011.

Regional languages of India by geographical location on the map

Regional map of India

Google suggests the Translate Element as an alternative to the API for website translation and similar needs.

Welcome to the Indic web

Deprecation of the Google Translate API does not mean an end to human usage of Google Translate.

This becomes very clear with this June 21 announcement on the official Google blog, Google Translate welcomes you to the Indic web. Google Translate announced support of five languages, in alpha* status: Bengali, Gujarati, Kannada, Tamil and Telugu.  According to the post,

In India and Bangladesh alone, more than 500 million people speak these five languages.

Special fonts need to be downloaded to use Google Translate with these Indic languages. The post has links to get access to these fonts, free of charge.

It is not clear whether these five alpha languages will be included in the deprecated Translate API before it is taken offline permanently on December 1, 2011.

* Google Translate introduced nearly a dozen alpha languages since 2009. At present, Google Translate supports 63 languages.

March 7, 2011

Authentication and Authorization

Access control has two components, referred to collectively as auth.

Third-party applications often require limited access to a user’s Google Account… all requests for access must be approved by the account holder.

via Authentication and Authorization for Google APIs.

Authentication services

Authentication refers to the process of allowing users to sign in to websites. In the context of this blog, it also refers to sign in to applications using a Google Account, or an OpenID 2.0 based protocol. When Google authenticates a user’s account, it returns a user ID to the web application. This allows user information to be stored and collected. Open ID also allows access to certain user account information, with the user’s approval.

Authorization services

OAuth Logo

OAuth

Authorization is often confused (by me, maybe others) with authentication. Authorization lets a user authorize access by applications to specific data associated with the user’s Google account.

OAuth 2.0 Protocol

The OAuth 2.0 open-standard protocol allows users to authorize access to their data, after successful authentication. Google supports the OAuth 2.0 protocol with bearer tokens for web (and installed) applications. Regular Google account data and Google Apps account data are accessible with OAuth 2.0. OAuth 2.0 relies on SSL for security instead of direct cryptographic signing that would otherwise be necessary for such access.

Note that OAuth 2.0 has not been finalized, according to IETF (version 13). Google cautions that it’s OAuth 2.0 support is in an early preview and may change at any time, or as the final specifications evolve. Google considers OAuth experimental.  However, “experimental” does not have the same tentative connotation associated with Google Labs projects.

OAuth 1.0 Protocol

There is also an OAuth 1.0 for web applications. OAuth 1.0 can be used for authorization to user data by all Google API’s. Google continues to support OAuth 1.0.*

* OAuth 1.0 is sometimes referred to in documentation without version number, only as OAuth.

Other protocols

The OpenID-OAuth hybrid protocol provides authentication and authorization in a single-step process. Open ID provides authentication services, and OAuth provides authorization to Google APIs.

AuthSub API is Google’s proprietary protocol. It is mostly used for Google APIs. AuthSub is similar to OAuth. OAuth is more generally applicable and Google recommends that developers use OAuth instead of AuthSub API.

Registration

Registering a web application is optional. It is also free and straightforward. Web applications that are not registered with Google can still use OAuth 1.0 or AuthSub interfaces. However, registered web applications are recognized by Google and receive a correspondingly higher level of trust designation. This is communicated to users on the login screen.

Example of access request screen for OAuth or AuthSub web app

Sample Google access request screen for unregistered web application

Summary

These are the three levels of registration:

  1. Unregistered These applications conduct transactions at a lower security level.  Google flags the user login page with a precautionary message.  See image above with yellow-shaded advisory.
  2. Registered and recognized but not configured for secure requests
  3. Registered with enhanced security These applications have a security certificate and can use secure tokens.
Follow

Get every new post delivered to your Inbox.