Welcome to the United Nations
Portal accessibility toolbar
Increase contrast
Increase font size
Decrease font size
Reset page style

API documentation

About the Indicators API

The UN Water Indicators API provides access to data accumulated for various sources. Most of these indicators are available online. The API provides programmatic access to this same data. Many data series date back over 50 years, and can be used to create interesting applications.

The Indicators API provides access to databases, including:

  • WHO
  • UNDP
  • FAO
  • And many more

How to use the Indicators API

 For example: https://sdg6data.org/api/indicator/6.1.1?_format=json

Besides making calls to the API using an application or custom program, you can also put any of the example API URL endpoints given in the documentation, or your own custom calls, into a web browser and view the results. If you choose to receive the result in JSON format you can use the JSON View Firefox plugin for easily viewing JSON results directly in Firefox.

There are also third party applications and libraries that can make using the API easier depending on your objectives. 

Please check the Basic call structure below:

The API documentation below shows how these data can be accessed for usage within your application.


Request Parameters:

{indicator_code} – This can be any SDG 6 Indicator code. Indicator code is a part of API URL and it is a mandatory to pass in API call.


Above URL will return data for all the year and all country of 6.1.1

_format : Output format. API supports 2 format. xml or json. This parameter is Mandatory as per Drupal 8 RESTful Webservice Standards.



per_page : number of results per page, for pagination of the result-set. Default setting is 50


page – utility parameter for paging through a large result-set. Indicates the page number requested from the recordset.


date – date-range by year, month or quarter that scopes the result-set. A range is indicated using the colon separator


Display all the Indicator data using indicator query with multiple countries parameters


Display all the Indicator data using indicator query


Indicator API Queries

Indicators represent data like National, Urban, Rural Areas , water availability and use, water resource management, number of deaths, number of missing and many more. Indicator queries return the following information in the response:

  • Goal
  • Target
  • Indicator
  • SeriesCode
  • SeriesDescription
  • GeoAreaType
  • GeoAreaName
  • GeoAreaCode
  • TimePeriod
  • Value
  • Time_Detail
  • Source
  • FootNote
  • Nature
  • Units
  • Age
  • Bounds
  • Frequency
  • Level_Status
  • Location
  • Reporting_Type
  • Sex

Sample Request Format: Indicator Query

To request all indicators: https://sdg6data.org/api/indicator/all?_format=json

To request the indicator 6.1.1, use its indicator code,


Sample Response Format: Indicator Query

<item key="0">
<item key="1">
<item key="0">
<SeriesDescription>Drinking water, At least basic service</SeriesDescription>
<Source>WHO, UNICEF</Source>
<SDG_6_Data_Portal_level><![CDATA]6.1.1 Proportion of population using safely managed drinking water service (%) > At least basic service > National
  "SeriesDescription":"Drinking water, At least basic service",
  "Source":"WHO, UNICEF",
  "SDG_6_Data_Portal_level":"6.1.1 Proportion of population using safely managed drinking water service (%) \u003E At least basic service \u003E National"

Sample Response Format: Indicator Query with country filter :

"SeriesDescription":"Drinking water, At least basic service", 
"SDG_6_Data_Portal_level":"6.1.1 Proportion of population using safely managed drinking water service (%) \u003E At least basic service \u003E National"}]

You can download country list with ISO3 codes here

API Access / Authentication

API keys and other authentication methods are no longer necessary to access the API.