/geodata/getnearest - Find nearest resorts

Overview

The /geodata/getnearest endpoint finds ski resorts nearest to a given geographical location using latitude and longitude coordinates.

Purpose

Endpoint

GET /geodata/getnearest

Parameters

Query parameters

lat (float, required)

Latitude coordinate of the search origin point.

Range: -90 to 90 (decimal degrees)

Examples:


lon (float, required)

Longitude coordinate of the search origin point.

Range: -180 to 180 (decimal degrees)

Examples:


distance (integer, optional, default: 50)

Maximum search radius in kilometers from the origin point.

Default: 50 km Range: Any positive integer (practical range: 1-1000)

Examples:

Note: Results are limited to a maximum of 50 resorts, ordered by distance (closest first).


sourceFields (string, optional)

Return only specific fields from each resort's _source object using dot notation (comma-separated).

Purpose: Optimize response payload size by requesting only needed fields

Examples:


Response format

Success response structure

{
  "took": 1,
  "timed_out": false,
  "hits": {
    "total": 8,
    "max_score": null,
    "hits": [
      {
        "_index": "fnugg_resort",
        "_type": "resort",
        "_id": "89",
        "_version": 1,
        "found": true,
        "_source": {
          "id": 89,
          "name": "Oslo Vinterpark",
          "description": "Oslo Vinterpark ligger bare 30 minutter fra Oslo sentrum...",
          "location": {
            "lat": 59.9700,
            "lon": 10.6700
          },
          "resort_open": true,
          "lifts": {
            "total": 11,
            "open": 9
          },
          "slopes": {
            "total": 18,
            "open": 16
          },
          "conditions": {
            "combined": {
              "top": {
                "snow": {
                  "depth": 85
                }
              }
            }
          }
          // ... more fields (see /get/resort/{id} documentation)
        },
        "sort": [12500.0]
      },
      {
        "_index": "fnugg_resort",
        "_type": "resort",
        "_id": "73",
        "_version": 1,
        "found": true,
        "_source": {
          "id": 73,
          "name": "Norefjell",
          "location": {
            "lat": 60.1800,
            "lon": 9.5500
          },
          "resort_open": true
          // ... more fields
        },
        "sort": [45300.0]
      }
      // ... more results
    ]
  }
}

Error response (missing parameters)

{
  "error": "Missing required parameters: lat and lon"
}

Response fields

Top level fields

Individual Result Fields

Each resort in hits.hits contains:


Example requests

Find resorts near Oslo

GET /geodata/getnearest?lat=59.9139&lon=10.7522&distance=50

Finds all resorts within 50 km of Oslo city center.


Find very close resorts

GET /geodata/getnearest?lat=60.4720&lon=5.3340&distance=10

Finds resorts within 10 km of Bergen.


Find resorts with specific fields only

GET /geodata/getnearest?lat=61.3150&lon=12.2680&distance=100&sourceFields=name,location,resort_open,lifts.open,slopes.open

Finds resorts within 100 km, returning only name, location, status, and facility counts.


GET /geodata/getnearest?lat=59.9139&lon=10.7522&distance=200

Finds resorts within 200 km (large search radius for broader discovery).


Use cases

  1. "Resorts near me": Use device geolocation to find nearby resorts
  2. Map-based search: Display resorts on a map around a clicked location
  3. Regional exploration: Find all resorts in a region by searching from a central point
  4. Trip planning: Find resorts within driving distance from a city
  5. Mobile apps: Provide location-based resort recommendations
  6. Distance-based filtering: Combine with other filters (e.g., only open resorts nearby)

Notes