This repository was archived by the owner on Nov 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Sweden: Raw Viva data #1
Copy link
Copy link
Open
Description
For example, for ViVa Station 45 (http://vivadisplay.sjofartsverket.se/#/station/45), I found via reverse engineering using Chrome Inspection that one can get the current live wind readings as:
$ curl 'https://services.viva.sjofartsverket.se:8080/output/vivaoutputservice.svc/vivastation/45?isMVY=false' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Origin: http://vivadisplay.sjofartsverket.se' -H 'Connection: keep-alive' -H 'Referer: http://vivadisplay.sjofartsverket.se/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'TE: trailers'
{"GetSingleStationResult":{"ID":45,"Name":"Helsingborg","Samples":[{"Name":"Vattenstånd","Value":"23","Heading":0,"Unit":"cm","Type":"level","Trend":"","Msg":"","Calm":0,"Updated":"2023-03-13 14:29:00","StationID":45,"Quality":"Ok","WaterLevelReference":"RH2000","WaterLevelOffset":9.4},{"Name":"Byvind","Value":"SV 15.3","Heading":236,"Unit":"m\/s","Type":"wind","Trend":"","Msg":"","Calm":0,"Updated":"2023-03-13 14:29:20","StationID":45,"Quality":"Ok","WaterLevelReference":null,"WaterLevelOffset":null},{"Name":"Medelvind","Value":"SV 10.6","Heading":236,"Unit":"m\/s","Type":"wind","Trend":"","Msg":"","Calm":0,"Updated":"2023-03-13 14:29:20","StationID":45,"Quality":"Ok","WaterLevelReference":null,"WaterLevelOffset":null},{"Name":"Vattentemp","Value":"3.5","Heading":0,"Unit":"°C","Type":"watertemp","Trend":"","Msg":"","Calm":0,"Updated":"2023-03-13 14:20:00","StationID":45,"Quality":"Ok","WaterLevelReference":null,"WaterLevelOffset":null}],"Felmeddelande":null}}Same parsed via jq:
$ curl --silent 'https://services.viva.sjofartsverket.se:8080/output/vivaoutputservice.svc/vivastation/45?isMVY=false' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate, br' -H 'Origin: http://vivadisplay.sjofartsverket.se' -H 'Connection: keep-alive' -H 'Referer: http://vivadisplay.sjofartsverket.se/' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'TE: trailers' | jq
{
"GetSingleStationResult": {
"ID": 45,
"Name": "Helsingborg",
"Samples": [
{
"Name": "Vattenstånd",
"Value": "23",
"Heading": 0,
"Unit": "cm",
"Type": "level",
"Trend": "",
"Msg": "",
"Calm": 0,
"Updated": "2023-03-13 14:33:00",
"StationID": 45,
"Quality": "Ok",
"WaterLevelReference": "RH2000",
"WaterLevelOffset": 9.4
},
{
"Name": "Byvind",
"Value": "SV 15.3",
"Heading": 233,
"Unit": "m/s",
"Type": "wind",
"Trend": "",
"Msg": "",
"Calm": 0,
"Updated": "2023-03-13 14:33:39",
"StationID": 45,
"Quality": "Ok",
"WaterLevelReference": null,
"WaterLevelOffset": null
},
{
"Name": "Medelvind",
"Value": "SV 10.8",
"Heading": 233,
"Unit": "m/s",
"Type": "wind",
"Trend": "",
"Msg": "",
"Calm": 0,
"Updated": "2023-03-13 14:33:39",
"StationID": 45,
"Quality": "Ok",
"WaterLevelReference": null,
"WaterLevelOffset": null
},
{
"Name": "Vattentemp",
"Value": "3.5",
"Heading": 0,
"Unit": "°C",
"Type": "watertemp",
"Trend": "",
"Msg": "",
"Calm": 0,
"Updated": "2023-03-13 14:30:00",
"StationID": 45,
"Quality": "Ok",
"WaterLevelReference": null,
"WaterLevelOffset": null
}
],
"Felmeddelande": null
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels