{"source":"avinor","operation":"get_flights","description":"Flights to/from one airport, with schedule and live status from Avinor. Signature: get_flights(airport_id: string, required; direction: string, optional, default None; hours_back: integer, optional, default 1; hours_ahead: integer, optional, default 7; include_codeshare: yes/no, optional, default False; max_results: integer, optional, default 100; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0).","signature":"get_flights(airport_id: string, required; direction: string, optional, default None; hours_back: integer, optional, default 1; hours_ahead: integer, optional, default 7; include_codeshare: yes/no, optional, default False; max_results: integer, optional, default 100; limit: integer, items, optional, default 25; offset: integer, items, optional, default 0)","parameters":[{"name":"airport_id","type":"string","schema":{"type":"string"},"required":true,"default":null,"description":"IATA code, e.g. \"OSL\", \"BGO\", \"TRD\", \"SVG\", \"TOS\". Full coverage for Avinor's 43 Norwegian airports; a foreign airport returns only its flights to/from Norway. Unknown codes error.","unit":null},{"name":"direction","type":"string","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"required":false,"default":null,"description":"Optional \"arrivals\" or \"departures\"; default both.","unit":null},{"name":"hours_back","type":"integer","schema":{"type":"integer"},"required":false,"default":1,"description":"Window start, hours before now (default 1).","unit":null},{"name":"hours_ahead","type":"integer","schema":{"type":"integer"},"required":false,"default":7,"description":"Window end, hours after now (default 7).","unit":null},{"name":"include_codeshare","type":"boolean","schema":{"type":"boolean"},"required":false,"default":false,"description":"Also list codeshare flight numbers (e.g. the KL/AF number of a SAS-operated flight) per flight.","unit":null},{"name":"max_results","type":"integer","schema":{"type":"integer"},"required":false,"default":100,"description":"Cap on flights returned (default 100). A large airport can have hundreds in the default window; narrow the window or direction rather than raising the cap.","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"display_type":"integer","required":false,"default":25,"description":"Maximum list items returned by the gateway (default 25, maximum 100).","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer","minimum":0,"default":0},"display_type":"integer","required":false,"default":0,"description":"Number of list items to skip before returning the page.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/avinor/get_flights?airport_id={airport_id}&direction={direction}&hours_back=1&hours_ahead=7&include_codeshare=false&max_results=100&limit=25&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"airport":{"type":"string"},"last_update":{"type":["string","null"],"format":"date-time"},"flight_count":{"type":"integer"},"flights":{"type":"array","items":{"type":"object","properties":{"flight_id":{"type":["string","null"]},"airline":{"type":["string","null"]},"direction":{"type":"string","enum":["arrival","departure"]},"schedule_time":{"type":["string","null"],"format":"date-time"},"airport":{"type":["string","null"]},"area":{"type":["string","null"]},"via_airport":{"type":"string"},"gate":{"type":"string"},"check_in":{"type":"string"},"belt":{"type":"string"},"delayed":{"type":"boolean"},"status":{"type":"object","properties":{"code":{"type":["string","null"]},"text":{"type":["string","null"]},"time":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"codeshare_flights":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"truncated":{"type":"boolean"},"attribution":{"type":"string"}},"additionalProperties":false,"required":["airport","flight_count","flights","truncated","attribution"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"projected","entity_types":["airport"],"description":"Recognized records and stable operation identifiers are projected; an empty array means the successful payload contained no recognizable entity."},"error_contract":{"scope":"top-level HTTP error response; never part of a success payload","schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"},"details":{"type":"object"}},"additionalProperties":false,"required":["code","message","retryable"]},"suggestion":{"type":"string"},"_meta":{"type":"object","properties":{"retrieved_at":{"type":"string","format":"date-time"},"language":{"type":"string","const":"en"},"content_languages":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"object"}}},"required":["retrieved_at","language","content_languages","sources"]},"_links":{"type":"object","properties":{"self":{"type":"string","format":"uri"},"api_index":{"type":"string","format":"uri"},"feedback":{"type":"string","format":"uri"}},"required":["self","api_index","feedback"],"additionalProperties":false}},"additionalProperties":false,"required":["error","suggestion","_meta","_links"]},"statuses":{"400":{"codes":["MISSING_PARAMETER","INVALID_PARAMETER","INVALID_REQUEST"],"retryable":false},"404":{"codes":["SOURCE_NOT_FOUND","OPERATION_NOT_FOUND","ENTITY_NOT_FOUND"],"retryable":false},"429":{"codes":["RATE_LIMITED","GATEWAY_RATE_LIMITED"],"retryable":true},"502":{"codes":["SOURCE_UNAVAILABLE"],"retryable":true},"500":{"codes":["INTERNAL_ERROR"],"retryable":true}}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/avinor/get_flights","operation":"https://allemannsdata.com/wiki/api/v1/kilder/avinor/get_flights","source":"https://allemannsdata.com/wiki/api/v1/kilder/avinor","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["airport","last_update","flight_count","flights","flights[].flight_id","flights[].airline","flights[].direction","flights[].schedule_time","flights[].airport","flights[].area","flights[].via_airport","flights[].gate","flights[].check_in","flights[].belt","flights[].delayed","flights[].status","flights[].status.code","flights[].status.text","flights[].status.time","flights[].codeshare_flights","truncated","attribution"],"output_fields_truncated":false,"canonical_field_aliases":{"identifier":["flights[].status.code"],"timestamp":["flights[].status.time"]},"response_example":{"source":"avinor","operation":"get_flights","parameters":{"airport_id":"example-id","direction":"example value","hours_back":1,"hours_ahead":7,"include_codeshare":false,"max_results":100},"data":{"airport":"example value","last_update":"2026-01-15T12:00:00Z","flight_count":1,"flights":[{"flight_id":"example-id","airline":"example value","direction":"arrival","schedule_time":"2026-01-15T12:00:00Z","airport":"example value","area":"example value","via_airport":"example value","gate":"example value","check_in":"example value","belt":"example value","delayed":true,"status":{"code":"example value","text":"example value","time":"2026-01-15T12:00:00Z"},"codeshare_flights":["example value"]}],"truncated":true,"attribution":"example value"},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"avinor","name":"Avinor flight data","description":"Real-time arrivals, departures, status, airport metadata and airline names for Norwegian airports.","cache_ttl_seconds":60,"documentation":"https://partner.avinor.no/"}]},"_provenance":{"data":{"source":"avinor","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/avinor"},"entities":{"source":"avinor","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/avinor","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/avinor/get_flights","source":"https://allemannsdata.com/wiki/api/v1/kilder/avinor","wiki":"https://allemannsdata.com/wiki/kilder/avinor/get_flights/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
