TravelyzerTravelyzerDocs

Forward Geocoding

Convert an address or place name into geographic coordinates.

GET /v1/geocoding/forward

Converts a place name (country, city, monument) into geographic coordinates (latitude/longitude). This is the main endpoint for quickly identifying a location.

Optimized for LLMs: This API is designed to quickly find geographic places (countries, cities, monuments), not to search for hotels, restaurants, or precise addresses. It prioritizes speed over granular precision.

Endpoint

GET https://places.gotravelyzer.com/v1/geocoding/forward

Authentication

This endpoint requires authentication via a JWT Bearer token.

Authorization: Bearer YOUR_JWT_TOKEN

Parameters

Query Parameters

ParameterTypeRequiredDescriptionDefault
querystringYesSearch term (address, place, POI, coordinates)-
limitintegerNoNumber of results to return (1-50)5

query Parameter Constraints

ConstraintValue
Minimum length1 character
Maximum length500 characters
EncodingUTF-8, URL encoded

Requests

Basic Request

curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=Paris" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

With Result Limit

curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=Paris&limit=10" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Search for a Complete Address

curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=10%20Downing%20Street%20London%20UK" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Search for a Monument

curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=Eiffel%20Tower%20Paris" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Search for an Airport

curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=CDG%20Airport" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response

Success Example (200 OK)

[
  {
    "place_id": 2681977,
    "display_name": "Eiffel Tower, Avenue Anatole France, Paris 7e Arrondissement, Paris, Île-de-France, 75007, France",
    "lat": 48.8582599,
    "lon": 2.2945006,
    "country": "France",
    "city": "Paris",
    "category": "tourism",
    "type": "attraction",
    "importance": 0.85,
    "boundingbox": [48.8574753, 48.8590453, 2.2933119, 2.2956897],
    "address": {
      "house_number": "5",
      "road": "Avenue Anatole France",
      "suburb": "Paris 7e Arrondissement",
      "city": "Paris",
      "state": "Île-de-France",
      "postcode": "75007",
      "country": "France",
      "country_code": "fr"
    },
    "confidence": 0.95
  }
]

Response Fields

FieldTypeDescription
place_idnumberUnique identifier of the place
display_namestringFull formatted name with administrative hierarchy
latnumberLatitude in decimal degrees (WGS84)
lonnumberLongitude in decimal degrees (WGS84)
countrystringCountry name
citystringCity name (if applicable)
categorystringMain category of the place
typestringSpecific type of the place
importancenumberRelevance score (0 to 1)
boundingboxnumber[]Bounding area [south, north, west, east]
addressobjectDetailed address components
confidencenumberResult confidence score (0 to 1)

boundingbox Field Detail

The boundingbox array contains 4 coordinates in decimal degrees:

IndexDescriptionExample
[0]South latitude (minimum)48.8574753
[1]North latitude (maximum)48.8590453
[2]West longitude (minimum)2.2933119
[3]East longitude (maximum)2.2956897

address Field Detail

Available fields vary depending on the type and location of the place:

FieldDescriptionExample
house_numberStreet number"5"
roadStreet name"Avenue Anatole France"
suburbDistrict/Suburb"Paris 7e Arrondissement"
cityCity"Paris"
countyCounty/Department"Greater London"
stateState/Region"Île-de-France"
postcodePostal code"75007"
countryCountry"France"
country_codeISO 3166-1 alpha-2 code"fr"

category and type Values

CategoryCommon TypesDescription
boundaryadministrative, country, stateAdministrative boundaries (countries, regions)
placecity, town, village, countryInhabited places and countries
tourismattraction, monument, viewpointMajor tourist sites
aerowayaerodrome, terminalAirports
railwaystationMajor train stations

The API primarily returns geographic places (countries, cities, monuments, airports). It is not designed to return businesses, hotels, or restaurants.


HTTP Codes

CodeStatusDescription
200OKSuccessful request (may return an empty array)
400Bad RequestMissing or invalid query parameter
401UnauthorizedMissing or invalid JWT token
403ForbiddenAPI key disabled or quota exceeded
429Too Many RequestsRequest limit exceeded
502Bad GatewayGeocoding service error
503Service UnavailableService temporarily unavailable

Error Examples

400 Bad Request - Missing Parameter

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "query parameter is required"
}

401 Unauthorized - Invalid Token

{
  "statusCode": 401,
  "error": "Unauthorized",
  "message": "Invalid token"
}

429 Too Many Requests - Rate Limit

{
  "statusCode": 429,
  "error": "Too Many Requests",
  "message": "Rate limit exceeded",
  "retryAfter": 45
}

Best Practices

Encode Special Characters

Always use URL encoding for spaces and special characters:

# Correct
curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=Eiffel%20Tower%20Paris"
 
# Incorrect
curl "https://places.gotravelyzer.com/v1/geocoding/forward?query=Eiffel Tower Paris"

Use Precise Queries

The more precise the query, the better the results:

# Good: Complete address
curl "...?query=10%20Downing%20Street%2C%20Westminster%2C%20London%2C%20UK"
 
# Less good: Partial address
curl "...?query=10%20Downing%20Street"

Handle Empty Results

An empty array [] is returned if no results match:

# Check before accessing data
RESULT=$(curl -s "...?query=nonexistent_address" -H "Authorization: Bearer $TOKEN")
if [ "$(echo $RESULT | jq 'length')" -eq 0 ]; then
  echo "No results found"
fi

Limits

LimitValue
Maximum results50 per request
query length500 characters
EncodingUTF-8
Counting1 request against quota

Technical Notes

  • Coordinates use the WGS84 system (same as GPS)
  • Results are sorted by relevance score in descending order
  • An empty array [] is returned if no results are found
  • Requests are counted against your quotas (even for 4xx errors)

Next Steps