惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 【当耐特】
The Cloudflare Blog
B
Blog
Last Week in AI
Last Week in AI
小众软件
小众软件
量子位
S
SegmentFault 最新的问题
V
Visual Studio Blog
博客园 - 叶小钗
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
宝玉的分享
宝玉的分享
A
About on SuperTechFans
雷峰网
雷峰网
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building a Pet Insurance Comparison Engine: Handling Vari...
SIKOUTRIS · 2026-04-24 · via DEV Community

SIKOUTRIS

Building a Pet Insurance Comparison Engine: Handling Variable Premiums Across 15 French Insurers

French pet insurance has grown 34% since 2022, driven by rising vet costs and increased pet ownership post-COVID. But comparing products programmatically is a nightmare: 15 major insurers, each with their own pricing grid based on species, breed, age, region, and deductible. Here is how I built a comparison engine that handles this complexity.

The Data Model Challenge

Each insurer publishes premiums differently:

  • Santévet : JSON API (unofficial, scraped from their quote widget)
  • Assurimo : PDF tariff grids updated quarterly
  • Groupama : Static tables by risk category
  • Dalma : Dynamic pricing engine (quote request required)

The core problem: how do you normalize wildly different data structures into a comparable output?

A Flexible Pricing Schema

{
  "insurer_id": "santevet",
  "product_id": "sv-excellence",
  "species": "cat",
  "breed_risk_group": 2,
  "age_min_months": 12,
  "age_max_months": 84,
  "region": "IDF",
  "deductible_pct": 20,
  "ceiling_annual_eur": 3000,
  "monthly_premium_eur": 38.50,
  "reimbursement_basis": "actual_costs",
  "waiting_period_days": 30
}

Enter fullscreen mode Exit fullscreen mode

This schema handles ~80% of cases. The remaining 20% (hereditary conditions, breed exclusions, complementary modules) use an exclusions array and add_ons object.

Breed Risk Classification

The biggest normalization challenge is breed-to-risk mapping. French insurers use different classification systems:

  • Santévet: 4 risk groups (1=low, 4=high)
  • Assurimo: 7 categories by morphology
  • Allianz: breed whitelist / blacklist

I built a crosswalk table mapping 380 dog breeds and 90 cat breeds to a normalized 5-level risk scale using FCI (Fédération Cynologique Internationale) breed standards as the anchor.

Regional Pricing

Vet costs vary significantly by region: a consultation costs €28 in rural Creuse vs €68 in Paris 16th. Some insurers adjust premiums by department, others by zip code prefix, others by urban/rural flag only.

Solution: a geolocation lookup table mapping INSEE commune codes to risk tiers, updated annually from the DREES veterinary care cost survey.

Real-Time Quote Aggregation

For insurers with quote APIs, I use a queue-based system: user input triggers parallel quote requests across all insurers, with a 3-second timeout. Missing quotes fall back to cached tariff data (max 30 days old), flagged visually in the UI.

The result is a side-by-side comparison that actually reflects real prices. You can test the live engine at monassuranceanimal.fr, which covers 12 insurers with real-time quotes and 3 with cached grids.

Handling Annual Premium Updates

French law requires insurers to notify policyholders of premium changes 15 days before renewal. For comparison sites, this creates a "freshness" problem: prices quoted in November may differ by January.

My solution: a confidence score per premium record, calculated as 1 - (days_since_update / 90). Records older than 90 days are excluded from comparisons and flagged for manual refresh.

What I Would Do Differently

  1. Start with the PDF parser first - most insurers still distribute tariffs as PDFs, and building a reliable extractor took 3x longer than expected
  2. Document the exclusions schema early - adding hereditary conditions support retroactively broke 4 normalizers
  3. Build the insurer change detection webhook - instead of polling, subscribe to insurer sitemap changes

Have you built comparison engines in regulated industries? The insurance sector has unique challenges around accuracy obligations (ACPR regulations) that add compliance overhead. Happy to discuss in the comments.