Journey Docs
Members APIProperties

Get Map Properties

Get properties for map display with clustering and bounds

POST/members/properties/map

Overview

Retrieves properties optimized for map display with clustering support and viewport bounds. This endpoint is designed for interactive maps where properties need to be displayed as markers or clusters based on zoom level and viewport.

Returns lean property data suitable for map markers while supporting dynamic clustering and bounds-based filtering.

Authentication

Requires a valid Clerk JWT token in the Authorization header.

Request Body

boundsbodyobjectrequired

Map viewport bounds for filtering properties

bounds
northbodynumberrequired

Northern boundary latitude

southbodynumberrequired

Southern boundary latitude

eastbodynumberrequired

Eastern boundary longitude

westbodynumberrequired

Western boundary longitude

zoombodynumberrequired

Map zoom level (affects clustering behavior)

datesbodyobject

Check-in and check-out dates for availability filtering

properties
checkInbodystring

Check-in date (YYYY-MM-DD)

checkOutbodystring

Check-out date (YYYY-MM-DD)

filtersbodyobject

Search filters to apply

filter options
priceRangebodyobject

Price range in points per night

price range
minbodynumber

Minimum price per night

maxbodynumber

Maximum price per night

propertyTypesbodyarray

Property types to include

amenitiesbodyarray

Required amenities

brandsbodyarray

Specific brands to include

guestRatingbodynumber

Minimum guest rating

enableClusteringbodyboolean

Whether to enable property clustering (default: true)

clusterRadiusbodynumber

Clustering radius in pixels (default: 50)

Response

Returns properties and clusters optimized for map display.

propertiesarrayrequired

Individual properties that should be displayed as markers

property markers
idnumberrequired

Property identifier

latitudenumberrequired

Property latitude

longitudenumberrequired

Property longitude

namestringrequired

Property name

nightlyCostnumberrequired

Cost per night in points

guestRatingnumber

Average guest rating

heroImageobject

Thumbnail image for map popup

image
urlstringrequired

Image URL

altstring

Alt text

availableboolean

Availability status for requested dates (if dates provided)

clustersarrayrequired

Property clusters for areas with multiple properties

cluster markers
idstringrequired

Cluster identifier

latitudenumberrequired

Cluster center latitude

longitudenumberrequired

Cluster center longitude

propertyCountnumberrequired

Number of properties in cluster

averageCostnumberrequired

Average nightly cost in the cluster

costRangeobject

Price range within the cluster

cost range
minnumberrequired

Lowest price in cluster

maxnumberrequired

Highest price in cluster

boundsobjectrequired

Geographic bounds of the cluster

cluster bounds
northnumberrequired

Northern boundary

southnumberrequired

Southern boundary

eastnumberrequired

Eastern boundary

westnumberrequired

Western boundary

totalnumberrequired

Total number of properties within the bounds (before clustering)

viewportobject

Suggested viewport adjustments

viewport
boundsobject

Optimal bounds for displaying all results

zoomnumber

Suggested zoom level

Example

const response = await fetch('https://api.journey.com/members/properties/map', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${clerkToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    bounds: {
      north: 40.9176,
      south: 40.4774,
      east: -73.7004,
      west: -74.2591
    },
    zoom: 10,
    dates: {
      checkIn: '2024-06-15',
      checkOut: '2024-06-17'
    },
    enableClustering: true,
    clusterRadius: 50
  })
});

Request

cURL
curl -X POST "https://api.journey.com/members/properties/map" \
  -H "Authorization: Bearer YOUR_CLERK_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "bounds": {
      "north": 40.9176,
      "south": 40.4774,
      "east": -73.7004,
      "west": -74.2591
    },
    "zoom": 10,
    "dates": {
      "checkIn": "2024-06-15",
      "checkOut": "2024-06-17"
    },
    "filters": {
      "priceRange": {
        "min": 30000,
        "max": 100000
      },
      "propertyTypes": ["hotel", "resort"],
      "guestRating": 4.0
    },
    "enableClustering": true,
    "clusterRadius": 50
  }'

Response

200 Response
{
  "properties": [
    {
      "id": 123,
      "latitude": 40.7128,
      "longitude": -74.0060,
      "name": "Manhattan Boutique Hotel",
      "nightlyCost": 45000,
      "guestRating": 4.6,
      "heroImage": {
        "url": "https://cdn.journey.com/properties/123/thumb.jpg",
        "alt": "Manhattan boutique hotel exterior"
      },
      "available": true
    }
  ],
  "clusters": [
    {
      "id": "cluster_midtown_1",
      "latitude": 40.7550,
      "longitude": -73.9840,
      "propertyCount": 15,
      "averageCost": 52000,
      "costRange": {
        "min": 35000,
        "max": 85000
      },
      "bounds": {
        "north": 40.7614,
        "south": 40.7486,
        "east": -73.9765,
        "west": -73.9915
      }
    }
  ],
  "total": 127,
  "viewport": {
    "bounds": {
      "north": 40.8876,
      "south": 40.5074,
      "east": -73.7304,
      "west": -74.2291
    },
    "zoom": 11
  }
}

Usage Notes

Clustering Behavior

  • High zoom levels (greater than 15): Properties displayed individually
  • Medium zoom levels (10-15): Automatic clustering based on density
  • Low zoom levels (less than 10): Aggressive clustering to reduce marker count

Performance Considerations

  • Viewport size: Larger bounds return more properties
  • Filter complexity: More filters increase processing time
  • Response size: Clustering reduces payload size for dense areas

Map Integration

  1. Display individual properties as markers with price labels
  2. Show clusters as grouped markers with property count
  3. Handle cluster clicks by zooming in or showing property list
  4. Update on map move by calling endpoint with new bounds

On this page