Get Location Suggestions
Get location autocomplete suggestions for property search
/members/properties/suggestionsOverview
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
querybodystringrequiredSearch query string (minimum 2 characters)
limitbodynumberMaximum number of suggestions to return (default: 10, max: 25)
typesbodyarraySuggestion types to include: ["city", "region", "country", "airport", "landmark", "property"]
Response
Returns an array of location suggestions matching the query.
suggestionsarrayrequiredArray of location suggestions
suggestion items
idstringrequiredUnique identifier for the suggestion
typestringrequiredType of suggestion (city, region, country, airport, landmark, property)
namestringrequiredPrimary display name
subtitlestringAdditional context (e.g., "New York, United States")
coordinatesobjectGeographic coordinates
coordinates
latitudenumberrequiredLatitude
longitudenumberrequiredLongitude
radiusnumberSuggested search radius in kilometers
propertyCountnumberNumber of properties in this location
countryCodestringISO country code
airportCodestringIATA 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
{
"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
- Debounce requests - Implement client-side debouncing to avoid excessive API calls
- Minimum query length - Wait for at least 2 characters before making requests
- Cache results - Consider caching suggestions for common queries
- Handle empty results - Provide fallback suggestions for no matches
Related Endpoints
- Search Properties - Use suggestions in property search
- Get Filters - Get static location data