Back to Home

Output Format

Output Formats


The result of a query is in the standard case XML. By parameter in the request header, the output format can be changed to JSON. If no further information is given for the request, the output of the default granulation of a POI corresponds. .

Atom Feed

The XML document is based on the atom standard according to RFC4287. One has to distinguish between the basic framework of an atom feed and the POI data embedded therein. The following example shows the structure of the feed XML. The actual POI data are contained in the content element of a feed entry and defined by the xmlns:poi="http://api.123poi.com/poi/".

<feed xmlns="http://www.w3.org/2005/Atom" 
        xmlns:poi="http://api.123poi.com/poi/" 
        xmlns:media="http://search.yahoo.com/mrss/" 
        xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">
           
        <openSearch:totalResults>17246</openSearch:totalResults>
        <openSearch:startIndex>0</openSearch:startIndex>
        <openSearch:itemsPerPage>10</openSearch:itemsPerPage>
        <openSearch:Query access="VISIBLE"/>
           
        <updated>2010-05-11T08:04:02.015Z</updated>
        <link href="http://api.123poi.com/data/poi/api/all" rel="self"/>
        <title type="text">Allgemeine Suche nach Pois</title>
        <subtitle type="text"/>
        <id>http://api.123poi.com/data/poi/api/all</id>
        <author>
          <name/>
        </author>
        <entry>
            <title type="text">Filmmuseum</title>
            <summary type="text">Das Kino im Filmmuseum ...</summary>
            <link href="http://api.123poi.com/data/poi/api/poi/17248" rel="alternate"/>
            <updated>2010-05-10T10:11:53.000Z</updated>
            <published>2010-05-10T10:11:53.000Z</published>
            <content type="application/xml">
              ...
            </content>
           </entry>
     </feed>
    

The content element initially contains a poi element from the namespace poi and describes a POI in general:

<poi:poi xmlns:data="http://api.123poi.com/data/" 
              xmlns:falkgeo="http://api.123poi.com/geo/" 
              xmlns:user="http://api.123poi.com/user/" 
              xmlns:falkmedia="http://api.123poi.com/media/">
       <poi:id>17248</poi:id>
       <poi:creationDate>1273486313000</poi:creationDate>
       <poi:lastUpdate>1273486313000</poi:lastUpdate>
       <poi:publishedDate>1273486313000</poi:publishedDate>
       <poi:ratings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
       <poi:ratings>
         <poi:customerName/>
         <poi:lastUpdate>1273565041381</poi:lastUpdate>
         <poi:authAvg>0.0</poi:authAvg>
         <poi:authCount>0</poi:authCount>
         <poi:guestAvg>0.0</poi:guestAvg>
         <poi:guestCount>0</poi:guestCount>
       </poi:ratings>
       <poi:comments/>
       <poi:commentCount>0</poi:commentCount>
       <poi:poidata>
         ...
       </poi:poidata>
     </poi:poi>
    

The content of  describes the contributions of users to this POI. Only the elements which are also filled are output.  elements can occur several times, but at least once.

 <poi:poidata>
       <poi:type>Contribution</poi:type>
       <poi:title>Filmmuseum</poi:title>
       <user:author>
         <user:id>10</user:id>
         <user:name>FED</user:name>
       </user:author>
       <poi:externalId>_19372</poi:externalId>
       <data:language>de</data:language>
       <falkgeo:coordinates>
         <falkgeo:lat>52.39539</falkgeo:lat>
         <falkgeo:lon>13.05698</falkgeo:lon>
       </falkgeo:coordinates>
       <data:address>
         <data:country>Deutschland</data:country>
         <data:isoCountryCode>DE</data:isoCountryCode>
         <data:zip>14467</data:zip>
         <data:location>Potsdam</data:location>
         <data:street>Schlosstraße</data:street>
         <data:number>1</data:number>
       </data:address>
       <data:contact>
         <data:phone>+49 331 271810</data:phone>
       </data:contact>
       <poi:tags>
         <poi:tag>
           <poi:id>187</poi:id>
           <poi:language>de</poi:language>
           <poi:value>Kinos</poi:value>
         </poi:tag>
       </poi:tags>
       <poi:description>Das Kino im Filmmuseum mit moderner Vorf... und historische Filme.</poi:description>
       <poi:creationDate>1273486312000</poi:creationDate>
       <poi:published>true</poi:published>
       <poi:lastUpdate>1273486312000</poi:lastUpdate>
     </poi:poidata>
    

For a complete specification of the elements, please refer to the document POI-Scheme.

JSON

In order to receive the output format JSON, the HTTP header "Accept" with the value "application/json" has to be given at the request. The output JSON uses the same skeleton as the Atom feed, but atom-specific fields are omitted.The main object in the JSON has the fields "entries", "totalResults", "startIndex", "itemsPerPage" and "title":

{
        "entries": {
            ...
        }, 
        "totalResults": "1", 
        "startIndex": "0", 
        "itemsPerPage": "1", 
        "title": "Anzeigen eines Pois"
    }
    

The field "entries" can contain a single POI object or a list of POI objects:

{
        "id": "61", 
        "creationDate": "1275390114000", 
        "lastUpdate": "1275390114000", 
        "publishedDate": "1275390114000", 
        "ratings": [
            {
                "customerName": "", 
                "lastUpdate": "1275396042093", 
                "authAvg": "0.0", 
                "authCount": "0", 
                "guestAvg": "0.0", 
                "guestCount": "0"
            }
        ], 
        "mediaStatistics": null, 
        "commentStatistics": null, 
        "poidata": [
            {
                "type": "Contribution", 
                "title": "Frankfurt-Hahn Airport", 
                "user": {
                    "id": "10", 
                    "name": "FED"
                }, 
                "externalId": "_135785", 
                "language": "de", 
                "coordinates": {
                    "lat": "49.9435435", 
                    "lon": "7.2666265"
                }, 
                "address": {
                    "country": "Deutschland", 
                    "isoCountryCode": "DE", 
                    "zip": "55483", 
                    "location": "Lautzenhausen Frankfurt-Hahn"
                }, 
                "contact": {
                    "phone": "+49 6543 509200", 
                    "fax": "+49 6543 509222"
                },
                           "medias": {
                                  "media": [
                                  {
                                   "thumbUrl": "/0/1w/gu/kg/j/t72/u/photo-1.jpg",
                                  },
                                  {
                                    "thumbUrl": "/0/1w/gu/kg/j/t72/u/photo-2.jpg",
                                  }
                             ]
                           },
                "tags": {
                    "tag": {
                        "id": "72", 
                        "language": "de", 
                        "value": "Flughäfen"
                    }
                }, 
                "description": "Behindertenparkplätze.\r\n\r\nMietwagen-Service und Geldwechsel.", 
                "creationDate": "1275390114000", 
                "published": "true", 
                "lastUpdate": "1275390114000", 
                "visibility": "PUBLIC"
            }, 
            {
                "type": "BasePoi", 
                "title": "Frankfurt-Hahn Airport", 
                "author": {
                    "id": "2", 
                    "name": "Falk"
                }, 
                "language": "all", 
                "coordinates": {
                    "lat": "49.9435435", 
                    "lon": "7.2666265"
                }, 
                "address": {
                    "country": "Deutschland", 
                    "isoCountryCode": "DE", 
                    "zip": "55483", 
                    "location": "Lautzenhausen", 
                    "subLocation": "", 
                    "street": "Street", 
                    "number": ""
                }, 
                "contact": {
                    "phone": "+49 6543 509200", 
                    "fax": "+49 6543 509222"
                },
                           "medias": {
                                  "media": {
                                         "author": {
                                                "id": "19",
                                                "name": "booking.com"
                                         },
                                         "thumbUrl": "/0/1w/gu/kg/j/t72/u/photo-1.jpg",
                                  }
                           }, 
                "creationDate": "1275390114000", 
                "lastUpdate": "1275390114000", 
                "visibility": "PUBLIC"
            }
        ], 
        "contributorId": "10"
    }
    

Interface Changes Version 2.0 - Atom Feed

no changes

Interface Changes Version 2.0 - JSON

Collections

Data structures that are defined as a collection now always return an array even if only returns one object.The elements that have an additional wrapper in the XML have now only one layer in the JSON

old:
    tags: {tag: {...}}
    
    new:
    tags: [{...}]
    

Featured

The previous featured field was not JSON konvorm.

old: 
    "featured": { "@type": "DETAIL_INFO", "$": "true" } 
    
    new: 
    "featured": { "type": "DETAIL_INFO", "value": true }
    

Numbers, Booleans

Numbers, Boolean, and URL are no longer in quotes.

old:
    "number": "2"
    
    new:
    "number": 2
    

@type fields

@type fields have been removed.

old: 
    "@type": "poi:poiTO",