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
| Name | Type | Description |
|---|---|---|
ssoId | string | The user's SSO ID (Piano GRC ID) |
How it works
- Loads the user's segments and postal code from Piano.
- Finds the user's coordinates and the 5 nearest postal codes.
- Picks events in those areas that match the user's segments, keeping the best score per event.
- 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
| Status | When |
|---|---|
404 | No postal code is stored for the user |
404 | No coordinates are known for the user's postal code |
Caching
Responses are cached per user for 5 hours.
Data sources
| Source | Used for |
|---|---|
| Piano | User segments and postal code |
S3 zip_coordinates.json | Postal code → coordinates |
S3 segment_event_match.json | Segment ↔ event matches with score |
| Bright Sky (DWD) | Weather forecast (min/max temperature) |