Get data from geoapi into google spreadsheets

381 views Asked by At

I'm trying to get country name given the city, here's my formula for Warszawa: =importxml("http://api.geonames.org/search?q=warszawa&maxRows=1&style=FULL&username=glebvk";"/geonames/geoname[1]/Countrycode")

I get "Error: Imported content is empty."

1

There are 1 answers

0
John On

Change your XPath query from /geonames/geoname[1]/Countrycode to /geonames/geoname[1]/countryCode. XPath queries are case-sensitive.