places – Retrieve List of Available Places

The places service can be used to retrieve the list of supported places. The ids for the places are then used in the other services to indicate the location to be queried.

This service can be tested with the Query Builder.

Request Parameters. 

NameDescriptionRequired
geo

Return longitude and latitude for the geo object.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No
lang

The preferred language for the texts. An error will be raised if the language code cannot be recognized. In case the text for a specific event cannot be retrieved in the requested language it will be returned in English instead. This is also the default language.

In case you have specific needs for a certain language/translation, please email api@timeanddate.com.

Type: String/ISO639 Language Code

Default value: en

No

See also the section called “General Parameters”.

Response Elements. 

NameDescription
places

This element contains a list of all currently known places, their identifiers and their geographical location (if requested).

Type: Array of PlaceType

Example JSON Request. 

https://api.xmltime.com/places?version=2&out=json&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example JSON response

{
  "version": 1,
  "places": [{
    "id": 1,
    "urlid": "cote-divoire/abidjan",
    "geo": {
      "name": "Abidjan",
      "country": {
        "id": "ci",
        "name": "Republic of Cote d'Ivoire"
      },
      "latitude": 5.320,
      "longitude": -4.020
    }
  },{
    "id": 2,
    "urlid": "united-arab-emirates/abu-dhabi",
    "geo": {
      "name": "Abu Dhabi",
      "state": "Abu Dhabi",
      "country": {
        "id": "ae",
        "name": "United Arab Emirates"
      },
      "latitude": 24.450,
      "longitude": 54.383
    }
  },{
    "id": 3,
    "urlid": "mexico/acapulco",
    "geo": {
      "name": "Acapulco",
      "state": "Guerrero",
      "country": {
        "id": "mx",
        "name": "United Mexican States"
      },
      "latitude": 16.850,
      "longitude": -99.933
    }
  }]
}

Example XML Request. 

https://api.xmltime.com/places?version=2&out=xml&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example XML response

<?xml version="1.0" encoding="UTF-8"?>
<data version="1">
  <places>
    <place id="1" urlid="cote-divoire/abidjan">
      <geo>
        <name>Abidjan</name>
        <country id="ci">Republic of Cote d'Ivoire</country>
        <latitude>5.320</latitude>
        <longitude>-4.020</longitude>
      </geo>
    </place>
    <place id="2" urlid="united-arab-emirates/abu-dhabi">
      <geo>
        <name>Abu Dhabi</name>
        <state>Abu Dhabi</state>
        <country id="ae">United Arab Emirates</country>
        <latitude>24.450</latitude>
        <longitude>54.383</longitude>
      </geo>
    </place>
    <place id="3" urlid="mexico/acapulco">
      <geo>
        <name>Acapulco</name>
        <state>Guerrero</state>
        <country id="mx">United Mexican States</country>
        <latitude>16.850</latitude>
        <longitude>-99.933</longitude>
      </geo>
    </place>
  </places>
</data>

prev top | next >
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com