Development > API > Topic

Other APIs/#4195

Feb 24, 2007 / pixtur
Jan 5, 2009 / phsouzacruz
 

Attached files

No files uploaded
 
Understanding implementation and interface of other APIs


Additional readingπ

Googleπ

Looking at http://code.google.com/apis/ one can image the importances of APIs for google.

Google maps APIπ

http://www.google.com/apis/maps/documentation/

Google maps uses javascript to request data from google. See the following hello world example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg"
            type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
      }
    }

    //]]>
    </script>
  </head>
  <body onload="load()" onunload="GUnload()">
    <div id="map" style="width: 500px; height: 300px"></div>
  </body>
</html>

It embeds the javaScript-code remotely from google and embeds the rendered HTML-elements into a container that is given with the constructor.

google maps http request:π


To access the Maps API geocoder directly using server-side scripting, send a request to http://maps.google.com/maps/geo? with the following parameters in the URI:

- q — The address that you want to geocode.
- key — Your API key.
- output — The format in which the output should be generated. The options are xml, kml, csv, or json.

from google



json outputπ

The returned json output might look like this:

{
  "name": "1600 Amphitheatre Parkway, Mountain View, CA, USA",
  "Status": {
    "code": 200,
    "request": "geocode"
  },
  "Placemark": [
    {
      "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
      "AddressDetails": {
        "Country": {
          "CountryNameCode": "US",
          "AdministrativeArea": {
            "AdministrativeAreaName": "CA",
            "SubAdministrativeArea": {
              "SubAdministrativeAreaName": "Santa Clara",
              "Locality": {
                "LocalityName": "Mountain View",
                "Thoroughfare": {
                  "ThoroughfareName": "1600 Amphitheatre Pkwy"
                },
                "PostalCode": {
                  "PostalCodeNumber": "94043"
                }
              }
            }
          }
        },
        "Accuracy": 8
      },
      "Point": {
        "coordinates": [-122.083739, 37.423021, 0]
      }
    }
  ]
}


Google baseπ

Google base provides a very powerful communication framework in php: http://code.google.com/apis/base/samples/php/php-sample-zend.html

Especially noteworthy seems the authentication process which should be studied in detail.



XBox - usergroup APIπ

http://www.xboxusersgroup.com/content/view/3247/217/

A very simple api to request information in XML format.


43 thingsπ

http://www.43things.com/about/view/web_service_api

very lightweight API which seems to be a good start for brainstorming about Streber's API.

Flickrπ

http://www.flickr.com/services/api/

Excellent documentation of Flickr's API. Has some information on Request and response formates.

Additional readingπ

No Comments