Title: A Survey of Web APIs
1A Survey of Web APIs
CSC 867 Advanced Topic Presentation Charles
OSullivan May 2 2006
2Outline
- What are Web APIs
- Google
- Google Maps
- del.icio.us
- Amazon E-Commerce Service
- Yahoo Video Search
3What Are Web APIs
- APIs for internet applications
- Methods or functionality exposed to the developer
to incorporate an internet applications
services. - May be invoked by REST POST or SOAP protocols.
4What Are Web APIs
- Some APIs have bindings to different languages
- VB.NET
- C
- PHP
- Python
- Perl
- etc.
5What Are Web APIs
- Some API methods can be accessed directly from
the address bar e.g http//del.icio.us/api/tags/g
et - For some APIs the programmer is restricted to
program objects e.g. Google Maps - Allow a developer to incorporate prebuilt web
functionality into their own web applications.
6Google
- Programmatically use the Google search engine
- Search requests
- Cache requests
- Spelling requests
- Requires license key (obtained for free).
- Includes SDKs for Java and .NET
7Google
- From GoogleAPIDemo.java
- package com.google.soap.search
-
- GoogleSearch s new GoogleSearch()
- s.setKey(clientKey)
-
- s.setQueryString(directiveArg)
- GoogleSearchResult r s.doSearch()
-
- System.out.print(r.toString())
8Google Maps
- Map viewing and manipulation functionality in
your own web application - Javascript API (Google Maps employs AJAX)
- Requires free API key
9Google Maps
- Include the following script in your code
- v2keyabcdefg typetext/javascript
- Where abcdefg should be replace with your API
key - Example code
- function load()
- if (GBrowserIsCompatible())
- var map new GMap2(document.getElementById(map
)) - map.setCenter(new GLatLng(37.4419 -122.1419)
13) -
10del.icio.us
- Del.icio.us is an online shared bookmark manager.
- The API has the folowing methods
- Update - Check to see when a user last posted an
item. - Tags - Get a list of tags rename them.
- Posts - Get a list of posts add delete.
- Bundles - Get bundles create and delete.
- All API calls require http-authorization
11Amazon E-Commerce Service
- Retrieve product information from Amazon
- Retrieve user reviews of products
- Create a remote shopping cart
- Free license
- Uses REST and SOAP
12Amazon E-Commerce Service
- Perl Example of API using SOAP
- use SOAPLite
-
- my request_complex_type \SOAPData-value(
- SOAPData-name(Keywords)-value(keywords)
- SOAPData-name(SearchIndex)-value(Books))
- my request_complex_type SOAPData-value(
- SOAPData-name(SubscriptionId)
-value(susbscription_id) - SOAPData-name(Request)-value(request_compl
ex_type)) -
13Amazon E-Commerce Service
- create new SOAPLite instance
- my aws_handle SOAPLite-service(aws_wsdl)
- invoking AWSItemSearch
- aws_handle-ItemSearch(itemsearch_request)
- my som aws_handle-call()
14Yahoo Video Search
- Search for videos online
- Uses REST
- Require application ID
- Example
- http//api.search.yahoo.com/VideoSearchService/V1/
videoSearchappidYahooDemoquerymarylinmansonr
esults2
15Yahoo Video Search
-
- - Schema-instance xmlnsurnyahoosrchmv
xsischemaLocationurnyahoosrchmv
http//api.search.yahoo.com/VideoSearchService/V1/
VideoSearchResponse.xsd totalResultsAvailable9
totalResultsReturned2 firstResultPosition1
- -
- Nine Inch Nails Marylin Manson - Gave
Up - Music Video - NIN MARYLIN DUO - GOOD
TUNE !! Entertainment Music Videobloggingry - http//www.youtube.com/player.swfvideo_id
SUAk4Sik8zc - http//www.youtube.com/player.swfvide
o_idSUAk4Sik8zc - http//www.youtube.com/w/Nine-Inch-N
ails--Marylin-Manson---Gave-UpvSUAk4Sik8zcfeat
ureRandompage5ttfb - 10235
- flash
- 390
-
-
- -
- http//mud.mm-da.yimg.com/image/1643938234/Url
- 124
- 150
-
-
16References
- Gosnell D Professional Development with Web
APIs Wrox Press (2005) - Google Web APIs http//www.google.com/apis/
- Google Maps API Documentation http//www.google.c
om/apis/maps/documentation/ - http//del.icio.us/help/api/
- Video Search Documentation for Yahoo! Search Web
Services http//developer.yahoo.com/search/video
/V1/videoSearch.html - www.programmableweb.com