# Get Location Suggestions
> Source: /api-reference/members/properties/suggestions
> Get location autocomplete suggestions for property search
> Endpoint: POST /members/properties/suggestions

## Overview [#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 [#authentication]

Requires a valid Clerk JWT token in the Authorization header.

## Request Body [#request-body]

<ParamField body="query" type="string" required>
  Search query string (minimum 2 characters)
</ParamField>

<ParamField body="limit" type="number">
  Maximum number of suggestions to return (default: 10, max: 25)
</ParamField>

<ParamField body="types" type="array">
  Suggestion types to include: ["city", "region", "country", "airport", "landmark", "property"]
</ParamField>

## Response [#response]

Returns an array of location suggestions matching the query.

<ResponseField name="suggestions" type="array" required>
  Array of location suggestions
  
  <Expandable title="suggestion items">
    <ResponseField name="id" type="string" required>
      Unique identifier for the suggestion
    </ResponseField>
    
    <ResponseField name="type" type="string" required>
      Type of suggestion (city, region, country, airport, landmark, property)
    </ResponseField>
    
    <ResponseField name="name" type="string" required>
      Primary display name
    </ResponseField>
    
    <ResponseField name="subtitle" type="string">
      Additional context (e.g., "New York, United States")
    </ResponseField>
    
    <ResponseField name="coordinates" type="object">
      Geographic coordinates
      
      <Expandable title="coordinates">
        <ResponseField name="latitude" type="number" required>
          Latitude
        </ResponseField>
        
        <ResponseField name="longitude" type="number" required>
          Longitude
        </ResponseField>
      </Expandable>
    </ResponseField>
    
    <ResponseField name="radius" type="number">
      Suggested search radius in kilometers
    </ResponseField>
    
    <ResponseField name="propertyCount" type="number">
      Number of properties in this location
    </ResponseField>
    
    <ResponseField name="countryCode" type="string">
      ISO country code
    </ResponseField>
    
    <ResponseField name="airportCode" type="string">
      IATA airport code (for airport suggestions)
    </ResponseField>
  </Expandable>
</ResponseField>

## Example [#example]

```typescript
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']
  })
});
```

<RequestExample>

```bash cURL
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"]
  }'
```

```typescript TypeScript
const getSuggestions = async (query: string) => {
  const response = await fetch('https://api.journey.com/members/properties/suggestions', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_CLERK_JWT',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      query,
      limit: 10,
      types: ['city', 'region', 'airport']
    })
  });
  
  return response.json();
};

// Usage
const suggestions = await getSuggestions('new york');
```

</RequestExample>

<ResponseExample>

```json 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"
    }
  ]
}
```

</ResponseExample>

## Usage Notes [#usage-notes]

### Search Types [#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 [#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

## Related Endpoints [#related-endpoints]

- [Search Properties](/api-reference/members/properties/search) - Use suggestions in property search
- [Get Filters](/api-reference/members/properties/filters) - Get static location data
