v2.wttr.in: Your Weather Forecast right in your Terminal.
v2.wttr.in is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for
console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers. It will allow us to quickly and easily consult the weather from the command line. You may get a 3-day prediction, as well as information about wind, temperature, precipitation amount, and much more.
Plus, you don't have to install it - all you need is the cURL
or wget
command.
cURL
Before using v2.wttr.in, make sure cURL
is installed.
$ sudo apt install curl
Wget
$ wget -O- -q wttr.in
You can replace curl
with wget -O- -q
in all the commands below if you prefer Wget
over cURL
.
v2.wttr.in Command line Examples
a. Get the weather for your location (v2.wttr.in tries to guess your location based on your IP address):
$ curl v2.wttr.in
For most people, this will probably be good enough, if not you will have to specify the specific location where you want the weather forecast; as such:
##
#
$ curl v2.wttr.in/sydney+australia
##
#
$ curl v2.wttr.in/New+York
$ curl v2.wttr.in/Tokyo
$ curl v2.wttr.in/Salt+Lake+City
##
Since cities across the world are not unique we want to be specific by adding +australia
otherwise, it may get the closer Sydney forecast based on your geographical location and not from Sydney, Australia.
b. Use 3-letter airport codes to get the weather information at a certain airport:
##
#
$ curl v2.wttr.in/dca # Weather for IATA: dac, Reagan Washington
Nation Airport, U.S.
$ curl v2.wttr.in/syd # Weather for IATA: ham, Sydney Airport
Sydney, AU.
#
##
c. Use area codes to get weather information:
$ curl v2.wttr.in/30080
d. Display weather information for a landmark or monument other than a town or city. We add the character ~
before the name to look up that special location name before the weather is then retrieved:
##
#
$ curl v2.wttr.in/~Statue+of+Liberty
$ curl v2.wttr.in/~Fuji
$ curl v2.wttr.in/~Mount+Rushmore
#
##
Below are outputs that show the geolocation results of looking up the location:
##
#
Location: Statue of Liberty, Flagpole Plaza [40.6893,-74.0445]
Location: 富士山 Mont Fuji, 富士宮市, 静岡県, 日本 [35.3648,138.7290]
Location: Mount Rushmore, Pennington County, South Dakota [43.8787,-103.4592]
#
##
e. Get the weather information for an IP address (prefixed with @
for domain names) :
$ curl v2.wttr.in/52.84.109.62
or
$ curl v2.wttr.in/@snubmonkey.com
We hope this will give you a good deal of information on how to check the weather right in your Terminal.