{
  "openapi": "3.1.0",
  "info": {
    "title": "data.nlf.no",
    "version": "1.0.0",
    "description": "Åpne data fra Norges Luftsportforbund. NOTAM-ene NLF følger med på for norske flyplasser (åpningstider, PPR, stengte flyplasser og rullebaner), bare de som gjelder nå eller kommer; til informasjon, erstatter ikke briefing før flyging. Og arrangementene i Luftsportkalenderen, som ligger på kalender.nlf.no.",
    "contact": {
      "name": "Norges Luftsportforbund",
      "url": "https://nlf.no"
    }
  },
  "servers": [
    {
      "url": "https://data.nlf.no"
    }
  ],
  "paths": {
    "/api/notam/{icao}": {
      "get": {
        "summary": "NOTAM-er for en flyplass",
        "description": "NOTAM-ene som gjelder nå og de som kommer, de som gjelder først. Utløpte og kansellerte er ikke med.",
        "operationId": "getAirportNotams",
        "parameters": [
          {
            "name": "icao",
            "in": "path",
            "required": true,
            "description": "Flyplassens ICAO-kode, fire bokstaver (store eller små)",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z]{4}$",
              "example": "ENHD"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "NOTAM-ene for flyplassen (en tom liste når det ikke finnes noen)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "airport",
                    "generatedAt",
                    "count",
                    "notams"
                  ],
                  "properties": {
                    "airport": {
                      "type": "string",
                      "example": "ENHD"
                    },
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "notams": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Notam"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ikke en ICAO-kode",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Noe gikk galt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "NOTAM"
        ]
      }
    },
    "/api/notam": {
      "get": {
        "summary": "Flyplasser med NOTAM-er",
        "description": "Flyplassene som har NOTAM-er som gjelder nå eller kommer, med antall og adressen til NOTAM-ene deres.",
        "operationId": "getAirports",
        "responses": {
          "200": {
            "description": "Flyplassene",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "generatedAt",
                    "count",
                    "airports"
                  ],
                  "properties": {
                    "generatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "airports": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "airport",
                          "active",
                          "upcoming",
                          "url"
                        ],
                        "properties": {
                          "airport": {
                            "type": "string",
                            "example": "ENHD"
                          },
                          "active": {
                            "type": "integer"
                          },
                          "upcoming": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Noe gikk galt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "NOTAM"
        ]
      }
    },
    "/api/klubb/{ids}/{format}": {
      "servers": [
        {
          "url": "https://kalender.nlf.no",
          "description": "Luftsportkalenderen"
        }
      ],
      "get": {
        "summary": "Arrangementene til en klubb",
        "operationId": "getClubEvents",
        "tags": [
          "Luftsportkalenderen"
        ],
        "description": "Kommende arrangementer for klubben, de første først. Oppdateres hvert kvarter.",
        "parameters": [
          {
            "name": "ids",
            "in": "path",
            "required": true,
            "description": "Klubbens organisasjons-ID-er, skilt med komma (høyst 20)",
            "schema": {
              "type": "string",
              "example": "12345,67890"
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "description": "json, ical (kalenderabonnement) eller rss",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "ical",
                "rss"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Arrangementer som slutter fra og med datoen (uten: fra i dag)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Høyst så mange arrangementer (opptil 1000)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arrangementene, som JSON, iCal eller RSS etter formatet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              },
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              },
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Ingen gyldige ID-er",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalendarError"
                }
              }
            }
          }
        }
      }
    },
    "/api/kommune/{nummer}/{format}": {
      "servers": [
        {
          "url": "https://kalender.nlf.no",
          "description": "Luftsportkalenderen"
        }
      ],
      "get": {
        "summary": "Arrangementene i en kommune",
        "operationId": "getMunicipalityEvents",
        "tags": [
          "Luftsportkalenderen"
        ],
        "description": "Kommende arrangementer i kommunen, de første først. Har ikke feltene som bare klubbstrømmen har.",
        "parameters": [
          {
            "name": "nummer",
            "in": "path",
            "required": true,
            "description": "Kommunenummeret, fire sifre",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}$",
              "example": "0301"
            }
          },
          {
            "name": "format",
            "in": "path",
            "required": true,
            "description": "json, ical (kalenderabonnement) eller rss",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "ical",
                "rss"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arrangementene, som JSON, iCal eller RSS etter formatet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Event"
                  }
                }
              },
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              },
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ical": {
      "servers": [
        {
          "url": "https://kalender.nlf.no",
          "description": "Luftsportkalenderen"
        }
      ],
      "get": {
        "summary": "Hele kalenderen som kalenderabonnement",
        "operationId": "getCalendarIcal",
        "tags": [
          "Luftsportkalenderen"
        ],
        "parameters": [
          {
            "name": "sections",
            "in": "query",
            "description": "Seksjoner, ID-ene skilt med komma (0: uten seksjon). 109 Fallskjerm, 110 HPS, 111 Seilfly, 235 Ballong, 236 Modellfly, 237 Sportsfly, 238 Motorfly",
            "schema": {
              "type": "string",
              "example": "111,109"
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Typer, kodene skilt med komma: EVENT_UNOFFICIAL, EVENT_OFFICIAL, MEETING, WORKSHOP, EVENT_SERIES, LICENSE, SCHOOL, AIRSHOW, DEADLINE",
            "schema": {
              "type": "string",
              "example": "WORKSHOP"
            }
          },
          {
            "name": "deadlines",
            "in": "query",
            "description": "include: ta med frister. only: bare frister",
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "only"
              ]
            }
          },
          {
            "name": "free",
            "in": "query",
            "description": "1: bare gratis arrangementer",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "intro",
            "in": "query",
            "description": "1: bare arrangementer for nybegynnere",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "reverse",
            "in": "query",
            "description": "true: de siste først",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arrangementene i iCal-format",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/rss": {
      "servers": [
        {
          "url": "https://kalender.nlf.no",
          "description": "Luftsportkalenderen"
        }
      ],
      "get": {
        "summary": "Hele kalenderen som RSS",
        "operationId": "getCalendarRss",
        "tags": [
          "Luftsportkalenderen"
        ],
        "parameters": [
          {
            "name": "sections",
            "in": "query",
            "description": "Seksjoner, ID-ene skilt med komma (0: uten seksjon). 109 Fallskjerm, 110 HPS, 111 Seilfly, 235 Ballong, 236 Modellfly, 237 Sportsfly, 238 Motorfly",
            "schema": {
              "type": "string",
              "example": "111,109"
            }
          },
          {
            "name": "types",
            "in": "query",
            "description": "Typer, kodene skilt med komma: EVENT_UNOFFICIAL, EVENT_OFFICIAL, MEETING, WORKSHOP, EVENT_SERIES, LICENSE, SCHOOL, AIRSHOW, DEADLINE",
            "schema": {
              "type": "string",
              "example": "WORKSHOP"
            }
          },
          {
            "name": "deadlines",
            "in": "query",
            "description": "include: ta med frister. only: bare frister",
            "schema": {
              "type": "string",
              "enum": [
                "include",
                "only"
              ]
            }
          },
          {
            "name": "free",
            "in": "query",
            "description": "1: bare gratis arrangementer",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "intro",
            "in": "query",
            "description": "1: bare arrangementer for nybegynnere",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "reverse",
            "in": "query",
            "description": "true: de siste først",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Arrangementene som RSS",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Notam": {
        "type": "object",
        "required": [
          "number",
          "airport",
          "type",
          "typeLabel",
          "status",
          "start",
          "end",
          "endEstimated",
          "permanent",
          "title",
          "description",
          "notam",
          "issued"
        ],
        "properties": {
          "number": {
            "type": "string",
            "example": "A1001/26",
            "description": "NOTAM-nummeret"
          },
          "airport": {
            "type": "string",
            "example": "ENHD",
            "description": "Flyplassens ICAO-kode"
          },
          "type": {
            "type": "string",
            "enum": [
              "opening-hours",
              "ppr",
              "aerodrome-closed",
              "runway-closed",
              "other"
            ],
            "description": "Hva NOTAM-en gjelder"
          },
          "typeLabel": {
            "type": "string",
            "example": "Åpningstider",
            "description": "Typen på norsk"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "upcoming"
            ],
            "description": "active: gjelder nå. upcoming: starter senere"
          },
          "start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Gjelder fra (UTC)"
          },
          "end": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Gjelder til (UTC); null når permanent"
          },
          "endEstimated": {
            "type": "boolean",
            "description": "Slutten er anslått (EST)"
          },
          "permanent": {
            "type": "boolean",
            "description": "Ingen slutt (PERM)"
          },
          "title": {
            "type": "string",
            "description": "Kort tittel på norsk"
          },
          "description": {
            "type": "string",
            "description": "Hva NOTAM-en betyr, på norsk, med tidene i norsk tid"
          },
          "notam": {
            "type": "string",
            "description": "Hele NOTAM-teksten slik FAA gir den (ICAO-format når den finnes)"
          },
          "issued": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Når NOTAM-en ble utstedt (UTC)"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Hva som gikk galt, på norsk"
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "integer"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "description": "Typen på norsk"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "organizer": {
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "type": [
              "string",
              "null"
            ]
          },
          "position": {
            "type": "object",
            "properties": {
              "latitude": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "longitude": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postalArea": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "sportName": {
            "type": [
              "string",
              "null"
            ]
          },
          "signUpFee": {
            "type": [
              "number",
              "null"
            ]
          },
          "registrationUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "typeCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "organizerOrgId": {
            "type": [
              "integer",
              "string",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "signUpStart": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "signUpEnd": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "sportId": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Bare i klubbstrømmen"
          },
          "isIntroEvent": {
            "type": "boolean",
            "description": "Bare i klubbstrømmen"
          }
        }
      },
      "CalendarError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "NOTAM",
      "description": "NOTAM-er for norske flyplasser (data.nlf.no)"
    },
    {
      "name": "Luftsportkalenderen",
      "description": "Arrangementene i Luftsportkalenderen (kalender.nlf.no)"
    }
  ]
}