1

Is there any other alternative to get WOEID of a place, other than yahoo services? Is there any third party library which is free?

user1899840
  • 543
  • 2
  • 7
  • 19

1 Answers1

1

You can get it by making a query request using the city name you want and hitting yahoo service with code like this:

NSString *request = [NSString stringWithFormat:@"http://query.yahooapis.com/v1/public/yql?q=select * from geo.places where text=\"%@\"&format=xml", cityName];
NSString *encRequest = [request stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *URL = [NSURL URLWithString:encRequest];

I've put the complete example for this in github, but this is a solution just for testing purposes. You should use the official way (and pay if needed) for a commercial app.

Nikos M.
  • 13,685
  • 4
  • 47
  • 61
  • Thanks a lot for the above answer. So using yahoo services is the only way to go. Is there any other service, other than yahoo? – user1899840 Dec 13 '13 at 12:37
  • No there isn't. Actually WOEID is an id created by Yahoo itself http://en.wikipedia.org/wiki/WOEID – Nikos M. Dec 13 '13 at 12:38
  • That's actually not *completely* true. The database is published under a Creative Commons license and exists on archive.org: http://archive.org/search.php?query=geoplanet It would not be impossible to build something out of that. – Dominik Jan 13 '17 at 08:00