API

Application programming interface (API)

The API application allows to browse and download for further processing the full range of data and metadata on Sustainable Development Goals (SDGs) of the 2030 Agenda (with data for Poland) and a set of indicators for monitoring sustainable development on the level of the country.
The data is made available through REST API in JSON format. The list below presents vailable web services provided as part of the API.

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/

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

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