Widget Score
API Reference
Widget Score
Lightweight endpoint for the embeddable AirRating badge.
GET
Widget Score
Overview
Powers the embeddablewidget.js badge. Returns a minimal risk score payload optimised for frontend rendering. Open CORS — can be called directly from any domain.
Responses are cached for 1 hour (s-maxage=3600).
Request
string
required
IATA code of the departure airport.
string
required
IATA code of the arrival airport.
string
required
IATA airline code.
string
required
Departure date in
YYYY-MM-DD format.string
Your API key (optional during beta).
Response
string
IATA departure airport code.
string
IATA arrival airport code.
string
IATA airline code.
string
Requested date.
integer
Risk Score 0–100.
string
Risk label:
Low risk, Medium risk, High risk, or Very high risk.string
Hex color for the score badge (green → red).
integer
Historical delay rate as a whole percentage.
Example
Response
Embedding the widget
Add the script tag once per page and place one or morediv.airrating-widget elements wherever you want the badge to appear:
