Kystdatahuset Open API (AIS, havner og sjøtrafikk)
Levert av Kystverket · org.nr. 874783242
API-et bak kystdatahuset.no: AIS i sanntid (antall skip per skipstype, skip som GeoJSON), havner og lokasjoner, ankringsområder og ankringstid, losing, bunkring, landstrøm, hendelser og kodelister. Spesifikasjonen har over 150 operasjoner…
Forbehold
- Sporing, sanntidsspor og deler av skips- og skipstypedataene krever innlogging (JWT).
- Mange spørringer er POST med JSON-kropp.
Om API-et
API-et bak kystdatahuset.no: AIS i sanntid (antall skip per skipstype, skip som GeoJSON), havner og lokasjoner, ankringsområder og ankringstid, losing, bunkring, landstrøm, hendelser og kodelister. Spesifikasjonen har over 150 operasjoner, og mange spørringer sendes som POST med JSON-kropp. Sporing, sanntidsspor og deler av skips- og skipstypedataene krever innlogging, men de åpne GET-kallene svarer uten nøkkel. Vilkår på kystdatahuset.no/artikkel/api-tilgang.
Kom i gang
# antall skip i AIS akkurat nå, per skipstype curl "https://kystdatahuset.kystverket.no/ws/api/ais/realtime/vessels-by-type"
Endepunkter (158)
Voyage · 21
- POST
/api/voyage/aggregated/arrivalsGet arrivals for years - POST
/api/voyage/aggregated/arrivals-by-dayGet aggregated voyage data for arrivals to location in Norway within specified period - POST
/api/voyage/aggregated/cruise/publicGet summary of all cruise traffic (does not include passenger numbers (privileged information)) - POST
/api/voyage/aggregated/departures-by-dayGet aggregated voyage data for departures from locations in Norway within specified period - GET
/api/voyage/aggregated/{fromYear}/{toYear}Get aggregated voyage data for period - POST
/api/voyage/aggregated/{fromYear}/{toYear}Get aggregated voyage data for period - GET
/api/voyage/arrivals-current-month-by-departure-countryOutput statistics on yearly cruise arrivals to destinations in Norway - POST
/api/voyage/arrivals-departures/for-locationGet aggregated voyage data (arrivals and departures) for one or more locations and period - GET
/api/voyage/arrivals-previous-month-by-departure-countryOutput statistics on yearly cruise arrivals to destinations in Norway by previous month - POST
/api/voyage/arrivals/for-locationsFind voyages to one or more destination locations in year(s) - GET
/api/voyage/between/{fromDate}/{toDate}Retrieve all voyages within the timespan between a fromDate (greater than or equal) and toDate (less than) - GET
/api/voyage/cruise/year-on-year-differenceOutput statistics on yearly cruise arrivals to destinations in Norway - GET
/api/voyage/dangerous-goods/by-voyage-segments/{fromTime}/{toTime}Return GeoJSON for all ships in real time - POST
/api/voyage/departures/for-locationsFind voyages from one or more origin locations in year(s) - POST
/api/voyage/for-ships/by-callsignReturn all voyages for ships identified by their callsign within a time period. Works on NSR data and will only return information for ships that are required to report to SafeSeaNet, this excludes smaller vessels etc. - POST
/api/voyage/for-ships/by-mmsiFind voyages for one or more ships identified by their MMSI identifiers within a specific time period - POST
/api/voyage/for-ships/by-shipidFind voyages for one or more ships identified by their NSR ship identifiers within a specific time period - GET
/api/voyage/international-detail/{fromTime}/{toTime}Return international arrivals and departures within timespan - GET
/api/voyage/international/{from_date}/{to_date}Return all international voyages in time-period. - POST
/api/voyage/passengers/by-date-locationGet number of passengers per location and date. The data is aggregated to the day level, and the first arrival to a destination each day is used. The data is based on the SafeSeaNet data, and is updated daily. - GET
/api/voyage/passengers/by-voyage-segments/{fromTime}/{toTime}Return aggregated number of passengers for each voyage segment, shiptype, flag state and month Version 1 returns all voyages from SafeSeaNet Version 2 limits to the first arrival to a destination each day
Ship · 20
- GET
/api/ship/builtbetween/{fromYear}/{toYear}Get data about ships built in the years between fromYear and toYear (both inclusive) - GET
/api/ship/combined/callsign/{callsign}Get information from combined ship table by callsign (Auth) - GET
/api/ship/combined/callsign/{version}/{callsign}Get information from combined ship table by callsign (Auth) - GET
/api/ship/combined/free-textGet information about ships from combined ship table by free-text search - POST
/api/ship/combined/free-textGet information about ships from combined ship table by free-text search. - GET
/api/ship/combined/imo/{imo}Get information from combined ship table by imo - GET
/api/ship/combined/imo/{version}/{imo}Get information from combined ship table by imo - GET
/api/ship/combined/mmsi/{mmsi}Get information from combined ship table by mmsi (Auth) - GET
/api/ship/combined/mmsi/{version}/{mmsi}Get information from combined ship table by mmsi (Auth) - POST
/api/ship/combined/{version}/free-textGet information about ships from combined ship table by free-text search. - POST
/api/ship/data/ais/for-mmsis-imosGet information about ships from AIS derived ship registry - GET
/api/ship/data/ais/free-textGet information about ships from AIS derived ship registry by free-text - POST
/api/ship/data/combined/for-mmsis-imosGet information about ships from combined ship table by mmsi or imo numbers - POST
/api/ship/data/fairplay/for-mmsis-imosGet information about ships from Fairplay (Auth) - POST
/api/ship/data/nsr/for-mmsis-imosGet information about ships from NSR Ship - POST
/api/ship/data/shipinfo/for-mmsis-imosGet information about ships from Shipinfo - POST
/api/ship/for-mmsisGet information about ships from NewShipRep by one or more MMSI identifiers - POST
/api/ship/free-textGet a key value representation of ships based on a free-text query parameter - GET
/api/ship/nsr/downloadThis *restricted* web service allows you to download the entire NewShipRep ship registry (Auth) - GET
/api/ship/shiptypesSelect all ship types that are used in NSR (Auth)
Track · 17
- POST
/api/tracks/async/download/by-voyage-timespanGenerate a downloadable ESRI Shapefile containing tracks of ships that have sailed the voyage between two locations within a specific time-period. (Auth) - POST
/api/tracks/for-ships/by-mmsiReturn ship tracks for one or more ships identified by their MMSI ship identifiers within a time period - POST
/api/tracks/for-ships/by-mmsi-midReturn ship tracks for ships identified by their MID values within a a time period - POST
/api/tracks/for-ships/by-shipidReturn ship tracks for one or more ships identified by their NSR ship identifiers within a time period (Auth) - POST
/api/tracks/frequency-countsReturn ship tracks for one or more ships identified by their ids within a time period (Auth) - POST
/api/tracks/frequency-counts/weeklyReturn weekly frequency counts for selected passlines within a time period (Auth) - GET
/api/tracks/get-passlinesReturn passlines that are available for the passline frequency dashboard (Auth) - POST
/api/tracks/get-passlinesReturn passlines that are available for the passline frequency dashboard (Auth) - POST
/api/tracks/intersects-lineReturn ship tracks that data intersecting a user specificed line (i.e. a passline) within a given time period (Auth) - POST
/api/tracks/intersects-two-linesReturn data on ships that intersecting two user specificed lines (i.e. two passline) within the same day in a given time period (Auth) - POST
/api/tracks/sailed-distance/for-ships/by-callsignReturn sailed distance in kilometers per year, month and callsign for ships identified by their callsign within a time period. This method works on AIS data and return data for all ships with AIS transponders. (Auth) - POST
/api/tracks/sailed-distance/for-ships/by-imoReturn sailed distance in kilometers per year, month and imo number for ships identified by their IMO ship identifiers within a time period (Auth) - POST
/api/tracks/sailed-distance/for-ships/by-mmsiReturn sailed distance in kilometers per year, month and MMSI number for ships identified by their MMSI ship identifiers within a time period (Auth) - POST
/api/tracks/speed/for-ships/by-callsignReturn average sailing speed in knots for one or more ships identified by callsigns within a date range. Speed is calculated and averaged across all track segments with a speed >= 2 knots. This method works on AIS data and return data for all ships with AIS transponders. (Auth) - POST
/api/tracks/within-areaReturn ship tracks that intersect a user specified polygon geometry within a time period. Clips the tracks to the polygon. Returns a maximum of 200k line segments (Auth) - POST
/api/tracks/within-area/by-mmsiReturn ship tracks that intersect a user specified polygon geometry within a time period and corresponding to mmsi. Clips the tracks to the polygon. Returns a maximum of 200k line segments (Auth) - POST
/api/tracks/within-municipalityReturn ship tracks clipped to municipality boundaries (Auth)
Ais · 15
- POST
/api/ais/positions/before-afterGet the preceding and following AIS position message for a ship on a given date - POST
/api/ais/positions/for-mmsi-dateGet all position for a ship identified by its MMSI on a given date - POST
/api/ais/positions/for-mmsis-timeHttpPost web service to retrieve AIS positions by supplying a set of MMSI ids and a time span - POST
/api/ais/positions/within-bbox-timeHttpPost web service to retrieve AIS positions by supplying a BBox and a time span - POST
/api/ais/positions/within-geom-timeHttpPost web service to retrieve AIS positions by supplying a BBox and a time span - POST
/api/ais/sailed-distance/admin/datesGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for country and time-period (whole months) - POST
/api/ais/sailed-distance/fvpomrGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for "forvaltningsplanområder" - POST
/api/ais/sailed-distance/grunnlinjeGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for "spesielt viktige områder" - POST
/api/ais/sailed-distance/municipalityGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for municipalities - POST
/api/ais/sailed-distance/municipality-fairwayGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for municipalities grouped by major and minor fairways - POST
/api/ais/sailed-distance/svoomrGet aggregated sailed distance (nmi) grouped by ship type, ship length, gt and dwt group for "spesielt viktige områder" - POST
/api/ais/statinfo/for-mmsis-timeGet AIS static information messages for specified MMSI ids within a period of time - POST
/api/ais/statinfo/ships/free-text-timeSearch for mmsis from AIS static information messages within a time span, limited to 5 days due to need to traverse multiple tables - POST
/api/ais/yearly-stats/{fromYear}/{toYear}Load annual message statistics for Kystverkets AIS database - POST
/api/ais_shipreg/statinfo/for-mmsis-time
Location · 13
- GET
/api/location/allGet all locations with SafeSeaNet voyags from NewShipRep - POST
/api/location/allGet all locations with SafeSeaNet voyags from NewShipRep - POST
/api/location/connections/for-locationsGet all locations that are connected to the specified locations through either arrivals or departures. - GET
/api/location/countiesGet all counties from NewShipRep location table - POST
/api/location/countiesGet all counties from NewShipRep location table - POST
/api/location/for-locationsGet information about locations with specified identifiers - POST
/api/location/free-textGet all locations whose names matches the free text expression entered - GET
/api/location/norway/allReturn all locations from NewShipRep including locations that do not have associated voyages in SafeSeaNet - GET
/api/location/norway/all/geojsonReturn all locations from NewShipRep including locations that do not have associated voyages in SafeSeaNet - POST
/api/location/time-in-portGet information about time in port for locations - POST
/api/location/time-in-port/allGet information about time in port for all locations - POST
/api/location/time-in-port/ospsGet information about port calls made by ships with onshore power supply facilities - POST
/api/location/time-in-port/osps-yearlyGet information about port calls made by ships with onshore power supply facilities filtered by year
ShipType · 13
- GET
/api/ship-type/statcode5/downloadRetrieve all Statcode5 code list with all attributes (Auth) - GET
/api/vocabularyRetrieve all available vocabularies - GET
/api/vocabulary/mappingRetrieve all ship type mappings between source and target vocabularies (Auth) - DELETE
/api/vocabulary/mapping/{fromVocabularyCode}/{toVocabularyCode}Delete all mappings between specified source and target vocabularies (Auth) - GET
/api/vocabulary/mapping/{fromVocabularyCode}/{toVocabularyCode}Retrieve all ship type mappings between source and target vocabularies (Auth) - POST
/api/vocabulary/mapping/{fromVocabularyCode}/{toVocabularyCode}Upload one or more ship type mappings between two existing vocabularies If the mapping already exists, it will be updated with the new information. I.e. if the source vocabulary and source id already exists, the target id will be updated to the new value. (Auth) - POST
/api/vocabulary/mapping/{fromVocabularyCode}/{toVocabularyCode}/createCreate (or re-create) the materialized view used to look up mappings between two vocabularies. (Auth) - POST
/api/vocabulary/mapping/{fromVocabularyCode}/{toVocabularyCode}/refreshRefresh the materialized view used to look up mappings between two vocabularies. (Auth) - DELETE
/api/vocabulary/terms/{vocabularyCode}Delete a term(s) from an existing vocabulary. If the term already exists, it will be updated with the new information. (Auth) - GET
/api/vocabulary/terms/{vocabularyCode}Get the terms from a vocabulary. (Auth) - POST
/api/vocabulary/terms/{vocabularyCode}Upsert one or more terms to an existing vocabulary. If the term already exists, it will be updated with the new information. (Auth) - DELETE
/api/vocabulary/terms/{vocabularyCode}/{term}Delete a term(s) from an existing vocabulary. If the term already exists, it will be updated with the new information. (Auth) - DELETE
/api/vocabulary/{vocabularyCode}Delete a vocabulary (Auth)
Vis 16 grupper til
MyData · 11
- GET
/api/mydataList the caller's entities, with optional type/subtype filter, free-text search, sorting and paging. (Auth) - POST
/api/mydataCreate or update an entity. Updates apply to title/description/data only; type and subtype are immutable once created. (Auth) - DELETE
/api/mydata/erase-allErase all of the caller's data: soft-deletes every active row and removes their uploaded files from disk. The response Msg reports the number of rows erased. (Auth) - GET
/api/mydata/export-allDownload everything the caller has stored as a zip: one JSON document per entity (grouped by type), with uploaded geodata files alongside their JSON. (Auth) - POST
/api/mydata/files/folderCreate a folder in the caller's file browser. (Auth) - POST
/api/mydata/files/uploadUpload a GeoJSON/KML file into the caller's file browser. (Auth) - GET
/api/mydata/files/{uuid}/downloadDownload an uploaded geodata file. (Auth) - PATCH
/api/mydata/files/{uuid}/moveMove a geodata file or folder into another folder, or to the root when folderId is null. (Auth) - DELETE
/api/mydata/{uuid}Soft-delete an entity. A geodata folder takes its whole content with it. (Auth) - GET
/api/mydata/{uuid}Get a single entity owned by the caller. (Auth) - PATCH
/api/mydata/{uuid}/renameRename an entity. (Auth)
Auth · 10
- POST
/api/auth/federated-loginLogin with a token issued by a federated identity provider for Kystverket-internal employees to retrieve a JWT-token for consequtive requests. - POST
/api/auth/identities/linkAssociate a new identity (e.g. a different login provider) with the calling user's own existing account. Self-service - the caller must already have an auth.users record, i.e. must have logged in at least once before. (Auth) - POST
/api/auth/loginLogin with Kystinfo.no credentials to retrieve a JWT-token for consequtive requests - GET
/api/auth/rolesList all roles. Kystverket-internal only. (Auth) - POST
/api/auth/rolesCreate a role, or update its description if it already exists. Kystverket-internal only. (Auth) - DELETE
/api/auth/roles/{roleName}Soft delete a role. Kystverket-internal only. (Auth) - GET
/api/auth/usersSearch users by email or display name. Kystverket-internal only. (Auth) - GET
/api/auth/users/{id}Get a single user along with their assigned roles. Kystverket-internal only. (Auth) - POST
/api/auth/users/{id}/rolesAssign a role (creating it if it doesn't already exist) to a user. Kystverket-internal only. (Auth) - DELETE
/api/auth/users/{id}/roles/{roleName}Revoke a role from a user. Kystverket-internal only. (Auth)
Anchorage · 7
- POST
/api/anchorage/anchorage/by-dokid-dokstatusReturn anchorage data for a single anchorage location identified by its dok_id and dok_status within a set time-period - POST
/api/anchorage/anchorage/for-sysid-timeReturn anchorage data for a single anchorage location identified by its anchorage area id That is used to resolve its dok_id and dok_status The data is then returned by forwarding the call to GetAnchorageForLocationTime2 - POST
/api/anchorage/area/geojsonReturn info about anchorage area - POST
/api/anchorage/area/geojson/by-dokid-dokstatus - GET
/api/anchorage/areasReturn all anchorage areas as a list of ids and names (labels) - POST
/api/anchorage/duration-by-year-and-idReturn summed anchorage duration for all anchorage locations by year - POST
/api/anchorage/for-location-time2Return anchorage data for a specific anchorage location and time-period
Map · 5
- GET
/api/maps/fvpomr/listGet a "forvaltningsplanområder" as a JSON code list - GET
/api/maps/kommune/geojsonGet a municipalities as GeoJson - GET
/api/maps/kommune/listGet a municipalities as a JSON code list - GET
/api/maps/kommune/wktGet a municipalities with WKT geometry as JSON records - GET
/api/maps/svoomr/listGet a "spesielt verdifulle områder" as a JSON code list
MarTraf · 4
- POST
/api/martraf-tracks/intersects-lineReturn MarTraf tracks intersecting a user specified line (i.e. a passline) within a given time period. Same response format as api/tracks/intersects-line (Auth) - POST
/api/martraf-tracks/passline-crossingsReturn the crossings of a passline within a time period, one item per crossing (Auth) - POST
/api/martraf-tracks/ships-within-areaReturn the ships that have been within an area during a time period, one item per ship (MMSI) (Auth) - POST
/api/martraf-tracks/within-geom-timeReturn MarTraf tracks within an area and/or for ships during a time period, in a compact format (Auth)
RasterFrequency · 4
- GET
/api/raster-frequency/ext/mapserverWMS end-point for traffic frequency maps. - POST
/api/raster-frequency/ext/raster/statisticsEnd point for retrieving traffic frequency statistics within user defined polygon geometries. - GET
/api/raster-frequency/ext/sldEnd point for dynamic generation of SLDs - POST
/api/raster-frequency/statistics/v2
ShipDimensions · 3
- GET
/api/ship-dimensionsSelect the best-matching record, keyed by imo (safest), then shipid, then mmsi+shipname together. At least one of these must be supplied. (Auth) - POST
/api/ship-dimensionsInsert a new record, or update the best-matching existing one, keyed by imo (safest), then shipid, then mmsi+shipname together. At least one of these must be supplied. (Auth) - DELETE
/api/ship-dimensions/{id}Delete a record by its uuid. (Auth)
AisRealTime · 2
- GET
/api/ais/realtime/geojsonReturn GeoJSON for all ships in real time - GET
/api/ais/realtime/vessels-by-typeReturn a dataset showing the number of active vessels during the last minute
Incident · 2
- POST
/api/kystinfo/norvts-incidentsGet all incident data from Nor VTS - POST
/api/kystinfo/norvts-incidents-publicGet public incident data from Nor VTS
Indicators · 2
- GET
/api/voyage/infographics/arrivals-per-dayReturns all voyages for a specified time period compared to the same period in a previous year - GET
/api/voyage/infographics/cruises-per-dayReturns all cruise voyages in the n days leading up to the reference date, compared to the same period in a previous year
MarU · 2
- GET
/api/maru/sailed-distance/county-municipality/{fromYearMonth}/{toYearMonth}Get sailed distance data for administrative division areas. The data is aggregated by month and year, gt_group and vessel_type and can be filtered by date range. - GET
/api/maru/sailed-distance/management-area/{fromYearMonth}/{toYearMonth}Get sailed distance data for marine management areas including or excluding coastal traffic. The data is aggregated by month and year, gt_group and vessel_type and can be filtered by date range.
Pilotage · 2
- POST
/api/pilotage/aggregated/for-yearsAggregated information on pilotage assignments for pilot offices and year span - POST
/api/pilotage/for-locations-yearsDetailed information on pilotage assignments for specified locatoins and year span
RealtimeTrack · 2
- POST
/api/realtime-tracks/intersects-lineReturn realtime tracks intersecting a user specified line (i.e. a passline) within a given time period. Same response format as api/tracks/intersects-line, limited to the attributes stored in ais2.track_all (no shipid and no kyv_kategori) (Auth) - POST
/api/realtime-tracks/within-geom-timeReturn realtime tracks within an area and/or for ships during a time period, in a compact format (Auth)
AisStatic · 1
- GET
/api/ais/static-messagesDownload a set of unique static data records (approximating AIS messages 5 and 24) for ships in a time period
Bunkers · 1
- POST
/api/bunkersRetrieve voyages carrying bunkers
Shorepower · 1
- GET
/api/shorepower/geojsonGet shorepowerdata as GeoJSON from Kystinfo