Journey Docs
Members APIProperties

Get Location Suggestions

Get location autocomplete suggestions for property search

POST/members/properties/suggestions

Overview

Provides location autocomplete suggestions for property search input. Returns matching cities, regions, airports, landmarks, and properties based on the user's query string.

This endpoint is optimized for real-time search suggestions with fast response times.

Authentication

Requires a valid Clerk JWT token in the Authorization header.

Request Body

querybodystringrequired

Search query string (minimum 2 characters)

limitbodynumber

Maximum number of suggestions to return (default: 10, max: 25)

typesbodyarray

Suggestion types to include: ["city", "region", "country", "airport", "landmark", "property"]

Response

Returns an array of location suggestions matching the query.

suggestionsarrayrequired

Array of location suggestions

suggestion items
idstringrequired

Unique identifier for the suggestion

typestringrequired

Type of suggestion (city, region, country, airport, landmark, property)

namestringrequired

Primary display name

subtitlestring

Additional context (e.g., "New York, United States")

coordinatesobject

Geographic coordinates

coordinates
latitudenumberrequired

Latitude

longitudenumberrequired

Longitude

radiusnumber

Suggested search radius in kilometers

propertyCountnumber

Number of properties in this location

countryCodestring

ISO country code

airportCodestring

IATA airport code (for airport suggestions)

Example

const response = await fetch('https://api.journey.com/members/properties/suggestions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${clerkToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: 'new york',
    limit: 10,
    types: ['city', 'airport', 'landmark']
  })
});

Request

curl -X POST "https://api.journey.com/members/properties/suggestions" \
  -H "Authorization: Bearer YOUR_CLERK_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "new york",
    "limit": 10,
    "types": ["city", "airport", "landmark"]
  }'

Response

200 Response
{
  "suggestions": [
    {
      "id": "city_nyc",
      "type": "city",
      "name": "New York City",
      "subtitle": "New York, United States",
      "coordinates": {
        "latitude": 40.7128,
        "longitude": -74.0060
      },
      "radius": 25,
      "propertyCount": 342,
      "countryCode": "US"
    },
    {
      "id": "airport_jfk",
      "type": "airport",
      "name": "John F. Kennedy International Airport",
      "subtitle": "New York, NY",
      "coordinates": {
        "latitude": 40.6413,
        "longitude": -73.7781
      },
      "radius": 15,
      "propertyCount": 45,
      "countryCode": "US",
      "airportCode": "JFK"
    },
    {
      "id": "landmark_times_square",
      "type": "landmark",
      "name": "Times Square",
      "subtitle": "Manhattan, New York",
      "coordinates": {
        "latitude": 40.7589,
        "longitude": -73.9851
      },
      "radius": 5,
      "propertyCount": 89,
      "countryCode": "US"
    },
    {
      "id": "region_upstate_ny",
      "type": "region",
      "name": "Upstate New York",
      "subtitle": "New York, United States",
      "coordinates": {
        "latitude": 43.2994,
        "longitude": -74.2179
      },
      "radius": 100,
      "propertyCount": 127,
      "countryCode": "US"
    }
  ]
}

Usage Notes

Search Types

  • City: Major cities and municipalities
  • Region: States, provinces, and geographic regions
  • Country: Countries and territories
  • Airport: Airports with IATA codes
  • Landmark: Popular attractions and points of interest
  • Property: Specific hotel properties

Best Practices

  1. Debounce requests - Implement client-side debouncing to avoid excessive API calls
  2. Minimum query length - Wait for at least 2 characters before making requests
  3. Cache results - Consider caching suggestions for common queries
  4. Handle empty results - Provide fallback suggestions for no matches

On this page