查询 Geonames API 以仅获取城市国家名称

Querying Geonames API to get only city country name

太多无用的 json 数据被获取,当我通过点击这个 URL:

来请求特定国家/地区的城市时
http://api.geonames.org/searchJSON?username=ksuhiyp&country=us&maxRows=1000

这个 returns 太多 json 字段如您所见,问题很热门,只获取城市、国家名称的查询 ?

您可以尝试使用附加参数 style=SHORT

http://api.geonames.org/searchJSON?username=ksuhiyp&country=us&maxRows=1000&style=SHORT

docs 表示:样式、字符串 SHORT、MEDIUM、LONG、FULL(可选)、返回的 xml 文档的详细程度,默认 = MEDIUM