Retrieving country name from city areas using API

I think the only way to do this is to

  1. filter the results you get from your inc=area-rels query, find the one (or more) that’s “part of” with <direction>backward</direction>
  2. query that area and check its area-type
    • if the type is “country”, you’re done
    • if the type is not a “country”, then repeat recursively until you find the country.
1 Like