1

Correct WOE but Weather says "City not found"

I'm having some problems retrieving weather info for Singapore.

1. First I retrieved "Singapore"'s WOE id -- which is 23424948

$ curl 'http://where.yahooapis.com/v1/places.q(Singapore)?appid={SECRET}'
<?xml version="1.0" encoding="UTF-8"?>
<places xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="1" yahoo:total="2"><place yahoo:uri="http://where.yahooapis.com/v1/place/23424948" xml:lang="en-US"><woeid>23424948</woeid><placeTypeName code="12">Country</placeTypeName><name>Singapore</name><country type="Country" code="SG">Singapore</country><admin1></admin1><admin2></admin2><admin3></admin3><locality1></locality1><locality2></locality2><postal></postal><centroid><latitude>1.365580</latitude><longitude>103.827713</longitude></centroid><boundingBox><southWest><latitude>1.115800</latitude><longitude>103.618248</longitude></southWest><northEast><latitude>1.470620</latitude><longitude>104.408470</longitude></northEast></boundingBox></place></places>

2. Then I requested for weather information using 23424948 -- which Yahoo replies with "City not found"

$ curl 'http://weather.yahooapis.com/forecastrss?w=23424948'
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<title>Yahoo! Weather - Error</title>
<description>Yahoo! Weather Error</description>
<item><title>City not found</title><description>
Invalid Input /forecastrss?w=23424948
</description></item></channel></rss><!-- api8.weather.sp1.yahoo.com uncompressed/chunked Thu Feb 18 18:13:08 PST 2010 -->

3. I tried with New York's WOE ID -- 2459115, which basically works.

$ curl 'http://where.yahooapis.com/v1/places.q(New%20York%20City)?appid={SECRET}'
<?xml version="1.0" encoding="UTF-8"?>
<places xmlns="http://where.yahooapis.com/v1/schema.rng" xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:start="0" yahoo:count="1" yahoo:total="1"><place yahoo:uri="http://where.yahooapis.com/v1/place/2459115" xml:lang="en-US"><woeid>2459115</woeid><placeTypeName code="7">Town</placeTypeName><name>New York</name><country type="Country" code="US">United States</country><admin1 type="State" code="US-NY">New York</admin1><admin2></admin2><admin3></admin3><locality1 type="Town">New York</locality1><locality2></locality2><postal></postal><centroid><latitude>40.714550</latitude><longitude>-74.007118</longitude></centroid><boundingBox><southWest><latitude>40.495682</latitude><longitude>-74.255653</longitude></southWest><northEast><latitude>40.917622</latitude><longitude>-73.689484</longitude></northEast></boundingBox></place></places>

$ curl 'http://weather.yahooapis.com/forecastrss?w=2459115'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>

<title>Yahoo! Weather - New York, NY</title>
<link>http://us.rd.yahoo.com/dailynews/rss/weather/New_York__NY/*http://weather.yahoo.com/forecast/USNY0996_f.html</link>
<description>Yahoo! Weather for New York, NY</description>
<language>en-us</language>
<lastBuildDate>Thu, 18 Feb 2010 8:51 pm EST</lastBuildDate>
<ttl>60</ttl>
<yweather:location city="New York" region="NY" country="United States"/>
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
<yweather:wind chill="28" direction="280" speed="10" />
<yweather:atmosphere humidity="52" visibility="10" pressure="29.69" rising="1" />
<yweather:astronomy sunrise="6:46 am" sunset="5:34 pm"/>
...
</item>
</channel>
</rss><!-- api7.weather.sp1.yahoo.com uncompressed/chunked Thu Feb 18 18:15:07 PST 2010 -->

I'm not sure what's wrong with the Singapore data?

by
9 Replies
  • woeid: 23424948 corresponds to country Singapore, check the where.yahooapis response: <placeTypeName code="12">Country</placeTypeName>.

    For Singapore city, you should use the woeid:1062617.

    You better make your request to where.yahooapis like this:
    http:// where.yahooapis.com/v1/places.q("Singapore");start=0;count=5?appid=...
    so that the response will contain the 5 top relative woeids.
    0
  • I'm having exactly the same problem with all Bulgarian cities. They worked some time ago, and since few days I get "City not found" too ... definately yahoo error or they changed something big.
    0
  • QUOTE
    wasp@m400:~$ curl http://weather.yahooapis.com/forecastrss?w=838804
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <rss version="2.0" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
    <channel>
    <title>Yahoo! Weather - Error</title>
    <description>Yahoo! Weather Error</description>
    <item><title>City not found</title><description>
    Invalid Input /forecastrss?w=838804
    </description></item></channel></rss><!-- api4.weather.ac4.yahoo.com uncompressed/chunked Sat Feb 20 02:49:57 PST 2010 -->
    wasp@m400:~$


    This worked about a week ago ...
    0
  • QUOTE (vasilis @ Feb 19 2010, 06:50 AM) <{POST_SNAPBACK}>
    woeid: 23424948 corresponds to country Singapore, check the where.yahooapis response: <placeTypeName code="12">Country</placeTypeName>.

    For Singapore city, you should use the woeid:1062617.

    You better make your request to where.yahooapis like this:
    http:// where.yahooapis.com/v1/places.q("Singapore");start=0;count=5?appid=...
    so that the response will contain the 5 top relative woeids.


    Thanks. I'm using this woeid now. But it still does not explain (like other commenter in this thread) why what was working suddenly broke. It happened for other cities as well, Singapore was just 1 example.
    0
  • QUOTE (krasimirkazakov @ Feb 20 2010, 02:50 AM) <{POST_SNAPBACK}>
    This worked about a week ago ...


    Thanks, I informed the Weather team about this.
    0
  • The Bulgarian cities have now been fixed.
    0
  • It seems Czech Republic cities have the same problem:
    http://xml.weather.yahoo.com/forecastrss?p=EZXX0779&u=c but http://weather.yahooapis.com/forecastrss?w=790133&u=c (the corresponding woeid) is working fine, although the links go to an error page on Yahoo.com. Could we still use the p parameter instead of the woeid?
    0

  • When I type url http://weather.yahooapis.com/forecastrss?w=790133&u=c .
    It is working Fine but the links  available for full forecast are suddenly appeared broke.
     Whats going on Yahoo Weather team??????
    0
  • This is happening to our websites also. Our clients are asking for a new address to put in, but Yahoo! seems to be linking to Weather.com now...?

    QUOTE(sonika @ 17 May 2012 5:09 AM)

    When I type url http://weather.yahooapis.com/forecastrss?w=790133&u=c .
    It is working Fine but the links  available for full forecast are suddenly appeared broke.
     Whats going on Yahoo Weather team??????
    0
This forum is locked.

Recent Posts

in YDN Documentation