Geocoding (Search)

Match a query string to geographic coordinates.

Request GET parameters

  • query
    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
  • focus.lat | focus.lng
    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
  • within.country
    ISO 3166-1 alpha-2 or alpha-3 | optional
    Only return the results that are within the specified country

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:

  • name
    string
    A short description of the location, varies depending on what is returned
  • label
    string
    Detailed label of the result, intended to be returned to the end user
  • score
    float | optional
    Result confidence score, maximum value is 1
  • house_number
    string | optional
  • street
    string | optional
  • region
    string | optional
  • region_code
    string | optional
  • neighbourhood
    string | optional
  • county
    string | optional
  • macroregion
    string | optional
  • city
    string | optional
  • country
    string | optional
  • country_code
    ISO 3166-1 alpha-3 | optional
  • continent
    string | optional
  • postcode
    string | optional
  • features
    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
    • public_transport
      object | optional
      Public transport support information. Public transport is not supported if this object is missing.
      • date_start
        date in extended ISO-8601 format
      • date_end
        date in extended ISO-8601 format
    • fares
      boolean
      Indicates whether or not we have fare data
    • postcodes
      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
                }
            }
        }
    ]
}