{"source":"kystdatahuset","operation":"get_port_calls","description":"Arrivals to, or departures from, one or more Norwegian ports (SafeSeaNet),\nfor a span of whole years, newest first. Signature: get_port_calls(location_ids: list of integer (comma-separated), required; from_year: integer, calendar year, required; to_year: integer, calendar year, optional, default None; direction: string, optional, default 'arrivals'; limit: integer, items, optional, default 50; offset: integer, items, optional, default 0).","signature":"get_port_calls(location_ids: list of integer (comma-separated), required; from_year: integer, calendar year, required; to_year: integer, calendar year, optional, default None; direction: string, optional, default 'arrivals'; limit: integer, items, optional, default 50; offset: integer, items, optional, default 0)","parameters":[{"name":"location_ids","type":"array","schema":{"items":{"type":"integer"},"type":"array"},"required":true,"default":null,"description":"One or more port/location ids from search_ports.","unit":null},{"name":"from_year","type":"integer","schema":{"type":"integer"},"required":true,"default":null,"description":"First year (inclusive), e.g. 2025. Unit: calendar year.","unit":"calendar year"},{"name":"to_year","type":"integer","schema":{"anyOf":[{"type":"integer"},{"type":"null"}]},"required":false,"default":null,"description":"Last year (inclusive). Defaults to from_year. Unit: calendar year.","unit":"calendar year"},{"name":"direction","type":"string","schema":{"type":"string"},"required":false,"default":"arrivals","description":"\"arrivals\" (default) or \"departures\".","unit":null},{"name":"limit","type":"integer","schema":{"type":"integer"},"required":false,"default":50,"description":"Max calls to return, 1-200 (default 50). Sorted by ETA (arrivals) or ETD (departures) descending. Unit: items.","unit":"items"},{"name":"offset","type":"integer","schema":{"type":"integer"},"required":false,"default":0,"description":"Skip this many calls (for pagination). Unit: items.","unit":"items"}],"json_get_url_template":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset/get_port_calls?location_ids={location_ids}&from_year={from_year}&to_year={to_year}&direction=arrivals&limit=50&offset=0","schema_scope":"#/data in the successful operation envelope","response_schema":{"type":"object","properties":{"direction":{"type":"string","enum":["arrivals","departures"]},"location_ids":{"type":"array","items":{"type":"integer"}},"from_year":{"type":"integer"},"to_year":{"type":"integer"},"count":{"type":"integer"},"returned":{"type":"integer"},"offset":{"type":"integer"},"calls":{"type":"array","items":{"type":"object","properties":{"shipname":{"type":"string"},"vessel_id":{"type":"integer"},"imo":{"type":"integer"},"callsign":{"type":"string"},"shiptype":{"type":"string"},"gt":{"type":"number"},"length":{"type":"number"},"eta":{"type":["string","null"],"format":"date-time"},"etd":{"type":["string","null"],"format":"date-time"},"from_id":{"type":"integer"},"from_name":{"type":"string"},"from_code":{"type":"string"},"from_country":{"type":"string"},"to_id":{"type":"integer"},"to_name":{"type":"string"},"to_code":{"type":"string"},"to_country":{"type":"string"},"hazmat":{"type":"boolean"},"draft":{"type":"number"},"cargo_gross":{"type":"number"},"cargo_net":{"type":"number"}},"additionalProperties":false}}},"additionalProperties":false,"required":["direction","location_ids","from_year","to_year","count","returned","offset","calls"]},"response_schema_status":{"status":"declared","codegen_safe":true,"description":"Maintained response contract."},"entity_projection":{"status":"projected","entity_types":["port"],"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/kystdatahuset/get_port_calls/schema","operation":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset/get_port_calls","source":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"},"output_fields":["direction","location_ids","from_year","to_year","count","returned","offset","calls","calls[].shipname","calls[].vessel_id","calls[].imo","calls[].callsign","calls[].shiptype","calls[].gt","calls[].length","calls[].eta","calls[].etd","calls[].from_id","calls[].from_name","calls[].from_code","calls[].from_country","calls[].to_id","calls[].to_name","calls[].to_code","calls[].to_country","calls[].hazmat","calls[].draft","calls[].cargo_gross","calls[].cargo_net"],"output_fields_truncated":false,"canonical_field_aliases":{},"response_example":{"source":"kystdatahuset","operation":"get_port_calls","parameters":{"location_ids":[1],"from_year":1,"to_year":1,"direction":"arrivals","limit":50,"offset":0},"data":{"direction":"arrivals","location_ids":[1],"from_year":1,"to_year":1,"count":1,"returned":1,"offset":1,"calls":[{"shipname":"Example","vessel_id":1,"imo":1,"callsign":"example value","shiptype":"example value","gt":1.0,"length":1.0,"eta":"2026-01-15T12:00:00Z","etd":"2026-01-15T12:00:00Z","from_id":1,"from_name":"Example","from_code":"example value","from_country":"example value","to_id":1,"to_name":"Example","to_code":"example value","to_country":"example value","hazmat":true,"draft":1.0,"cargo_gross":1.0,"cargo_net":1.0}]},"entities":[],"_meta":{"retrieved_at":"2026-01-15T12:00:00Z","language":"en","content_languages":["en"],"sources":[{"id":"kystdatahuset","name":"Kystdatahuset","description":"Norwegian ports, quays, maritime locations and reported port connections from the Coastal Administration.","cache_ttl_seconds":60}]},"_provenance":{"data":{"source":"kystdatahuset","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset"},"entities":{"source":"kystdatahuset","source_api":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset","derived_from":"#/data","description":"Normalized projection of data."}},"_links":{"self":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset/get_port_calls","source":"https://allemannsdata.com/wiki/api/v1/kilder/kystdatahuset","wiki":"https://allemannsdata.com/wiki/kilder/kystdatahuset/get_port_calls/","feedback":"https://allemannsdata.com/wiki/api/v1/feedback"}}}
