Geocoding (Search)

Match a query string to geographic coordinates.

Request Headers

  • Required authentication header. Get API Key here
    For example:
    X-Application-Id: fa12pA96
  • Required authentication header.
    For example:
    X-Application-Key: rwyEPevhh54EqVqSyv7ovoDqYYYR5Z
  • BCP47 | optional
    Request geocoding results to be in specific language if it is available. If it is not - it will default to English. BCP47 spec.
    For example:
    Accept-Language: en or Accept-Language: fr-FR

Request GET parameters

  • string
    A query to geocode. Can be an address, a postcode or a venue. For example SW1A 0AA or Victoria street, London. Providing a country or city the request will get you more accurate results
  • float | optional
    Latitude and longitude of a focus point. This will prioritize results around this point. Note that this does not exclude results that are far away from the focus point
  • ISO 3166-1 alpha-2 or alpha-3 | optional
    Only return the results that are within the specified country

Response Headers

  • Language tag in which results were returned.
    It will default to Content-Language: en if requested language was not available. BCP47 spec

Response Body Json Attributes

The returned response is in GeoJSON format (check example below). Note that coordinates elements are longitude, latitude, in that order. The properties object contains the following attributes:
  • string
    A short description of the location, varies depending on what is returned
  • string
    Detailed label of the result, intended to be returned to the end user
  • float | optional
    Result confidence score, maximum value is 1
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • string | optional
  • ISO 3166-1 alpha-3 | optional
  • string | optional
  • string | optional
  • object | optional
    Travel Time Platform features that are supported for searches from this point. If the object is missing, it means that Travel Time Platform searches from this point are not supported
    • object | optional
      Public transport support information. Public transport is not supported if this object is missing.
    • object | optional
      Fast time-filter support information. The time-filter/fast endpoint is not supported if this object is missing.
      • array[object]
        Each entry in the array describes a time period and time filter modes that are available for this country.
        • string
          The arrival or departure time period for which this time filter fast endpoint is available. Possible values: weekday_morning
        • array[object]
          Lists available transportation and time-filter modes for this time period.
          • string
            Possible values arrival.many_to_one, arrival.one_to_many.
          • Possible values public_transport, driving, driving+public_transport.
    • boolean
      Indicates whether or not we have fare data
    • boolean
      Indicates whether or not postcode searches are supported

Example Request

GET /v4/geocoding/search?query=Parliament square&focus.lat=51.512539&focus.lng=-0.097541 HTTP/1.1
Host: api.traveltimeapp.com
Accept: application/json
X-Application-Id: ...
X-Api-Key: ...

Response Body

{
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -0.126906,
                    51.500227
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, London, England, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "neighbourhood": "Westminster",
                "macroregion": "England",
                "city": "London",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -0.078529,
                    51.795574
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Hertford, England, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "region": "Hertfordshire",
                "region_code": "HRT",
                "macroregion": "England",
                "city": "Hertford",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -90.613019,
                    38.775132
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, St. Peters, MO, USA",
                "score": 1,
                "street": "Parliament Square",
                "region": "Missouri",
                "region_code": "MO",
                "county": "St. Charles County",
                "city": "St. Peters",
                "country": "United States",
                "country_code": "USA",
                "continent": "North America",
                "features": {
                    "public_transport": {
                        "date_start": "2018-03-06T08:00:00+02:00",
                        "date_end": "2018-05-09T08:00:00+03:00"
                    },
                    "fares": false,
                    "postcodes": false
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -4.386486,
                    54.321964
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Isle of Man",
                "score": 1,
                "street": "Parliament Square",
                "region": "Isle of Man",
                "country": "Isle of Man",
                "country_code": "IMN",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -2.998166,
                    55.150669
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Langholm, Scotland, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "region": "Dumfries and Galloway",
                "region_code": "DGY",
                "macroregion": "Scotland",
                "city": "Langholm",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -3.190359,
                    55.949194
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Edinburgh, Scotland, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "region": "City of Edinburgh",
                "region_code": "EDH",
                "neighbourhood": "Old Town",
                "macroregion": "Scotland",
                "city": "Edinburgh",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -85.704736,
                    38.257593
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Louisville, KY, USA",
                "score": 1,
                "street": "Parliament Square",
                "region": "Kentucky",
                "region_code": "KY",
                "neighbourhood": "Frankfort Ave",
                "county": "Jefferson County",
                "city": "Louisville",
                "country": "United States",
                "country_code": "USA",
                "continent": "North America",
                "features": {
                    "public_transport": {
                        "date_start": "2018-03-02T07:00:00+02:00",
                        "date_end": "2018-05-05T07:00:00+03:00"
                    },
                    "fares": false,
                    "postcodes": false
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -3.421304,
                    56.203367
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Kinross, Scotland, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "region": "Perth and Kinross",
                "macroregion": "Scotland",
                "city": "Kinross",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -3.117136,
                    56.263332
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Scotland, United Kingdom",
                "score": 1,
                "street": "Parliament Square",
                "macroregion": "Scotland",
                "country": "United Kingdom",
                "country_code": "GBR",
                "continent": "Europe",
                "features": {
                    "public_transport": {
                        "date_start": "2018-02-27T02:00:00+02:00",
                        "date_end": "2018-05-02T02:00:00+03:00"
                    },
                    "fares": true,
                    "postcodes": true
                }
            }
        },
        {
            "type": "Feature",
            "geometry": {
                "type": "Point",
                "coordinates": [
                    -83.703456,
                    41.663293
                ]
            },
            "properties": {
                "name": "Parliament Square",
                "label": "Parliament Square, Sylvania, OH, USA",
                "score": 1,
                "street": "Parliament Square",
                "region": "Ohio",
                "region_code": "OH",
                "county": "Lucas County",
                "country": "United States",
                "country_code": "USA",
                "continent": "North America",
                "features": {
                    "public_transport": {
                        "date_start": "2018-03-02T07:00:00+02:00",
                        "date_end": "2018-05-05T07:00:00+03:00"
                    },
                    "fares": false,
                    "postcodes": false
                }
            }
        }
    ]
}