Skip to content
Jasper Platenburg edited this page Apr 25, 2025 · 7 revisions

Welcome to the OpenAED API!

Authorisation

An access token must be supplied with every request. If you are hosting the API yourself, you can make one using php artisan api:new-access-token. If you're trying to use the main OpenAED instance of the API, please contact api@openaed.org for a key.

Pass the token in the Authorization header.

Endpoints

GET /info

  • Gives out version and access information
  • Example response:
    {
      "version": "2025.1.0",
      "datetime": "2025-03-25T13:00:41.445921Z",
      "token": {
          "expires_at": "2026-01-01T12:00:00.000000Z",
          "assigned_to": "Test User",
          "scope": [
              "*"
          ],
          "last_used_at": "2025-03-25T13:00:41.000000Z"
        }
     }

GET /api/defibrillators

  • Returns all defibrillators
  • This endpoint requires the 'export' scope, due to the data size.
  • Example response:
    [
     {
         "id": "9d92d003-8648-4967-9e93-ae50e9c1d48a",
         "osm_id": 4833152605,
         "latitude": "51.8199763000",
         "longitude": "5.8652548000",
         "access": null,
         "indoor": true,
         "locked": null,
         "location": null,
         "manufacturer": null,
         "model": null,
         "opening_hours": null,
         "image": null,
         "address": {
              "full_address": "<full address>",
              "address": {
                    "house_number": "12",
                    "road": "Street name",
                    ...
              }
         },
         "last_synced_at": "2025-03-25T12:02:37.000000Z",
         "operator": null
     },
     ...
    ]

GET /api/defibrillators/{id}

  • Get a specific defibrillator by its UUID. Note that this is not the OpenStreetMap ID.

GET /api/defibrillators/nearby/{latitude}/{longitude}/{radius}

  • Get defibrillators within {radius} metres from [{latitude}, {longitude}]
  • Defibrillators will have an extra distance key, also in metres.
  • Defibrillators will be ordered from closest to furthest

POST /api/defibrillators/area

  • Get all defibrillators within an area.
  • Areas are limited to simple, non-intersecting polygons.
  • Make sure the last point is equal to the first point, so the area is closed.
  • Supply the area within the body in JSON format:
     {
       "points": [
         [1, 2],
         [3, 4],
         [1, 2]
       ]
     }

Filters

Any endpoint that returns multiple defibrillators supports filters using query parameters.

  • basic (true/false) - Only return basic info: ID, OpenStreetMap ID, coordinates and access value
  • order_by - The column to order the results with
  • order_direction (asc/desc) - The direction to order the results in