Skip to main content
Challenge

Micro-Insurance Parametric Rainfall Trigger API with FastAPI and Open-Meteo

Smallholder farmers in tropical climate zones are acutely exposed to extreme rainfall deficits during El Niño events. Traditional indemnity insurance is administratively unviable for micro-policies under $50. Low-latency micro-insurance REST APIs are needed to continuously monitor open meteorological feeds and issue automatic mobile money payouts when rainfall falls below critical thresholds. In this challenge, you will construct a production-grade FastAPI microservice. The service will integrate asynchronous client queries to Open-Meteo and NOAA APIs, compute cumulative 30-day precipitation totals, evaluate parametric trigger policies, and return verified payout tokens. Your solution will feature OpenAPI endpoint definitions, asynchronous request pooling, unit test suites, and strict rate-limiting for high scale.

Machine LearningHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Develop an asynchronous FastAPI microservice to monitor open weather APIs and trigger parametric micro-insurance payouts for smallholder farmers.

Delivery guide

How work is evaluated

Evaluation

Evaluates REST API latency, trigger calculation accuracy, and HTTP error handling.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

api_response_status

Endpoint returns HTTP 200 OK for valid inputs

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

endpoint_latency_ms

Response time for API call in milliseconds • target: 250 • range: 0-2000

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Build high-throughput REST APIs using FastAPI and Pydantic.

  • Implement asynchronous HTTP network requests using `httpx` or `aiohttp`.

  • Calculate 30-day rolling precipitation deficits against historical climatology.

  • Generate cryptographic payout validation signatures for automated mobile money integration.

Resources and assets

Reference links and supporting material

Dataset notes

Synthetic geo-location list of smallholder farms in Kenya alongside simulated daily precipitation series.

Challenge setup

Evaluates REST API latency, trigger calculation accuracy, and HTTP error handling.

Challenge input

HTTP POST JSON body with farmer_id, latitude, longitude, threshold_mm

FastAPI

Standard Python web framework for asynchronous microservices.

Evaluated output

JSON response with cumulative_rainfall_mm, triggered (bool), payout_token

Evaluation checks
  • Endpoint returns HTTP 200 OK for valid inputs
  • Response time for API call in milliseconds • target: 250 • range: 0-2000
Configured evaluation evidence
  • Benchmark: MicroInsuranceBench
  • Endpoint Latency Ms target: 250
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Environment
  • Modal · Optional
Action Space
  • RAI · Required
  • Yi-34B · Optional
Policy Serving
  • Modal · Optional

Evaluation contract

  • api_response_status · Weight 1
  • endpoint_latency_ms · Weight 1

Metrics

  • endpoint_latency_ms · Target 250

Benchmarks

  • MicroInsuranceBench
  • security

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: HTTP POST JSON body with farmer_id, latitude, longitude, threshold_mm

    Output: JSON response with cumulative_rainfall_mm, triggered (bool), payout_token

    Execution harness: Python

Evaluation tools

  • FastAPI · Web Framework

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Micro-Insurance Parametric Rainfall Trigger API with FastAPI and Open-Meteo