Question

I have a web app that uses Yahoo Geocoding Placefinder API and it was working perfectly until earlier today. It just randomly quit working. Are they not supporting it anymore? I have looked all over the net and I can't find anything about them dropping support, but my code no longer works. Here's my code...

function geocode_yahoo($address,$city,$state,$country) {
    $address = array($address, $city, $state, $country);
    $address = array_filter($address);
    $address = urlencode(implode(', ', $address));

    $appid = 'CYxSRa64';

    $url = 'http://where.yahooapis.com/geocode?location='.$address.'&flags=J&appid='.$appid;
    $data = file_get_contents($url);
    if ($data != '') {
        $data = json_decode($data);
        if ($data && $data->ResultSet && $data->ResultSet->Error == '0' && $data->ResultSet->Found) {
            return (object) array('lat'=>$data->ResultSet->Results[0]->latitude, 'lng'=>$data->ResultSet->Results[0]->longitude); 
        }
    }
    return false;
}
Was it helpful?

Solution

Nothing wrong with your code, the service has simply been stopped.

Note that http://where.yahooapis.com is now returning a 404 page.

The service was set to retire at the end of November 2012 but was left running in order to provide time for developers to migrate to the replacement Yahoo BOSS services: http://developer.yahoo.com/boss/geo/

OTHER TIPS

There is nothing here that states that the service will be stopped: https://developer.yahoo.com/boss/geo/docs/free_YQL.html#table_pf

In fact, there is a link on the bottom of this page: https://developer.yahoo.com/boss/geo/ to the free YQL version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top