PD Local Radar API

Local event recommendations for a user, based on their Piano segments and postal code, plus the min/max temperature for their area.

Endpoints

GET /api/recommandations/:ssoId

Returns up to 5 events near the user that match their segments, with the min/max temperature for the user's location.

Path parameters

NameTypeDescription
ssoIdstringThe user's SSO ID (Piano GRC ID)

How it works

  1. Loads the user's segments and postal code from Piano.
  2. Finds the user's coordinates and the 5 nearest postal codes.
  3. Picks events in those areas that match the user's segments, keeping the best score per event.
  4. Adds the distance in km and the min/max temperature from the Bright Sky forecast (today 00:00 to tomorrow 00:00 UTC).

Example

curl /api/recommandations/<ssoId>

Response 200

{
  "events": [
    {
      "event_id": "string",
      "event_name": "string | null",
      "start": "string | null",
      "location_name": "string | null",
      "city": "string | null",
      "zip": "string",
      "segment_id": "string",
      "segment_name": "string | null",
      "score": 0.87,
      "rank": 1,
      "distanceKm": 4.2
    }
  ],
  "temperature": { "min": 2.1, "max": 7.8 } | null
}

Temperatures are in °C. temperature is null if the weather service can't be reached or returns no temperatures.

Errors

StatusWhen
404No postal code is stored for the user
404No coordinates are known for the user's postal code

Caching

Responses are cached per user for 5 hours.

Data sources

SourceUsed for
PianoUser segments and postal code
S3 zip_coordinates.jsonPostal code → coordinates
S3 segment_event_match.jsonSegment ↔ event matches with score
Bright Sky (DWD)Weather forecast (min/max temperature)