Journal Entries
Mar 16, 2009
What’s the weather going to be like?
It was the answer to that simple question that caused my latest problem.
I have a client who is interested in displaying the current weather conditions on their site. They wanted it to be simple. Something like: “Weather: 34°F Sunny | Tomorrow 42°F Rain.” Seems like no big deal, right?
I know of 2 public APIs that give weather information. The first is from the weather channel. I can sign up for a developer key, customize your call to the API and display a range of information from the current conditions to the five day forecast. But there are conditions attached with it’s use. First off, they require to know my birthday. It’s not a deal breaker, but it’s odd enough to put me on my guard. Secondly, I can’t mix their forecast with any other third party forecast. Again, not a deal breaker but I can start to feel the legal pinch. Finally, I must display 5 additional links and the unaltered weather channel logo. That’s the deal breaker. The design I’m working in didn’t make any room for another logo or for some weather related advertising. I get that this is a barter transaction. They get exposure and I get the weather. But that won’t work for me. Next.
So I moved onto Yahoo’s weather API. I’ve used the travel API before. So I was more happy to go with what I already knew. Yahoo doesn’t require any links to be displayed. They do require that the forecast is in some way attributed to Yahoo. But they leave it up to me whether I want to use text or the supplied Yahoo logo. And the logo was small which wouldn’t compromise the site’s design noticeably. But just as I getting excited, I found the deal breaker. The weather API is free for individuals and non-profits. (Scroll down. It’s right there at the bottom.) My client is neither. And I know they have no budget for a service fee to Yahoo. (…if they even offer that) Strike two.
What am I left with? Well, not much. Most of what’s left are pre-formatted HTML snippets that are alternatively ugly or shameless self promotion; usually both. Because this is a client building a site that they hope to make money with and because ethically it’s wrong, I can’t just scrape the forecast from someone else’s source. They contracted with me to improve their site, not set them up for a lawsuit.
Enter NOAA. They offer current conditions and a five-day forecast via RSS and XML feeds. And best of all, it’s open to everyone. There are no restrictions on it’s usage. The downside is that all there observations come from weather stations located mostly at airport. So instead of a zip code search, I need to know the closest airport. Luckily that’s not a problem. My client’s site is located within 15 minutes of at least 3 of these observation points.
I’ve found my provider! Unfortunately, I have to now manually build a script that parses out the information I want instead of cleanly hitting an API. Fair enough, I figure. A couple of extra hours of work is better then a lawsuit or a broken design any day.

