Skip to content

Instantly share code, notes, and snippets.

@mberkowski
Last active November 14, 2020 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mberkowski/42a2c4c53465bd4a47b869317acdc7e8 to your computer and use it in GitHub Desktop.
Save mberkowski/42a2c4c53465bd4a47b869317acdc7e8 to your computer and use it in GitHub Desktop.
# Snowfall, snow depth only starting Oct 1, 2020, MSP airport ("sid": "mspthr")
curl 'https://data.rcc-acis.org/StnData' \
-H 'Accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
--data-raw 'params={"sid":"mspthr","sdate":"2020-10-01","edate":"por","elems":[{"name":"snow","interval":"dly","duration":"dly","add":"t"},{"name":"snwd","interval":"dly","duration":"dly","add":"t"}]}'
# "sid": "mspthr" -- MSP airport, change to your airport code
# "sdate": start date
# "edate": ending date, "por" seems to mean up to present day
# Additional elems:
# - mint = min daily temperature
# - maxt = max daily temperature
# - pcpn = precipitation
# - snow = snowfall
# - snwd = snow depth
# Public API docs https://www.rcc-acis.org/docs_webservices.html
Sample output 2020-11-10 - 2020-11-13 at MSP
{
"meta": {
"state": "MN",
"sids": [
"MSPthr 9"
],
"uid": 32809,
"name": "Minneapolis-St Paul Area"
},
"data": [
[
"2020-11-10",
[
"5.5",
24
],
[
"0",
6
]
],
[
"2020-11-11",
[
"T",
24
],
[
"6",
6
]
],
[
"2020-11-12",
[
"2.8",
24
],
[
"4",
6
]
],
[
"2020-11-13",
[
"0.0",
24
],
[
"6",
6
]
]
]
}
# Simpler version, just elems as strings without embedded options
params={"sid":"mspthr","sdate":"2020-11-10","edate":"2020-11-13","elems":["mint","maxt","snow","snwd"]}'
# Output {
"meta": {
"state": "MN",
"sids": [
"MSPthr 9"
],
"uid": 32809,
"name": "Minneapolis-St Paul Area"
},
"data": [
[
"2020-11-10",
"27",
"32",
"5.5",
"0"
],
[
"2020-11-11",
"21",
"37",
"T",
"6"
],
[
"2020-11-12",
"22",
"31",
"2.8",
"4"
],
[
"2020-11-13",
"13",
"35",
"0.0",
"6"
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment