This is a topic in Forum

Support Thread

7 posts

 
Geoff Drake 2 posts

This thread is where support questions get answered.

 
webving 8 posts

Hello, and thanks for this genuinely useful API!

I came across two small problems

1) There is a small mistake in the documentation here:
http://www.undata-api.org/wiki/filteredquery

the query only accepts
http://undata-api.appspot.com/data/query/{dataset name1}/{country3}/{year2}
and not
http://undata-api.appspot.com/data/query/{dataset name1}/{year2}/{country3}

2) Also, for some reason every record appears twice on this kind of query:

http://undata-api.appspot.com/data/query/Population%20annual%20growth%20rate%20%28percent%29/any/2000?user_key=xxx

or

http://undata-api.appspot.com/data/query/Population%20annual%20growth%20rate%20%28percent%29/France?user_key=xxx

The responses look like this — each year shows up twice; could the data be half-yearly?

<record>
<field name="Country or Area">France</field>
<field name="Year(s)">1990</field>
<field name="Value">0.5</field>
</record>
−
<record>
<field name="Country or Area">France</field>
<field name="Year(s)">1990</field>
<field name="Value">0.5</field>
</record>
−
<record>
<field name="Country or Area">France</field>
<field name="Year(s)">1991</field>
<field name="Value">0.5</field>
</record>
−
<record>
<field name="Country or Area">France</field>
<field name="Year(s)">1991</field>
<field name="Value">0.5</field>
</record>

Thanks

 
webving 8 posts

Oops, the forum formatting engine mangled my text a little :)
I hope it is still understandable…

 
webving 8 posts

Issue: the country name "Côte d’Ivoire" is not UTF8-encoded in the query "Population annual growth rate (percent)/" (and possibly in other queries too, if they all share the same country table).

 
webving 8 posts

Issue: malformed XML returned by this query:
http://undata-api.appspot.com/data/query/Population%20living%20below%20the%20poverty%20line%20%28percent%20living%20on%20less%20than%20US$1%20per%20day%29/any?user_key=xxx

the text "<2.0" appears where it should read "2.0"

this happens for the first country, "Albania", in the poverty-line query

 
webving 8 posts

Oops — actually it affects every country whose value is "2.0", because that value means "less than 2%"

which raises a question: what could be used in place of this special character?

 
ravi 1 post

The <2.0 problem webving raised is significant. It breaks XML parsers because a < is being emitted unescaped. Malformed XML cannot be parsed by the endpoints unless it is cleaned up first.