Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

API Reference

Overview

The ThinkHazard! API provides programmatic access to hazard assessments, recommendations, and related information for administrative divisions worldwide. Use this API to integrate hazard data into your applications, tools, and workflows.

Base URL: http://thinkhazard.org/en

Response Format: JSON

Authentication

No authentication is required to access the ThinkHazard! API.

Reference Data

Division Codes

Administrative divisions are identified by standard codes. For easier integration into web applications and query builders, JSON formatted versions are available:

LevelDescriptionJSON ReferenceSize
ADM0Countries listcountries.json245 countries
ADM2Flat list with parent referencesdivisions_flat.json43,202 divisions
URBUrban areas listurban_areas.json2,919 urban areas

File Statistics:

Hazard Types

CodeHazard Type
EQEarthquake
VAVolcano
TSTsunami
TCTropical Cyclones
FLRiver Flood
PFPluvial Flood
CFCoastal Flood
LSLandslide
EHExtreme Heat
WFWildfire
DGWater Scarcity

Hazard Levels

CodeLevel
VLOVery Low
LOWLow
MEDMedium
HIGHigh

Endpoints

Get Hazard Summary for Division

Retrieve hazard levels for all hazard types in a specific administrative division.

GET /report/{division_code}.json

Path Parameters

ParameterTypeRequiredDescription
division_codestringYesAdministrative division code (e.g., PAK, AFG015)

Response

Returns an array of hazard assessments for the specified division.

Response Schema:

[
  {
    "hazardlevel": {
      "mnemonic": "string",
      "title": "string"
    },
    "hazardtype": {
      "mnemonic": "string",
      "hazardtype": "string"
    }
  }
]

Example Request

curl http://thinkhazard.org/en/report/PAK.json

Example Response

[
  {
    "hazardlevel": {
      "mnemonic": "HIG",
      "title": "High"
    },
    "hazardtype": {
      "mnemonic": "FL",
      "hazardtype": "River flood"
    }
  },
  {
    "hazardlevel": {
      "mnemonic": "MED",
      "title": "Medium"
    },
    "hazardtype": {
      "mnemonic": "EQ",
      "hazardtype": "Earthquake"
    }
  }
]

Additional Examples


Get Complete Hazard Report

Retrieve comprehensive hazard information for a specific hazard type and division, including recommendations, data sources, resources, and contacts.

GET /report/{division_code}/{hazard_type}.json

Path Parameters

ParameterTypeRequiredDescription
division_codestringYesAdministrative division code (e.g., PAK)
hazard_typestringYesTwo-letter hazard code (e.g., FL, EQ)

Response

Returns detailed hazard report including hazard category, recommendations, data sources, resources, and contact information.

Response Schema:

{
  "hazard_category": {
    "general_recommendation": "string",
    "hazard_level": "string",
    "hazard_type": "string"
  },
  "recommendations": [
    {
      "text": "string",
      "detail": "string | null"
    }
  ],
  "sources": [
    {
      "id": "string",
      "owner_organization": "string",
      "detail_url": "string"
    }
  ],
  "resources": [
    {
      "text": "string",
      "url": "string"
    }
  ],
  "contacts": [
    {
      "name": "string",
      "email": "string",
      "phone": "string",
      "url": "string"
    }
  ],
  "climate_change_recommendation": "string"
}

Example Request

curl http://thinkhazard.org/en/report/PAK/FL.json

Example Response

{
  "hazard_category": {
    "general_recommendation": "In the area you have selected name of location river flood hazard is classified as **high** according to the information that is currently available to this tool. This means that there is a chance of more than 10% that potentially damaging and life-threatening floods occur in the coming 10 years. **Project planning decisions, project design, and construction methods must take into account the level of river flood hazard**. The following is a list of recommendations that could be followed in different phases of the project to help reduce the risk to your project. Please note that these recommendations are generic and not project-specific.",
    "hazard_level": "High",
    "hazard_type": "River flood"
  },
  "recommendations": [
    {
      "text": "Find out if the exact project location is in a hazardous zone by using local data, e.g. by collecting local information either from river flood hazard maps, by interviewing local governmental organizations, or by hiring international expertise.",
      "detail": null
    }
  ],
  "sources": [
    {
      "id": "FL-GLOBAL-GLOFRIS",
      "owner_organization": "GLOFRIS",
      "detail_url": "http://45.55.174.20/layers/hazard%3Ainunmask_world_stream_6tthres_2_t_50"
    }
  ],
  "resources": [
    {
      "text": "Cities and Flooding: A Guide to Integrated Urban Flood Risk Management for the 21st Century",
      "url": "http://45.55.174.20/documents/162"
    }
  ],
  "contacts": [
    {
      "name": "Disaster Risk Management Knowledge Centre (DRMKC)",
      "email": "drmkc@jrc.ec.europa.eu",
      "phone": "",
      "url": "http://drmkc.jrc.ec.europa.eu/#news/432/list"
    }
  ],
  "climate_change_recommendation": "Climate change impacts: Model projections are inconsistent in changes in rainfall."
}

Search Administrative Divisions

Search for administrative divisions by name or code to find the correct division code for API requests.

GET /divisions/search?q={query}&level={level}

Query Parameters

ParameterTypeRequiredDescription
qstringYesSearch query (name or code)
levelstringNoFilter by administrative level: ADM0, ADM1, or ADM2
limitintegerNoMaximum results to return (default: 20, max: 100)

Response

Returns an array of matching divisions with their codes and hierarchy.

Response Schema:

[
  {
    "code": "string",
    "name": "string",
    "level": "string",
    "country_code": "string",
    "country_name": "string",
    "parent_code": "string | null",
    "parent_name": "string | null"
  }
]

Example Request

curl "http://thinkhazard.org/en/divisions/search?q=pakistan&level=ADM0"

Example Response

[
  {
    "code": "PAK",
    "name": "Pakistan",
    "level": "ADM0",
    "country_code": "PAK",
    "country_name": "Pakistan",
    "parent_code": null,
    "parent_name": null
  }
]

Get Country List

Retrieve a complete list of all countries (ADM0 level divisions).

GET /divisions/countries

Response

Returns an array of all countries with their codes.

Response Schema:

[
  {
    "code": "string",
    "name": "string",
    "iso2": "string",
    "iso3": "string"
  }
]

Example Request

curl http://thinkhazard.org/en/divisions/countries

Example Response

[
  {
    "code": "AFG",
    "name": "Afghanistan",
    "iso2": "AF",
    "iso3": "AFG"
  },
  {
    "code": "PAK",
    "name": "Pakistan",
    "iso2": "PK",
    "iso3": "PAK"
  }
]

Get Subdivisions

Retrieve all subdivisions (states/provinces or districts) for a specific administrative division.

GET /divisions/{parent_code}/subdivisions

Path Parameters

ParameterTypeRequiredDescription
parent_codestringYesParent division code (e.g., PAK for country, PAK-PB for province)

Response

Returns an array of subdivisions within the specified parent division.

Response Schema:

[
  {
    "code": "string",
    "name": "string",
    "level": "string"
  }
]

Example Request

curl http://thinkhazard.org/en/divisions/AFG/subdivisions

Example Response

[
  {
    "code": "AFG001",
    "name": "Badakhshan",
    "level": "ADM1"
  },
  {
    "code": "AFG002",
    "name": "Badghis",
    "level": "ADM1"
  },
  {
    "code": "AFG015",
    "name": "Kandahar",
    "level": "ADM1"
  }
]

Get Hazard Category Information

Retrieve general information and technical recommendations for a specific hazard type and level combination.

GET /hazardcategory/{hazard_type}/{hazard_level}.json

Path Parameters

ParameterTypeRequiredDescription
hazard_typestringYesTwo-letter hazard code (e.g., EQ, FL)
hazard_levelstringYesThree-letter hazard level code (e.g., HIG, MED)

Response

Returns general recommendations and technical guidance for the specified hazard type and level.

Response Schema:

{
  "hazard_category": {
    "hazard_type": "string",
    "hazard_level": "string",
    "general_recommendation": "string",
    "technical_recommendations": [
      {
        "text": "string",
        "detail": "string | null"
      }
    ]
  }
}

Example Request

curl http://thinkhazard.org/en/hazardcategory/EQ/HIG.json

Example Response

{
  "hazard_category": {
    "hazard_type": "Earthquake",
    "hazard_level": "High",
    "general_recommendation": "In the area you have selected name of location earthquake hazard is classified as **high** according to the information that is currently available. This means that there is more than a 20% chance of potentially-damaging earthquake shaking in your project area in the next 50 years. Based on this information, the impact of earthquake **must be considered** in all phases of the project, in particular during design and construction. **Project planning decisions, project design, and construction methods should take into account the level of earthquake hazard**. Further detailed information should be obtained to adequately account for the level of hazard.",
    "technical_recommendations": [
      {
        "text": "Consider the effect that collapse (or destruction) or serious damage to buildings and infrastructure associated with the planned project could have on the local population and environment.",
        "detail": null
      }
    ]
  }
}

Query Builder

To find administrative division codes or urban area codes for API requests, use the interactive Query Builder tool:

→ Open Query Builder

The Query Builder provides:

Alternative: Direct JSON Access

For programmatic access, download the complete data:

Support

For questions or issues with the API, please visit the ThinkHazard! GitHub repository.