OpenScorecard API 

The Disaster Resilience Scorecard for Cities offers an API, and encourages users anywhere to make visualizations or other apps using the data it provides. The API includes detailed data from city assessments completed in the Scorecard

About the API

What's an API?

  • An Application Programming Interface (API) is code that provides access to a database, and refreshes regularly with updated data from that database. 
  • The Scorecard API communicates information about the program and its participants that anyone can draw on, making integrations of Scorecard data into other websites or apps possible. 
  • The API contains many statistics about city progress and current disaster risk reduction status, all from the Scorecard, an online tool where cities can assess their resilience. 
  • The Scorecard API offers a large, open data set that grows as more cities join the program and assess their progress. 

Where can I do with the API?

  • A data visualization expert can use the API to craft customized data visualizations, showing city progress or combining Scorecard data with other sources 
  • The API makes the Scorecard data set open for use, beyond the small set of statistics displayed on the Scorecard homepage and available in individual city assessments
  • A front-end web developer can create custom features for websites or apps that show, for example, city progress by country, size, population, or region or region

Scorecard API Documentation

Documentation, including parameters and endpoints, are available below. /api/public/answers

Parameters

size, page 

Details

This endpoint provides a list of answers for published assessments. The AssessmentId allows to query /api/public/assessments/details/{assessmentId and search there for the questions metatada using the questionId correspondence.  

Currently, it is needed to provide a very high “size” parameter to make sure the API returns everything, such as ?size=100000 /api/public/assessments/detailsParameters

level: 0 | 1, location, size, page Details

This endpoint provides a list of published assessments.

If parameter “level=1” is specified, it also include their essentials.

Location parameter can be used to search for specific location, by name (?location=Victoria)./api/public/assessments/details/{assessmentId}

Parameters

assessmentId, level: 1 - 4, location, size, page 

Details

This endpoint provides an individual assessment with all its details. For example: https://scorecard-training.undrr.org/api/public/assessments/details/1?level=3 

The level indicates how deep the results will display (0 = assessment only, 1, first level answers and the aggregation of their subquestions, 2, first and second level answers, and aggregations of the subsubquestions, etc. up to level 4) When level = 0, API returns the top-level assessment data where specPath is empty. 

  • When level = 1, API returns the essential-level data where specPath = 1 to 10. 
  • When level = 2 and so on, API returns the answer-level data up to the given level e.g. specPath = 1.1 (level 2), 1.3.3 (level = 3), 9.5.2.1 (level = 4) 

The data is contained in specDetail :

  • specDetail.children = essential data 
  • specDetail.children.children = answers from x.x 
  • specDetail.children.children.children = answers from x.x.x 
  • specDetail.children.children.children.children = answers from x.x.x.x

I need more information. How do I get in touch with the Scorecard team?

Disaster Resilience Scorecard for Cities doesn't provide technical support for the API, but we do reply to queries about the program and city assessments via the MCR program.

Contact MCR secretariat for my region

I made something! How do I get in touch with MCR2030?

Have you created something with the API, or added the widgets to your website? We'd love to hear about it and share on social media. Please reach out @undrr on Twitter, or by contacting the focal point for your region through the link below. 

Contact MCR secretariat for my region