square instead a city

  • 1
  • Problem
  • Updated 8 months ago
we are looking for citys named "Bilbao" with this request
http://api.wunderground.com/api/xxxx/conditions/q/bilbao.json

and this is the response
{ "response": { "version": "0.1", "termsofService": "http://www.wunderground.com/weather/api/d/terms.html", "features": { "conditions": 1 }, "results": [ { "name": "Bilbao", "city": "Bilbao", "state": "ALB", "country": "PH", "country_iso3166": "PH", "country_name": "Philippines", "zmw": "00000.450.98444", "l": "/q/zmw:00000.450.98444" }, { "name": "Bilbao", "city": "Bilbao", "state": "BI", "country": "SP", "country_iso3166": "ES", "country_name": "Spain", "zmw": "00000.496.08025", "l": "/q/zmw:00000.496.08025" }, { "name": "Bilbao", "city": "Bilbao", "state": "CL", "country": "MX", "country_iso3166": "MX", "country_name": "Mexico", "zmw": "00000.30.76382", "l": "/q/zmw:00000.30.76382" }, { "name": "Bilbao", "city": "Bilbao", "state": "M", "country": "SP", "country_iso3166": "ES", "country_name": "Spain", "zmw": "00000.8.08223", "l": "/q/zmw:00000.8.08223" }, { "name": "Bilbao", "city": "Bilbao", "state": "TOL", "country": "CO", "country_iso3166": "CO", "country_name": "Colombia", "zmw": "00000.469.80315", "l": "/q/zmw:00000.469.80315" } ] } }

where there is a No CITY result, this one
{ "name": "Bilbao", "city": "Bilbao", "state": "M", "country": "SP", "country_iso3166": "ES", "country_name": "Spain", "zmw": "00000.8.08223", "l": "/q/zmw:00000.8.08223" },

this is a square, not a city, is this normal or is this an error?
Photo of Asier Santamaria

Asier Santamaria

  • 4 Posts
  • 0 Reply Likes

Posted 8 months ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 961 Posts
  • 122 Reply Likes
We have some locations that are more "point of interest" than city names, and this looks like one. Use the "l" value to form the right URL to get to the Bilbao you're looking for.
Photo of Asier Santamaria

Asier Santamaria

  • 4 Posts
  • 0 Reply Likes
in this point, i don't know what "bilbao" city is the person looking for, i have to take all de citys and let de person choose the right one with the extra information of the country

is not possible to make a request asking only for cities?

also, there is a bug in your systems, if i ask for the the square one, with the "L" value, your request is 

"response": {
        "version": "0.1",
        "termsofService": "http://www.wunderground.com/weather/api/d/terms.html";,
        "features": {
            "conditions": 1
        }
    },
    "current_observation": {
        "image": {
            "url": "http://icons.wxug.com/graphics/wu2/logo_130x80.png";,
            "title": "Weather Underground",
            "link": "http://www.wunderground.com";
        },
        "display_location": {
            "full": "Bilbao, Spain",
            "city": "Bilbao",
            "state": "M",
            "state_name": "Spain",
            "country": "SP",
            "country_iso3166": "ES",
            "zip": "00000",
            "magic": "8",
            "wmo": "08223",
            "latitude": "40.43000031",
            "longitude": "-3.70000005",
            "elevation": "684.0"
        },
        "observation_location": {
            "full": "Chamberi, Madrid, COMUNIDAD DE MADRID",
            "city": "Chamberi, Madrid",
            "state": "COMUNIDAD DE MADRID",
            "country": "ES",
            "country_iso3166": "ES",
            "latitude": "40.432049",
            "longitude": "-3.697454",
            "elevation": "2290 ft"
        },
..........................................

And this is not ok

            "full": "Bilbao, Spain",
            "city": "Bilbao",
            "state": "M",

Because the city is not Bilbao at this point, is Madrid, and i think that this is the cause of your error, is it possible to fix this error in your database?