In brief
An API for price comparison sites and agency systems has to handle traffic in which every policy sold is preceded by many quotes, and it has to answer faster than competitors, because the comparison site waits for all insurers only for a fixed time. So the API separates quoting from the policy administration system with a cache and a dedicated rating service, sets limits for each partner, publishes one versioned OpenAPI contract and monitors failed or late responses per partner.
What traffic comparison sites and multi-agencies generate
A comparison site asks every insurer for a premium as soon as a customer enters vehicle and driver details. The customer often changes one field and quotes again. A multi-agency (an agency selling products from many insurers) does the same from the system an agent uses at the desk. For the insurer the pattern is predictable: many quotes, few purchases, and peaks during hours when people are at their computers.
The IDD (the EU Insurance Distribution Directive), in Article 2(1)(1), counts as insurance distribution also providing information on insurance contracts according to criteria chosen by customers through a website, and compiling product rankings including price, when the customer can conclude a contract directly or indirectly. A comparison site is therefore a distributor, not just a traffic source, and the insurer needs to know what data and documents it passes to it. IDD requirements for the sales journey are covered in Insurance distribution (IDD) and online sales systems.
| Traffic characteristic | What it means for the API |
|---|---|
| many quotes per sale | quoting must not load the policy administration system |
| repeated requests with small changes | caching at the level of input data |
| a timeout on the comparison site's side | a late response is an offer the customer never sees |
| many partners at once | one partner must not take capacity from others |
| purchase via a link to the portal or directly via API | two purchase paths to test |
Architecture: quoting separated from the core
The most common problem in older integrations is a quote that calls the policy administration system on every request. That system was built to issue policies, not to absorb a quoting peak. A better layout has three layers:
- An API gateway accepts requests, authenticates the partner (usually OAuth 2.0 client credentials), enforces limits and records a request ID.
- A rating service calculates the premium from the same tariff version as the policy system but runs separately and scales horizontally. It keeps reference data and vehicle data in a cache.
- A purchase service issues the policy in the policy administration system only once the customer has chosen an offer. The operation is idempotent: a repeated request with the same key does not issue a second policy.
One condition is essential: the rating service and the policy system must rate on the same tariff version. Otherwise the customer sees one price on the comparison site and another at checkout. Testing that both paths agree is described in Testing a policy administration system after a tariff change.
Limits, caching and response time
Limits are set for each partner separately: requests per second and the daily volume from the contract. Once a limit is exceeded, the gateway returns status 429 (Too Many Requests, RFC 6585) with a Retry-After header instead of slowing the whole service down. The partner knows what happened, and other partners are not affected.
Quote caching works well when the key contains every input that affects the premium, plus the tariff version and the cover start date. A repeated request with the same data then returns a result without rating again, and a tariff change automatically invalidates old results. It is worth limiting validity to one day, because external data such as insurance history changes.
The response time target is set in percentiles, for example p99 below 300 ms for a quote, and measured separately for each partner. An average hides the partner for whom every tenth request takes a second. How to prepare and read a test of such an API is covered in API performance testing.
Contract and versions with many partners
Every partner that got its own format is separate code to maintain with each product change. One API with an OpenAPI contract changes that: the partner receives the specification, a test environment and sample responses, and the insurer maintains a single contract.
The rules that save the most work:
- backward-compatible changes (a new optional field) without a new version; breaking changes only in a new path version;
- a deprecation calendar for the old version, agreed with partners in advance, with a list of partners still using it;
- errors in one format, such as Problem Details from RFC 9457, with a reason code the partner can handle in its system (cover declined, missing vehicle data, limit exceeded);
- contract tests in CI that ensure a change on the insurer's side does not break a partner integration.
Security of such an API is checked against the OWASP API Security Top 10. The most frequent risk is a partner reaching another partner's quotes and policies by swapping an ID in the URL.
Monitoring lost quotes
A defect in a comparison site integration does not generate complaints. The customer simply does not see the offer and buys elsewhere. Monitoring must therefore show what ordinary server metrics hide:
| Metric | Why |
|---|---|
| share of quotes ending in error, by partner and reason code | shows that one partner sends data the service does not understand |
| share of responses slower than the partner's timeout | these are offers lost without a trace |
| share of declines by segment | a sudden rise often means a data defect, not a business decision |
| quote-to-purchase conversion by partner | a drop without a price change points to a problem along the way |
The case study An API platform for price comparison sites and multi-agencies shows this in practice. Designing the gateway, the contract and the tests for such connections is the scope of System integration.
Questions and answers
Does every comparison site need its own integration?
No. One API with an OpenAPI contract and separate credentials, limits and product configuration for each partner is enough. Differences between partners, such as a different product range or commission, live in configuration rather than code. The exception is a partner with its own exchange standard, where a translation layer in front of the gateway helps.
How fast must a quote be for a comparison site?
Fast enough to fit within the timeout the comparison site gives all insurers, with a margin for the network. The limit comes from the contract or the partner's documentation. Set the target at a high percentile such as p99, not as an average, and measure it per partner.
Will caching show the customer an outdated price?
No, if the key covers all data that affects the premium, the tariff version and the cover start date, and validity is short. A tariff change then produces a new key, so the old result is not used. At purchase, the service rates again in the policy administration system and compares the result with the offer.
How do we test an integration when the partner has no test environment?
Give the partner your own test environment with synthetic data and sample responses, and on your side run contract tests on recorded requests. Run the load test with a traffic profile reconstructed from gateway logs, without involving the partner.