I am using yahoo weather api to get weather information
This is returning an xml output.
I want to get it in JSON format. How can i get this as JSON?
I am using yahoo weather api to get weather information
This is returning an xml output.
I want to get it in JSON format. How can i get this as JSON?
I would suggest using YQL and requesting JSON output. The link you referenced is Yahoo's weather RSS feed.
select * from weather.forecast where woeid in (SELECT woeid FROM geo.placefinder WHERE text="34.0485508,-84.22675029999999" and gflags="R")
–
Tatro http://weather.yahooapis.com/forecastjson?w=2502265
Just replace forecastrss
by forecastjson
in the URL.
I see one drawback: No weather-code
is returned for the forecast.
Update 2014-06: This used to work, but seems to be gone since 2012-10 (see also https://developer.yahoo.com/forum/YQL/-/1349591762366-e0f8ad94-f599-49fe-bddb-fe3cd0180dea)
forecastrss
. Strange. –
Adamson As per the documentation at http://weather.yahooapis.com/forecastrss, the rss response is xml.
The Weather RSS feed is an XML document that conforms to the RSS 2.0 specification. RSS is an XML document containing a single channel element representing the feed, several elements containing metadata about the feed itself, and one or more item elements describing individual items within the feed.
And so, you won't get the response as JSON
if you are looking for a JSON weather API I have a suggestion for you!
I made a Weather API available on mashape, and they have a ready to use simple PHP SDK.
This api is really simple to use because we use the cool standards that are available nowadays, like JSON and REST, while our competitors still use legacy SOAP/XML systems.
Speaking about the quality of data Metwit (my "company") born as a crowdsourced platform for gathering real-time weather reports from real people. After more then ten thousand users started to using our apps and send a massive amount of reports, we decided to release those precious reports through our APIs.
We also act as single gateway for multiple, hard to parse, sources of forecasts like NOAA, and we're enhancing them with social data like photos, tweets, etc., that we leverage from existing social networks.
If you like it please give it a try on mashape!
After a few search i found the yahoo weather api is best for me as what i really needed. To get the weather data from latitude and longitude
In XML (default)
http://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text="({28.3949},{84.1240})")
In JSON format
http://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid in (SELECT woeid FROM geo.places WHERE text="({28.3949},{84.1240})")&format=json
Put your own place latitude and longitude to find your location weather, hopefully this will help.
© 2022 - 2024 — McMap. All rights reserved.