KatRisk APIs - A Digital Connection to Empower Loss Modelers

KatRisk API resources for modelers


SpatialKat API 1.0

KatRisk's SpatialKat API is the digital face to simplify the complexity of probabilistic loss model analysis. The API takes the modeler's input and can be seamlessly integrated into workflows to perform complex mathematical methods and financial calculations. SpatialKat is KatRisk's event-based probabilistic analysis software that calculates location through portfolio losses and produces event loss tables and exceedance probability curves. Fifty thousand years of simulated events, including tropical cyclones, storm surges, inland floods, and hail, are modeled.

KatRisk API overview

The SpatialKat API provides an interconnection between the components of the KatRisk platform. Modelers can use the API methods to perform the following operations:

  • Manage API versions

  • Upload exposures and financial terms

  • Import exposures and policies to the KatRisk platform

  • Get a system of records

  • Execute models

  • Schedule jobs

  • Download exposures and analysis results

Automation

Catastrophic modeling workflows are widely optimized as more advanced tools are leveraged to process voluminous data. Customers are looking for means to automate their workflows and minimize manual interventions using the traditional user interface. KatRisk APIs are not limited to a single workflow; the endpoints are catered toward creating various pre-defined processes. Suppose we want to run probabilistic models to study the potential effects of climate change on losses with various Representative Concentration Pathways (RCP) or NOAA sea-level rise scenarios. A sample workflow will upload the exposure once and rerun the probabilistic model analysis by varying the climate state and climate sensitivity parameters from the API request. This example illustrates where an automated workflow comes in handy to improve the process efficiency to analyze multiple scenarios. The capabilities of the API are the same as in the SpatialKat UI. 

Security

The API uses security keys generated within the SpatialKat. Each SpatialKat user should create an API key and be authorized to call the API. Users must log into SpatialKat with their credentials to generate a key. Every request to an API call must provide a valid SpatialKat API key in the header. 

API Job Queue

The SpatialKat API leverages SpatialKat's job queue to schedule batch jobs. API Jobs are added to the SpatialKat distributed platform's job queue and then executed by the job runner. When the API is called, it is added to the job queue and enters into the queued state. Once the job is picked for execution, the system updates the status to “processing”. The API request gets an instant response with the job details along with the position in the line. A simple status pooling heartbeat API allows querying near-real-time execution updates.

Documentation

The API framework comes with a Swagger endpoint. This interface has a provision to authorize users to call APIs and lists all available resources in the SpatialKat API. Users can modify the API request parameters and instantly view the API response. To call the API from the terminal window, Swagger conveniently generates a curl command. 

Versioning

The endpoint URL consists of three parts: the base URL, the supported version, and the action to be performed. The API version number is required in all API calls within the URL. Endpoints without a version number are not supported. Using a deprecated version in the endpoint URL will cause an error message.

Base URL

Version

Action

https://katrisk.platform.api/

V1

/model/execute

Performance and Scalability

The SpatialKat API is simply a layer of code that sits on top of the SpatialKat platform and provides programmatic access to modelers. The performance and scalability of the API depend on the underlying SpatialKat hardware configurations. The performance benchmark from a 25-core system with 1,150,000 location exposures, each having a unique site policy, 30,000 account policies, and 15,000 facultative policies, comes to approximately twelve minutes for a multi-peril analysis. Multi peril consists of tropical cyclones, storm surge, and inland flood. Demand surge is included here. At KatRisk, we prioritize performance and scalability to provide the best user experience and increase the SpatialKat ecosystem's availability. The analysis runtime is proportional to core count with close to linear scaling. Achieving scalability is more straightforward by simply increasing the core count.

Metering

SpatialKat metering helps to understand the usage statistics around the number of sites after a successful exposure import and the number of locations producing AAL after a successful analysis run. It also helps to understand resource usage at a granular level by user, day, month, and year. This identifies workloads whose resources require significantly higher usage and helps to manage to allocate the workload efficiently.

Code Samples

Code samples are essential in helping customers integrate the API into their workflows. KatRisk provides Python, C#, Java, R, and curl code samples. The examples walk through the primary usage and functionality of APIs. There are multiple workflows possible while automating business processes. KatRisk can guide clients in finding the proper workflow that fits their business needs.



By Swami Krishnamoorthy, Chief Technology Officer, KatRisk

Stay tuned for the “Location Loss API” blog post. To learn more about how KatRisk technology offerings and solutions, please reach out to us at contact@katrisk.com