Unfortunately not all the web services available on the planet provide a JSON output and even less are the examples of padding support. But the JSON-P providers that I know as of today are basically the most interesting for mashing-up applications. Here’s a growing list:
-
• Del.icio.us supports a callback parameter which is then used to wrap the JSON response into a function call. Try for example this to see the wrapping in action over the request for details for the Del.icio.us URL itself.
-
• Yahoo! supports the double output XML and JSON with padding. For example: this returns the result of a search wrapped in a function call.
-
• Amazon has no JSON support, even without padding. But Alan Taylor found a smart solution to this problem using the Amazon provided XSLT engine. An XSL stylesheet can be applied to the results to transform XML to JSON with padding. Try this for example. As you can see the stylesheet location is provided in the URL as part of the request.
-
• Google is actively pushing into the JSON direction. Many Google APIs already support JSON with padding natively: Google Feed, Google Maps, Google Data etc. The Google Search service is not really a fully-compliant JSON service yet. It can be accessed in two ways. An experimental site has been created on purpose called SearchMash that supports JSON (try this query for example to see sites containing the song “only you”) although this use is not documented. Unfortunately SearchMash doesn’t seem to offer padding support. The second option produces JSONP indirectly. The Google Search AJAX API uses a specific URL behind the scenes to obtain Google Search results in JSON with padding. But the Google Term of Use you can’t access this URL directly but just through the APIs, which is anyway enough to bypass the cross domain site check.
-
• Twitter has a rich set of APIs in many format JSON included and supports padding. Just as an example you can extract my message timeline like this. There is an hourly limit to the number of request that is anyway enough for most applications.
-
• Flickr provides JSON output with padding support for all their services. This is for example the JSONP response for the my public photostream.
-
• Eventful database: here’s another complete set of APIs supporting JSON with padding and several other formats. Here’s for example the list of future events in Chicago.
-
• AOL web APIs are related to the many services AOL provides, AIM included but not only (for example MapQuest). They provide JSONP support through their set of JavaSript APIs
-
• Facebook provides a full set of management and control APIs with JSONP support.
I’m sure there are many more documentable examples and more to come. Still wondering how the JSONP support can be effective? Just think about having an html page that can contact all the services above and query for data without any server-side support: scalability and absence of deploy effort.