Our HDR data resides on data.undp.org, and is accessed via the Socrata Open Data API (SODA). All communication with the API is done through HTTPS, and errors are communicated through HTTP response codes. Available response types include JSON, XML, and CSV, which are selectable by the "extension" on API requests or by HTTP Accepts headers.
With SODA , the endpoint for every dataset and custom API is by default hosted under /resources. Datasets are addressable by that dataset’s unique identifier, which you can locate either in the “API” sidebar on the dataset or as the 4x4 code at the end of any dataset URL.
|HDR Table Name||API Endpoint|
|Table 1: Human Development Index and its Components||http://data.undp.org/resource/myer-egms.json|
|Table 2: Human Development Index Trends||http://data.undp.org/resource/y8j2-3vi9.json|
|Table 3: Inequality-Adjusted Human Development Index||http://data.undp.org/resource/n8fa-gx39.json|
|Table 4: Gender Inequality Index||http://data.undp.org/resource/ku9i-8fxp.json|
|Table 5: Gender-related Development Index||http://data.undp.org/resource/me25-gsuv.json|
|Table 6: Multidimensional Poverty Index||http://data.undp.org/resource/frx9-rb5i.json|
These sample queries will use HDR Table 1: HDI Human Development Index and its Components. You can view and explore the dataset in your browser at https://data.undp.org/Government/Table-1-Human-Development-Index-and-its.... The last part of this URL is the dataset's unique identifier, which you'll need to build API Queries.
You'll also need API field names for columns you'd like to query. API field names can be found by hovering over the column header in the dataset's graphical view. For example, the API field name for the "2014 HDI Rank" column is "hdi_rank".
The API endpoint for this dataset returns JSON for all columns and rows.
More specific queries can be built by adding arguments to the endpoint URL. Create simple equality queries using an API field name and a value:
Add a $where argument to return rows with ranges of values:
Add a $select argument to return only certain columns:
Add an $order argument to sort the results:
Socrata provides SDKs for several programming environments to facilitate consumption of SODA APIs. More information can be found at http://dev.socrata.com.