Skip to content

P code service

David Megginson edited this page Feb 13, 2020 · 1 revision

The HXL Proxy's P-code service at /api/pcodes/ returns a list CSV dataset of UN humanitarian placenames and place codes (P-codes) for an administrative level in a country. The data comes from the iTOS service at the University of Georgia.

The CSV datasets (in UTF-8 encoding) are available as pseudo files with the following structure (all lower case):

{Country ISO3 code}-{admin level}.csv

The administrative level names are "adm1", "adm2", etc. If iTOS does not currently support the country or the admin level, the API call will return a JSON-encoded error message instead of CSV results.

Example

Find the administrative-level-one codes for Guinea (ISO3 "GIN"):

https://proxy.hxlstandard.org/api/pcodes/gin-adm1.csv

Results (CSV with UTF-8 character encoding and HXL hashtags):

admin1Name_fr admin1Pcode admin1RefName admin0Name_fr admin0Pcode
#adm1+i_fr+name #adm1+code #adm1+name+ref #country+i_fr+name #country+code+iso2
Boke GN001 Boke Guinea GN
Conakry GN002 Conakry Guinea GN
Faranah GN003 Faranah Guinea GN
Kankan GN004 Kankan Guinea GN
Kindia GN005 Kindia Guinea GN
Labe GN006 Labe Guinea GN
Mamou GN007 Mamou Guinea GN
Nzerekore GN008 Nzerekore Guinea GN
Clone this wiki locally