search icon
TravelTime API
Overview
Developer Tools
Database Plugins
TravelTime API
SDK
TravelTime API
Isochrone API
JSON
Distance Map API
TravelTime API
Travel Time Matrix API
JSON
Travel Time Matrix API
Protocol Buffers
TravelTime API
Routes API
JSON
Geocoding API
Additional API Reference
Error Handling
TravelTime API
ArcGIS plugin
QGIS plugin
Alteryx plugin
TravelTime.comchevronDocs

Error Responseanchor icon

Error Structureanchor icon

The json body returned upon error contains the following attributes:

  • http_status - The http status returned with the error.
  • error_code - API error code, they are documented in the page Error Codes.
  • description - Summary of the error.
  • documentation_link - Link to this documentation.
  • additional_info - Additional information about the error. This only has data for error codes 2, 3, 13, 15, 16, 17 and 19, examples for such errors are provided bellow.

Examplesanchor icon

Error on Invalid JSON Contentanchor icon

{
  "http_status": 422,
  "error_code": 2,
  "description": "Invalid request json",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "obj.searches[0].transportation.type": [
      "Invalid value, possible values - [cycling, driving, driving+train, public_transport, walking, coach, bus, train]"
    ]
  }
}

Error on Invalid JSON Syntaxanchor icon

{
  "http_status": 400,
  "error_code": 3,
  "description": "Failed to parse json - syntax error",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "syntax_errors": [
      "Unexpected character ('f' (code 102)): was expecting comma to separate OBJECT entries"
    ]
  }
}

Error when fare data is unavailableanchor icon

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 13,
  "description": "We do not have the fare data for this region. Fares are only supported in Great Britain",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when public transport data is not available.anchor icon

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 15,
  "description": "We do not have public transport data for the region at the time you have specified, try a more recent date",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when attempting a search in an unsupported areaanchor icon

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 16,
  "description": "We do not support searches in the given area. Make sure that all points for a search are in the same country.",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error when we couldn’t start the search at the given point.anchor icon

additional_info.search_id contains a single search id that caused the error.

{
  "http_status": 422,
  "error_code": 17,
  "description": "We couldn't start the search at the given point. Please make sure the start of the search is near a road or a path e.g. you are not attempting to start a search from a lake, river or a desolate area",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "search_id": [
      "my search id"
    ]
  }
}

Error on invalid Accepts headeranchor icon

{
  "http_status": 406,
  "error_code": 19,
  "description": "Unsupported content type was specified in the Accept header",
  "documentation_link": "/api/reference/error-codes",
  "additional_info": {
    "supported_content_types": [
      "application/json",
      "application/vnd.wkt+json",
      "application/vnd.wkt-no-holes+json",
      "application/vnd.bounding-boxes+json"
    ]
  }
}