An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to gostips@gmail.com.
Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

January 11, 2011

API for Google's URL Shortener

Google's URL Shortener has many advantages: it's fast (probably the fastest URL Shortener), it rarely goes down, it's integrated with Google Safe Browsing, it shows neat stats and it automatically generates QR codes. Unfortunately, Goo.gl didn't offer an official API and many application didn't support it.

Services like Goo.gl, Bit.ly or TinyURL are rarely used directly: Twitter clients automatically shorten links, browser extensions create short links, while content management systems convert the links so that people can share them. For example, Google Maps, Google Reader and Google News use Goo.gl to create short links for all their content.

Now other applications can use Goo.gl because there's an official API that's quite easy to use and has a generous limit of 1,000,000 queries/day. "You can use the Google URL Shortener API to programmatically interact with this service and to develop applications that use simple HTTP methods to store, share, and manage goo.gl short URLs from anywhere on the Internet," explains Google. The API lets you create short links, decrypt Goo.gl links, read stats and look up a user's history.


Google's new API can be used inside the new Dev Console that lets you manage multiple APIs, add traffic filters and get traffic reports.

{ via Google Code Blog }

November 9, 2010

Google Promotes Data Portability by Adding Restrictions to the Contacts API

Google found a strange way to show to the world that Facebook is a walled garden that traps your data: by blocking Facebook's access to the Google Contacts API. A Google spokesperson said that "users often aren't aware that once they have imported their contacts into sites like Facebook they are effectively trapped. We hope that reciprocity will be an important step towards creating a world of true data liberation—and that this move will encourage other websites to allow users to automate the export of their contacts as well."

Facebook users can still export their Gmail contacts and manually upload the file to Facebook, but Google Contacts API made this much easier. Facebook even found a direct URL that lets you export your contacts, so you don't have to visit Gmail.


Google may have good intentions, but that's a terrible way to treat users. After all, it's their data and it should be their choice to use services like Facebook.

To show that Facebook is not the only target, Google Contacts API includes some new terms of use: "Google supports data portability. By accessing Content through the Contacts Data API or Portable Contacts API for use in your service or application, you are agreeing to enable your users to export their contacts data to other services or applications of their choice in a way that's substantially as fast and easy as exporting such data from Google Contacts, subject to applicable laws."

That's like trying to make the web faster by asking developers that use the Google Analytics tracking code to make their sites as fast as Google Analytics.

Update: Danny Sullivan quotes a Facebook engineer who says that "the most important principle for Facebook is that every person owns and controls her information. Each person owns her friends list, but not her friends' information. A person has no more right to mass export all of her friends' private email addresses than she does to mass export all of her friends' private photo albums".

But that's not always the case, since Facebook allows Yahoo and Microsoft to build services that import your Facebook friends, while Google can't get that data. Danny concludes that "Facebook simply doesn't want you to mass export them into Google — not unless, I suppose, it gets a business deal with Google. And if it doesn't want to do a deal, then those emails don't get to go. They aren't yours. They belong to Facebook, and can only be exported to the business partners that Facebook agrees with."

Update 2: Google redirects users that want to download their address book directly from Facebook to a page titled "Trap my data now":

"Hold on a second. Are you super sure you want to import your contact information for your friends into a service that won’t let you get it out? Here's the not-so-fine print. You have been directed to this page from a site that doesn't allow you to re-export your data to other services, essentially locking up your contact data about your friends. So once you import your data there, you won't be able to get it out. We think this is an important thing for you to know before you import your data there. Although we strongly disagree with this data protectionism, the choice is yours. Because, after all, you should have control over your data."

April 21, 2009

API for Google Analytics

One of the few missing features from Google Analytics was the ability to access data programmatically. Now you can create application that use data from Google Analytics using the Data Export API.

"With the Google Analytics Data Export API, you can develop client applications that download Analytics data in the form of Google Data API feeds. Your client application can use the Data Export API to request data from an existing Analytics profile for an authorized user, and refine the results of the request using query parameters. Currently, the Data Export API supports read-only access to your Google Analytics data."

The API is useful to create different interfaces for Google Analytics and to process the data in interesting ways. For example, you might build a notifier that alerts you when your site has a large number of visitors or you could use the data to display a list of popular posts from your blog.

There are already some interesting applications that use the API, including a dashboard that integrates data from Google Analytics, a SEO tool that analyzes the keywords used to find the site, a mobile interface for Google Analytics and an AIR application.


"The Data Export API is easy to use and provides read-only access to all your Analytics data. Any data that's available through the standard Analytics web interface is available through the API. The Analytics API is a Google Data API. This is the same API protocol for Google Calendar, Finance and Webmaster Tools," mentions the Analytics blog.

If you don't think this news is very exciting, you should become a trusted tester for Google Analytics to try other cool features before they're publicly available. "Current Trusted Testers have recently tried out such features as: Event Tracking, Data Sharing, and Outbound Links."

September 17, 2008

Google Should Learn About Contacts APIs

Garett Rogers noticed a new option in the chat widget from the experimental iGoogle: invite friends to Google Talk. Unlike the similar feature from Gmail, iGoogle provides a simple way to import your contacts from Yahoo Mail, Hotmail, AIM and send mass invitations. The problem is that Google asks the username and password for a third-party email account, instead of using the APIs provided by Yahoo and Microsoft.


Google explains that it doesn't keep your username and password, but it's a really bad practice to teach your users to type their credentials on third-party sites. "Big internet companies stand to lose the most from widespread abuse of the anti-pattern, because they're the ones most likely to be targeted by phishers," says Simon Willison.

It's ironic that Google has a Contacts Data API and the introductory blog post has the following message:

"Have you ever been on a web-site that asked you for your Google username and password so that it can import your Gmail contact list? Did you think twice before giving out that information, hoping the web-site would not use it to access your credit card information stored with Google Checkout? Now you don't have to! We're happy to announce the availability of our Google Contacts Data API that gives programmatic access to your contact list. (...) We hope that APIs like this one mean you will never have to give out your username and password to other sites again. Please encourage all sites you use to switch to this API for accessing your Google contact data."

Flickr heard Google's message and it uses the contacts API to import the address book from Gmail. This way, Flickr doesn't have access to your password and it can only use a small portion of the data stored in your Google Account.

June 8, 2008

Interesting Ways to Use Google Chart API

College @ Home lists 50 ways to use Google Chart API, a simple API for dynamically generating charts. Plot functions, visualize the evolution of the number of subscribers to a FeedBurner feed, display the results of a poll, transform HTML tables into charts and much more. Of course, you can also use Google's charts just for fun.


If you only need to create a few charts, generators like Chart Maker, Google Chart Creator, Chartpart let you create charts without reading the documentation. To use Google Charts programmatically, check this list of wrappers for Java, C#, PHP, Python.

{ Thanks, Fiona. }

May 27, 2008

Google Hosts Popular JavaScript Libraries

If you've ever wanted to use a JavaScript library like script.aculo.us, Prototype, jQuery or Dojo, but you couldn't upload its files to a site or you found it difficult to manage all the different versions, Google hosts them for you.

"The AJAX Libraries API is a content distribution network and loading architecture for the most popular open source JavaScript libraries. By using the Google AJAX API Loader's google.load() method, your application has high speed, globally available access to a growing list of the most popular JavaScript open source libraries. (...) The AJAX Libraries API takes the pain out of developing mashups in JavaScript while using a collection of libraries. We take the pain out of hosting the libraries, correctly setting cache headers, staying up to date with the most recent bug fixes".

In addition to Google's APIs for search, maps, feeds and translations, you can now access AJAX libraries that add useful features like drag-and-drop, controls, animations or easier DOM manipulation. You can use Google as a fast proxy, but Google also caches the files related to iGoogle gadgets, the feeds that are served by Google Reader, and we should expect to see more content that can be accessed from Google faster and more reliably. In the future, Google could provide even more tools for a site: stats, monetization, search are useful, but what about using an unified Google API that lets you find facts, get spelling corrections, add ratings and forms, store data, add social features and code applications that run on Google's platform?

April 22, 2008

Google Search REST API

More than one year after Google discontinued the SOAP Search API, it finally got a proper replacement. The AJAX Search API can now be used from any Web application, not just in JavaScript. The other two Google AJAX APIs for feeds and translations were updated for non-AJAX use, as well.

"For Flash developers, and those developers that have a need to access the AJAX Search API from other Non-Javascript environments, the API exposes a simple RESTful interface. In all cases, the method supported is GET and the response format is a JSON encoded result set with embedded status codes."

"Using the APIs from your Flash or Server Side framework couldn't be simpler. If you know how to make an http request, and how to process a JSON response, you are in business," says Mark Lucovsky. Here's a simple example for web search:
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Earth%20Day

There are some differences between the old SOAP API and the REST one.

PROs:
- the new API doesn't require a key
- there's no limitation for the number of queries
- it's much easier to use
- you can use the REST API for web search, but also for image search, news search, video search, local search, blog search and book search.

CONs:
- you need to send "a valid and accurate http referer header"
- you can only get up to 8 results in a single call and you can't go beyond the first 32 results
- the terms of use are pretty restrictive: for example, you need to attribute the results to Google and you are not allowed to change the order of search results.

It's interesting to notice that Yahoo's search APIs are more developer-friendly and, although they require an application ID and have some usage limitations (5,000 queries per IP per day), they offer more features and they are more flexible, by also including XML output. Another important difference is that Yahoo doesn't require "a valid and accurate http referer header".

Philipp Lenssen suggests that it's much easier to just screenscrape the results, but search engines could change their code or block your requests.

Update. Check this excellent interview with Mark Lucovsky, who mentions that the API has been available for almost two years, but it wasn't officially documented:

March 20, 2008

Google Translate API

Google launched another AJAX API, this time for language detection and translation. The API works for the same language pairs that are available at Google Translate and lets you display the translation of a text inside your own page, without having to link to an external translation service.

The translation API could be used to automatically translate some content from a web page using the browser's preferred language, to create a Greasemonkey script that translates to English the posts written in other languages, to detect if a comment is written in English before posting it and for many other things.

Here's one example of use, where you can enter a text in one of the supported languages (Arabic, Chinese, French, German, Greek, Dutch, Italian, Japanese, Korean, Portuguese, Russian, Spanish), Google automatically detects the language and it shows the English translation. The sample text is from Le Monde.






March 19, 2008

Google Spreadsheets Adds Gadgets, a Directory of Features

Google Spreadsheets, the most mature application from Google's online office suite, has suddenly become much better.

Now you can get email notifications when your collaborators make changes or edit some specific cells. You can also get notifications when someone submits new data using a form.


Google Spreadsheets autocompletes the value from a cell so it's much easier to enter repetitive data in a column.


If the existing features aren't enough for you, there's a new directory of gadgets that can be added to a spreadsheets and use existing data. You may remember the data visualization gadgets I found last month: they're part of this directory, which includes many other interesting gadgets. You can add interactive time series charts, Gantt charts, funnel charts, timelines, tables with filters and grouping, pivot tables, maps, search results and you can also create your own gadget that adds other missing features. As with any beginning, not all the gadgets work very well and the pivot table gadget created by Panorama doesn't seem to work at all.

To add a gadget, click on the "Insert" dropdown and select "Gadget". Each gadget can be embedded into web pages or added to iGoogle, which is extremely cool because the data is updated automatically.




Google Docs help center mentions a new visualization API connected with the new gadgets, but the documentation is not yet available. "The Gadgets-in-Docs for spreadsheets API should be used when you want to create user-facing features which are accessible from within the spreadsheet editor of Google Docs itself. This approach combines the Google Gadgets API with the Google Visualization API, to allow the developer to access data on the spreadsheet for use or presentation in practically any form they choose. Developers using this method should already be familiar with the development of Google Gadgets, and then only need to learn some basic additions provided by the Visualization API. Note that this approach currently only supports one-way interaction with the underlying spreadsheet (reading data), however, it has the advantage of enabling the publishing of gadgets created in a spreadsheet to other gadget-enabled sites, such as iGoogle."

If you find some interesting uses for the new gadgets, publish your spreadsheet and post a link in the comments.

{ via Blogoscoped Forum }

Update. A cool visualization gadget based on GapMinder World (you'll find in Google Docs as "motion chart"):

March 12, 2008

YouTube's Updated API Offers More Flexibility

YouTube updated its API to include some major new features that will help it become an even more interesting solution for publishers and social networks.

The first important addition is the support for authentication, which now allows users to upload videos, edit metadata, post comments, rate videos from other sites or from desktop applications. That means someone could create a better interface for YouTube and leverage the existing users and their data.

Another useful API lets you control an embedded YouTube player using JavaScript or ActionScript. As this example shows, you can pause a video, skip to a certain frame, change the volume using some simple code. YouTube no longer restricts you to use their player: the chromeless player lets you add personalized controls, menus, but you can't remove the branding.

YouTube mentions that the API's intent is for non-commercial use, but you can utilize it to "show YouTube content on an ad-enabled blog or website that is not comprised solely or substantially of YouTube video content". Read the terms of service for more details.

March 5, 2008

Google Releases an API for Contacts

Google wants to make everyone happy today. After releasing a calendar sync tool, Google makes it possible to sync other valuable data: your contacts. The new Contacts Data API "allows client applications to view and update Contacts content in the form of Google Data API feeds. Your client application can request a list of a user's contacts, edit or delete content in an existing contact, and query the content in an existing contact."

What's interesting is that the contacts are tied to a Google Account, not necessarily to a Gmail account, so Google could release a separate address book for those who don't use Gmail.

Hopefully, social applications will use this API instead of asking for your Gmail credentials and we'll see synchronization utilities for mobile devices, Outlook etc. "The Google Contacts Data API allows you to own your own contact data. We expect the API to be useful for a big range of applications," notes Google's Sebastian Kanthak.


The problem is that your Google contacts aren't always your contacts: they're mostly a bunch of people automatically added by Gmail because you replied to their messages. And this is going to be a problem difficult to solve unless Gmail changes the way contacts are created.

February 21, 2008

API for Static Maps

For those who don't need all the complexity of Google Maps API or can't use JavaScript in a specific context (for example, in a mobile website), there's a new Static Maps API. Similar to the recently-launched API for charts, this API lets you generate maps by simply loading images with a list of special parameters.

The URL below lets you load a map centered on Munich by providing the latitude and longitude of the location:

http://maps.google.com/staticmap?center=48.23930899024907,11.162109375&
markers=48.139127,11.580213,red&zoom=7&size=500x300&key=KEY_VALUE



To use the API, you still need a domain-specific key generated from Google's site and the usage limit is 1000 unique image requests per user per day. If you don't want to read the documentation, there's a wizard that generates the URL for you, but it only adds a single marker to your map.

The new API is a good solution if you want to automatically create static maps from a list of locations, but it's limited to web pages, so you can't use it in a software. You should also know that the images can only be displayed on a page from the web site used to generate the API key. Google uses a similar API to generate static maps when you search for locations or local businesses.

February 2, 2008

Social Graph API

In "Thoughts on the Social Graph", Brad Fitzpatrick wrote:

There are an increasing number of new "social applications" as well as traditional application which either require the "social graph" or that could provide better value to users by utilizing information in the social graph. What I mean by "social graph" is a the global mapping of everybody and how they're related, as Wikipedia describes and I talk about in more detail later. Unfortunately, there doesn't exist a single social graph (or even multiple which interoperate) that's comprehensive and decentralized. Rather, there exists hundreds of disperse social graphs, most of dubious quality and many of them walled gardens. (...) If I had to declare the problem statement succinctly, it'd be: People are getting sick of registering and re-declaring their friends on every site., but also: Developing "Social Applications" is too much work.

Five months later, Brad Fitzpatrick announced that Google will start to index FOAF files and the XFN microformats from web pages to gather publicly defined relations between people. For example, "XFN outlines the relationships between individuals by defining a small set of values that describe personal relationships. In HTML and XHTML documents, these are given as values for the rel attribute on a hyperlink. XFN allows authors to indicate which of the weblogs they read belong to friends, whom they've physically met, and other personal relationships."

It's easy to edit the links from your blogroll to highlight your friends or your acquaintances.

<a href="http://danielboyd.com/" rel="friend">Daniel</a>

You can also link to your other site or to your pages from Flickr, del.cio.us, Twitter etc. and consolidate your online identity:

<a href="http://twitter.com/ev" rel="me">My Twitters</a>

Google allows you to access these social relationships using a simple JSON API. The API could be used by social applications to discover some of your friends that already use the same application. "So you've just built a totally sweet new social app and you can't wait for people to start using it, but there's a problem: when people join they don't have any friends on your site. They're lonely, and the experience isn't good because they can't use the app with people they know. You could ask them to search for and add all their friends, but you know that every other app is asking them to do the same thing and they're getting sick of it." Since the data is already publicly available, this API makes it easy to discover your friends and let you select the ones you want to keep in the new context.

For example, Bradfitz from LiveJournal has a friend Jane274. When Brad joins Twitter, the API could discover that he also have a LiveJournal page and his LiveJournal friend Jane274 is the same as Jane from Twitter. This way, Brad found a friend who has a Twitter account.


Of course, the problem is that few people use FOAF and XFN to declare their relationships, but Google's new API could make them more visible and social applications could use them. Ultimately, Google could also index the relationships from social networks if people are comfortable with that.

January 16, 2008

iGoogle Theme Directory

iGoogle will soon let you create your own theme and upload it to a directory. The documentation for building themes is very detailed and you can already select some themes created by famous designers: Troy Lee's Supermoto Mayhem, Yves Behar's Earth-light, John Maeda's Simplicity is Complex, Mark Frauenfelder's Adventure in Lollipopland and a new theme created by Google: Countryside.

"The Themes API lets you create custom designs for iGoogle. Themes are visual designs that personalize iGoogle pages for millions of users. Themes are not just static designs--they can change throughout the day to reveal a visual storyline, message, or anything else."

Google Code Blog encourages everyone to personalize iGoogle. "Creating your own theme isn't rocket science. If you can create a webpage, then you can create a theme. There are only three steps involved: designing images for the header and footer, entering metadata and color information in an XML file, and submitting the theme."




Update. More themes (not yet included in the directory): Projected Box (3-D rendering of colorful projected boxes), Books, The Sims 2, Spore, Eat Every Sandwich, Harvest Party, Chris Anderson's The Long Tail.

December 6, 2007

Dynamically Generated Charts

I've always wondered what's behind www.google.com/chart, the strange directory used by Google to dynamically generate charts. They use this charts at Google Video to show stats like this one (if you're brave, look at the image location):



The problem is that Google also adds a hash to the URL so you can't play around with the parameters and create your own charts. But now there's Google Chart API, a way to make these charts available to everyone.

"The Google Chart API returns a PNG-format image in response to a URL. Several types of image can be generated: line, bar, and pie charts for example. For each image type you can specify attributes such as size, colors, and labels. You can include a Chart API image in a webpage by embedding a URL within an <img> tag. When the webpage is displayed in a browser the Chart API renders the image within the page."

All these charts can be created dynamically by building some admittedly complicated URLs.







Let's look at the 3D pie chart's URL:

http://chart.apis.google.com/chart?cht=p3&chd=s:Uf9a&chs=200x100&chl=A|B|C|D

cht indicates the chart type, chd provides the plotted data that's encoded using letters and digits (for example, U represents 20, f - 31, 9 - 61, a - 26), chs is used for chart's size, while chl separates labels using the pipe character.

This is a great way to create simple charts programmatically and I'm sure many web apps will use them. The query limit of 50,000 queries per user per day is more than sufficient.

Update: It seems that the limit is not that generous. "The user is the webpage that links to the chart. We would like to make sure that all users get their charts fast and reliably. Therefore we may temporarily block users (websites) that exceed the limit. A chart request is not counted if the chart image is cached by the browser or by a proxy," clarified Uwe Maurer from Google Zürich.

November 7, 2007

Gmail API for Greasemonkey

Gmail's new version broke many plug-ins and Greasemonkey scripts, so Google decided to come up with a long-term solution: an API for Greasemonkey.
Greasemonkey is an integral part of the web experience for many experienced users. Google acknowledges that some people are going to change their own experience of our web applications regardless of what we do. Resistance, as they say, is futile. It would also be somewhat hypocritical. After all, a Google employee wrote Greasemonkey in the first place [my note: Aaron Boodman], another wrote these scripts to add functionality to Gmail [my note: Mihai Parparita], and a third wrote two books on the subject (and these docs) [my note: Mark Pilgrim].

Instead, we would like to provide a little help to make such scripts more robust. Instead of finding elements by XPath or DOM traversal, this API provides accessor methods for getting common screen elements. Instead of forcing you to monkey-patch (ahem) our internal functions, this API provides callbacks to call your functions when specific events occur.

This API is experimental. New features and code changes may still cause Greasemonkey scripts to break.

The first Greasemonkey script that uses this API is Mihai Parparita's Macro, which brings additional keyboard shortcuts to Gmail, and the rest of his already famous scripts should also be ported to Gmail's new codebase. The API is not meant to expose messages, contacts or settings, it's more like a convenient way to customize Gmail's interface and functionality without relying too much on the implementation's details.

October 31, 2007

OpenSocial, Google's APIs for Social Applications


Interactive Friends Graph Map, a Facebook app. Image licensed as Creative Commons by inju.
You probably remember the post about Socialstream, a Google-sponsored project that tried to "rethink and reinvent online social networking". The result was a meta-social network that aggregates data from other community sites using APIs and whose goal "is to present social information in a way that ties it to the person who posted the information, and not the site from which it came."

Since last year, Google was busy developing plans for a set of APIs that would make it possible to communicate with other social networks. Brad Fitzpatrick, who moved to Google from Six Apart, wrote an interesting article "Thoughts on the Social Graph" that tackled this problem. "Unfortunately, there doesn't exist a single social graph (or even multiple which interoperate) that's comprehensive and decentralized. Rather, there exists hundreds of disperse social graphs, most of dubious quality and many of them walled gardens." His solution was to make this database of social connections a "a community asset, utilizing the data from all the different sites, but not depending on any company or organization as the central graph owner."

Even if this will not bring Brad's vision closer to reality, Google will launch tomorrow OpenSocial, "a set of common APIs for building social applications across the web". According to a still-unofficial press release, "OpenSocial gives developers of social applications a single set of APIs to learn for their application to run on any OpenSocial-enabled website. By providing these simple, standards-based technologies, OpenSocial will speed innovation and bring more social features to more places across the web." The APIs give access to a user's profile, their friends, and the activity streams.

The success of Facebook's platform, that has more than 5000 applications, made a lot of social networks consider the launch of similar platforms. But not many developers would develop different applications for each social network, so smaller sites will have less visibility. orkut, Google's social network, has more than 70 million users, but only 18% are in the US. While it would've been easier for Google to just open up orkut, this common set of APIs will make the social applications more valuable because they can run in many other places and can access data from other sites.

Google's social APIs should be available at code.google.com/apis/opensocial (the site is not live yet). The initial social networks and companies that support the APIs are orkut, hi5, Friendster, LinkedIn, Viadeo, Ning, Salesforce, and Oracle. It will be interesting to see if other social networks decide to join Google's efforts. MySpace announced that will open its platform in the next months, but it's unlikely to use Google's APIs.


"The timing of OpenSocial couldn't be better. Developers have been complaining non stop about the costs of learning yet another markup launguage for every new social network platform, and taking developer time in creating and maintaining the code. Someone had to build a system to streamline this (...). And Facebook-fear has clearly driven good partners to side with Google," writes TechCrunch.

"Open Social's API is based entirely on Javascript. If you know HTML and Javascript today, you will be able to immediately use Open Social to turn your web applications and web sites into Open Social apps. You can also use standard web development tools to build Open Social apps. This is obviously a much better way to operate than having to learn a proprietary [mark-up] language or query language," writes Marc Andreessen.

And Google also has a financial incentive to build this open platform. "A person familiar with Google's efforts said that those applications have been far more effective for advertisers on social networks than users' personal pages," reports the New York Times. Google tried to convince "third-party developers with applications on Facebook to run Adsense ads within applications pages".

Update: MySpace joins OpenSocial. "MySpace says they are abandoning their efforts to create their own markup language (which is what Facebook has done) and direct APIs will go exclusively with OpenSocial." Other social sites that join Google's efforts: Bebo and Six Apart. It seems that everybody except Facebook will be in this coalition.

Update 2: "As the most trafficked website in the country and the most popular social network in the world, MySpace is one of the leading forces in the global social Web. We're thrilled to grow our strategic relationship with MySpace by joining forces on this important initiative," said Eric Schmidt. Google's press release is mostly about MySpace and its "commitment to supporting standards that foster innovation in an increasingly social Web". That's a welcome change from MySpace.

August 29, 2007

YouTube Launches New API

YouTube migrated its API from REST/XML-RPC to Google Data so you can use the same package for accessing different Google services. The new API provides read-only access to user profiles, videos uploaded or bookmarked by a user, subscriptions, video comments, related videos, playlists, search results. And because the default output is Atom feeds, you can use the API to subscribe to a lot interesting data. Here are some examples of feeds that help you track a user's activity:

http://gdata.youtube.com/feeds/users/username/uploads - videos uploaded by username

http://gdata.youtube.com/feeds/users/username/favorites - videos bookmarked by username

http://gdata.youtube.com/feeds/users/username/playlists - playlists created by username

http://gdata.youtube.com/feeds/users/username/subscriptions - username's subscriptions

Some useful parameters for the feeds:

?max-results=50: the maximum number of items from a feed (by default, a feed includes only 25 items).

?alt=rss or ?alt=json: change the output format to RSS feeds or to JavaScript code (JSON) that can be easily used from web applications.

?vq=query: use this parameter to create a filter for a feed. Obtain only the videos that contain your query in the metadata (title, tags, description).

?orderby={updated, viewCount, rating, relevance}: sort the items from feed by upload date, number of views, rating or relevance.

Example of a feed:

http://gdata.youtube.com/feeds/users/google/uploads?
vq="google+maps"&orderby=viewCount
(the videos about Google Maps uploaded by Google, sorted by popularity)

These feeds can also be used in applications like Miro to export your videos from YouTube.

{via YouTube API Blog}

August 7, 2007

Google APIs for Researchers

Google has a new search API that can only be used for research. Another educational-only API allows programmatic access to detailed results obtained by Google's machine translation.

"The University Research Program for Google Search is designed to give university faculty and their research teams high-volume programmatic access to Google Search, whose huge repository of data constitutes a valuable resource for understanding the structure and contents of the web. Our aim is to help bootstrap web research by offering basic information about specific search queries. Since the program builds on top of Google's search technology, you'll no longer have to operate your own crawl and indexing systems."

Even if this new API is less limited than the now-unsupported SOAP API, you can't send more than a single query in one second and you can't use it to display "interactive search results for end users".

Greg Linden thinks that Google should be more open. "It is good that Google is making tools available to researchers, but they may have to go further than a throttled search API. As is, many researchers trying to work at large scale still will have to build their own crawls and indexes."

Other search engines offer less restrictive APIs, but Google tries to protect its most valuable asset as much as possible. The only official Google Search API works only for client-side coding and lets you access the top 8 search results.

The translation service "provides researchers, in the field of automatic machine translation, tools to help compare and contrast with, and build on top of, Google's statistical machine translation system". For example, you can request a list of the best possible translations of a text with detailed information about the scores.

August 6, 2007

Storage API for Google Documents


Google launched a new API, this time for Google Docs & Spreadsheets. The API allows you to upload files, obtain a list of all the documents and perform searches programmatically. You can authenticate securely, without passing your credentials to the applications.

Google Documents List Data API is too limited to use it for creating a Microsoft Office plug-in that synchronizes a list of documents, but it should be enough for adding an option to open a document directly in Google Docs, without downloading the file. It's also possible to create a new file manager for Google Docs or to build your own GDrive by adding the photos from Picasa Web Albums and the posts from Blogger in a single interface. More complex options can be found in the spreadsheets API, that lets you access and edit a spreadsheet at the cell level.

As observed by Tony Ruscoe, Google changed the terminology for files: you'll work with word processor documents (instead of just "documents") and spreadsheets. The generic name for files that can be edited by Google Docs is documents: this could be another step that prepares the introduction of Google's presentation app and another name change, this time from Google Docs & Spreadsheets to Google Documents (or Google Docs).

{ via Google Blogoscoped }