What you are looking for is an oracle.
Ethereum and other blockchains are unable to access data outside of their network(The way to think about it is imagine if the entire Ethereum network tried to access the weather api you mentioned at the same time...) which is where Oracles come in.
Oracles are third party services designed for use with smart contracts that provide and push external data to the chain including weather for example. There are many different ways to set this up and different services you can use for your own oracle I included a link to Gnosis' white paper so you can see how they handle Oracles. https://gnosis.pm/ And I included a link to further general explanation on Oracles https://blockchainhub.net/blockchain-oracles/