API

Application programming interface (API)

The SDG API (Application Programming Interface) allows to browse and download for further processing the full range of data and metadata for global and national indicators monitoring the Sustainable Development Goals (SDGs) of the 2030 Agenda in Poland.
The data is made available through REST API in JSON format. The list below presents available web services provided as part of the API.

Response status codes

Status code Definition Message
200 OK The request was successful and the response body contains the representation requested
302 FOUND A common redirect response; you can GET the representation at the URI in the Location response header
304 NOT MODIFIED There is no new data to return
400 BAD REQUEST The request was invalid or cannot be otherwise served
401 UNAUTHORIZED The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource
403 FORBIDDEN The request has been refused
404 NOT FOUND The URI requested is invalid or the resource requested does not exists
406 NOT ACCEPTABLE The request specified an invalid format
410 GONE This resource is gone
500 INTERNAL SERVER ERROR Something is horribly wrong
502 BAD GATEWAY The service is down or being upgraded
503 SERVICE UNAVAILABLE The service is up, but overloaded with requests
504 GATEWAY TIMEOUT Servers are up, but the request couldn’t be serviced due to some failure within our stack

Limits and API key

For API security reasons, quantitative limits are imposed on the number of requests. For unauthenticated requests, the rate limit allows for up to 60 requests per hour. For API requests using OAuth, you can make up to 5000 requests per hour. To use OAuth, you need to create account on Github and generate personal access token in developer settings. Then set the Authorization header with token in your request. For example:

curl -H "Accept:application/vnd.github.v3.raw" -H "Authorization: token generated_token" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/1/1-1-1.json"

For more information, please visit:
help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
developer.github.com/v3/auth/

GET /api/v1/en/national_metadata.json Download metadata for all national indicators

This method allows users to download metadata for all national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national_metadata.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national_metadata.json

Response code

200

Response

GET /api/v1/en/national/list.json Download titles for national indicators

This method allows users to download titles for all national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/list.json"

Przykładowy URL

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/list.json

Response code

200

Response

GET /api/v1/en/national_data.json Download data for all national indicators

This method allows users to download data for all national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national_data.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national_data.json

Response code

200

Response

GET /api/v1/en/global_metadata.json Download metadata for all global indicators

This method allows users to download metadata for all global indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global_metadata.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global_metadata.json

Response code

200

Response

GET /api/v1/en/global/list.json Download titles for global indicators

This method allows users to download titles for all global indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/list.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/list.json

Response code

200

Response

GET /api/v1/en/global_data.json Download data for all global indicators

This method allows users to download data for all global indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global_data.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global_data.json

Response code

200

Response

GET /api/v1/en/national/{goal}.json Download all national indicators from chosen goal

This method allows users to download data and metadata for all national indicators from chosen goal in English.

Parameters

Name Description
goal number of indicator's goal ( 1 - 17 )

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/1.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/1.json

Response code

200

Response

GET /api/v1/en/global/{goal}.json Download all global indicators from chosen goal

This method allows users to download data and metadata for all global indicators from chosen goal in English.

Parameters

Name Description
goal number of indicator's goal ( 1 - 17 )

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/1.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/1.json

Response code

200

Response

GET /api/v1/en/national/{goal}/{num}.json Download national indicator

This method allows users to download data and metadata for chosen national indicator in English.

Parameters

Name Description
goal number of indicator's goal ( 1 - 17 )
num numer of indicator

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/1/1-1-b.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/1/1-1-b.json

Response code

200

Response

GET /api/v1/en/global/{goal}/{num}.json Download global indicator

This method allows users to download data and metadata for chosen global indicator in English.

Parameters

Name Description
goal number of indicator's goal ( 1 - 17 )
num numer of indicator

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/1/1-1-1.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/1/1-1-1.json

Response code

200

Response

GET /api/v1/en/sex.json Download sex-disaggregated global and national indicators

This method allows users to download data and metadata for sex-disaggregated global and national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/sex.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/sex.json

Response code

200

Response

GET /api/v1/en/national/sex_n.json Download sex-disaggregated national indicators

This method allows users to download data and metadata for sex-disaggregated national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/sex_n.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/sex_n.json

Response code

200

Response

GET /api/v1/en/national/area_n.json Download area-disaggregated national indicators

This method allows users to download data and metadata for area-disaggregated national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/area_n.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/national/area_n.json

Response code

200

Response

GET /api/v1/en/global/sex_g.json Download sex-disaggregated global indicators

This method allows users to download data and metadata for all global sex-disaggregated global indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/sex_g.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/sex_g.json

Response code

200

Response

GET /api/v1/en/global/area_g.json Download area-disaggregated global indicators

This method allows users to download data and metadata for area-disaggregated global indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/area_g.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/global/area_g.json

Response code

200

Response

GET /api/v1/en/area.json Download area-disaggregated global and national indicators

This method allows users to download data and metadata for area-disaggregated global and national indicators in English.

Parameters

No input parameters

Response content type

Curl example

curl -H "Accept:application/vnd.github.v3.raw" "https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/area.json"

URL example

https://api.github.com/repos/statisticspoland/sdg-indicators-pl/contents/api/v1/en/area.json

Response code

200

Response