openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Pacific Island Climate Change Data Story API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: sea-level-anomalies description: Sea level anomalies data endpoints - name: core description: Core API endpoints - name: story description: Story section endpoints paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /story/decade-analysis: get: operationId: getDecadeAnalysis tags: [story] summary: Per-country and global averages across 3 decades description: Breaks sea level data into 3 decades (1993-2002, 2003-2012, 2013-2023) to show escalation over time responses: "200": description: Decade analysis data content: application/json: schema: $ref: "#/components/schemas/DecadeAnalysis" /story/annual-deviation: get: operationId: getAnnualDeviation tags: [story] summary: Pacific-wide annual mean deviation from 30-year grand mean for lollipop chart responses: "200": description: Annual deviation data content: application/json: schema: $ref: "#/components/schemas/AnnualDeviationData" /core/raw-data: get: operationId: getCoreRawData tags: [core] summary: Retrieve the exact raw data from the CSV file description: Returns all records parsed from the sea level anomalies CSV file with their original columns. responses: "200": description: Raw CSV data records content: application/json: schema: type: array items: $ref: "#/components/schemas/RawCsvRecord" /core/sea-level-by-country: get: operationId: getCoreSeaLevelByCountry tags: [core] summary: Sea level anomaly time series per country responses: "200": description: Country time series data content: application/json: schema: type: array items: $ref: "#/components/schemas/CountryTimeSeries" /story/hero-section: get: operationId: getHeroSection tags: [story] summary: Aligned data for Hero Section responses: "200": description: Hero section telemetry content: application/json: schema: $ref: "#/components/schemas/HeroSectionData" /story/data-landscape: get: operationId: getDataLandscape tags: [story] summary: Aligned data for Data Landscape section responses: "200": description: Data landscape overview content: application/json: schema: $ref: "#/components/schemas/SeaLevelAnomaliesOverview" /story/ocean-rising: get: operationId: getOceanRising tags: [story] summary: Aligned data for Ocean Is Rising section responses: "200": description: Ocean is rising trend data content: application/json: schema: type: array items: $ref: "#/components/schemas/TrendDataPoint" /story/pace-of-change: get: operationId: getPaceOfChange tags: [story] summary: Aligned data for Pace of Change section responses: "200": description: Acceleration metrics content: application/json: schema: type: array items: $ref: "#/components/schemas/AccelerationPoint" /story/enso-effect: get: operationId: getEnsoEffect tags: [story] summary: Aligned data for ENSO Effect section responses: "200": description: ENSO sensitivity data content: application/json: schema: $ref: "#/components/schemas/ENSOSensitivityData" /story/patterns-over-time: get: operationId: getPatternsOverTime tags: [story] summary: Aligned data for Patterns over Time section responses: "200": description: Heatmap matrix content: application/json: schema: $ref: "#/components/schemas/HeatmapData" /story/future-outlook: get: operationId: getFutureOutlook tags: [story] summary: Aligned data for Future Outlook section responses: "200": description: Projected forecast data content: application/json: schema: $ref: "#/components/schemas/ForecastData" /story/risk-assessment: get: operationId: getRiskAssessment tags: [story] summary: Aligned data for Risk Assessment section responses: "200": description: Risk score details content: application/json: schema: $ref: "#/components/schemas/RiskScoreData" /story/pacific-at-a-glance: get: operationId: getPacificAtAGlance tags: [story] summary: Aligned data for Pacific at a Glance section responses: "200": description: Full sortable rankings content: application/json: schema: type: array items: $ref: "#/components/schemas/CountryRanking" /story/explore-any-nation/{code}: get: operationId: getExploreAnyNation tags: [story] summary: Aligned data for Explore Any Nation sub-section parameters: - name: code in: path required: true schema: type: string description: ISO country code (e.g. FJ, TV, WS) responses: "200": description: Country profile details content: application/json: schema: $ref: "#/components/schemas/CountryProfile" "404": description: Country not found /story/what-this-means: get: operationId: getWhatThisMeans tags: [story] summary: Aligned data for What This Means section responses: "200": description: Threshold crossings summary content: application/json: schema: $ref: "#/components/schemas/ThresholdCrossingsData" /story/sub-regions: get: operationId: getSubRegions tags: [story] summary: Get sub-regional climate risk data groups responses: "200": description: Sub-regional clusters analysis data content: application/json: schema: type: array items: $ref: "#/components/schemas/RegionalCluster" components: schemas: HealthStatus: type: object properties: status: type: string required: [status] SeaLevelAnomaliesOverview: type: object properties: totalCountries: type: integer yearRange: type: object properties: start: type: integer end: type: integer required: [start, end] totalObservations: type: integer avgRiseMeters: type: number maxRiseCountry: type: string maxRiseValue: type: number countriesAboveAvg: type: integer elNinoYear: type: integer recentDecadeAvg: type: number baselineDecadeAvg: type: number required: - totalCountries - yearRange - totalObservations - avgRiseMeters - maxRiseCountry - maxRiseValue - countriesAboveAvg - elNinoYear - recentDecadeAvg - baselineDecadeAvg TrendDataPoint: type: object properties: year: type: integer avgAnomaly: type: number minAnomaly: type: number maxAnomaly: type: number countriesRising: type: integer required: [year, avgAnomaly, minAnomaly, maxAnomaly, countriesRising] CountryTimeSeries: type: object properties: country: type: string code: type: string data: type: array items: type: object properties: year: type: integer value: type: number required: [year, value] cumulativeRise: type: number trend: type: string enum: [rising, stable, variable] required: [country, code, data, cumulativeRise, trend] HeatmapData: type: object properties: years: type: array items: type: integer countries: type: array items: type: string matrix: type: array items: type: array items: type: number minValue: type: number maxValue: type: number required: [years, countries, matrix, minValue, maxValue] DecadeCountryRow: type: object properties: country: type: string code: type: string d1: type: number description: Average anomaly 1993–2002 d2: type: number description: Average anomaly 2003–2012 d3: type: number description: Average anomaly 2013–2023 acceleration: type: number description: d3 minus d1 — net change across the study period required: [country, code, d1, d2, d3, acceleration] GlobalDecadeAvg: type: object properties: key: type: string label: type: string avg: type: number required: [key, label, avg] DecadeAnalysis: type: object properties: countries: type: array items: $ref: "#/components/schemas/DecadeCountryRow" globalDecades: type: array items: $ref: "#/components/schemas/GlobalDecadeAvg" required: [countries, globalDecades] VolatilityCountry: type: object properties: country: type: string code: type: string mean: type: number volatility: type: number observations: type: integer required: [country, code, mean, volatility, observations] VolatilityData: type: object properties: countries: type: array items: $ref: "#/components/schemas/VolatilityCountry" globalMean: type: number globalVolatility: type: number required: [countries, globalMean, globalVolatility] AccelerationPoint: type: object properties: country: type: string code: type: string slopeFullPeriod: type: number description: Linear slope (m/year) over full 1993–2023 period slopeFirstHalf: type: number description: Slope over first half of the period slopeSecondHalf: type: number description: Slope over second half of the period accelerating: type: boolean description: True if second-half slope exceeds first-half slope required: [ country, code, slopeFullPeriod, slopeFirstHalf, slopeSecondHalf, accelerating, ] CountryRanking: type: object properties: country: type: string code: type: string mean: type: number volatility: type: number cumulativeRise: type: number peakValue: type: number peakYear: type: integer troughValue: type: number troughYear: type: integer slope: type: number d1Avg: type: number d3Avg: type: number decadeAcceleration: type: number observations: type: integer required: - country - code - mean - volatility - cumulativeRise - peakValue - peakYear - troughValue - troughYear - slope - d1Avg - d3Avg - decadeAcceleration - observations ForecastPoint: type: object properties: year: type: integer projected: type: number description: Projected average sea level anomaly lower: type: number description: Lower confidence bound (−2σ) upper: type: number description: Upper confidence bound (+2σ) required: [year, projected, lower, upper] HistoricalForecastPoint: type: object properties: year: type: integer avgAnomaly: type: number required: [year, avgAnomaly] ForecastData: type: object properties: historical: type: array items: $ref: "#/components/schemas/HistoricalForecastPoint" projected: type: array items: $ref: "#/components/schemas/ForecastPoint" slopeMmPerYear: type: number description: Linear trend slope in mm/year r2: type: number description: Coefficient of determination (model fit quality) projectedRise2030: type: number description: Projected cumulative anomaly increase by 2030 projectedRise2033: type: number description: Projected cumulative anomaly increase by 2033 required: [ historical, projected, slopeMmPerYear, r2, projectedRise2030, projectedRise2033, ] RiskScoreComponents: type: object properties: riseScore: type: number slopeScore: type: number volatilityScore: type: number accelerationScore: type: number required: [riseScore, slopeScore, volatilityScore, accelerationScore] RiskScore: type: object properties: country: type: string code: type: string riskScore: type: number description: Composite risk score 0–100 riskLevel: type: string enum: [Critical, High, Medium, Low] components: $ref: "#/components/schemas/RiskScoreComponents" cumulativeRise: type: number slope: type: number volatility: type: number decadeAcceleration: type: number required: [ country, code, riskScore, riskLevel, components, cumulativeRise, slope, volatility, decadeAcceleration, ] RiskScoreData: type: object properties: countries: type: array items: $ref: "#/components/schemas/RiskScore" avgRiskScore: type: number criticalCount: type: integer highCount: type: integer mediumCount: type: integer lowCount: type: integer required: [ countries, avgRiskScore, criticalCount, highCount, mediumCount, lowCount, ] CountryProfileTimeSeries: type: object properties: year: type: integer value: type: number rollingAvg: type: number required: [year, value, rollingAvg] CountryProfileDecade: type: object properties: label: type: string avg: type: number count: type: integer required: [label, avg, count] CountryProfileStats: type: object properties: mean: type: number volatility: type: number cumulativeRise: type: number slope: type: number peakValue: type: number peakYear: type: integer troughValue: type: number troughYear: type: integer observations: type: integer rankByCumulativeRise: type: integer totalCountries: type: integer required: - mean - volatility - cumulativeRise - slope - peakValue - peakYear - troughValue - troughYear - observations - rankByCumulativeRise - totalCountries CountryProfile: type: object properties: country: type: string code: type: string timeSeries: type: array items: $ref: "#/components/schemas/CountryProfileTimeSeries" decadeBreakdown: type: array items: $ref: "#/components/schemas/CountryProfileDecade" stats: $ref: "#/components/schemas/CountryProfileStats" required: [country, code, timeSeries, decadeBreakdown, stats] ThresholdCrossingNation: type: object properties: country: type: string code: type: string firstPositive: type: integer nullable: true firstTenth: type: integer nullable: true firstFifth: type: integer nullable: true yearsPositive: type: integer yearsAboveTenth: type: integer yearsAboveFifth: type: integer streakAboveZero: type: integer latestValue: type: number cumulativeRise: type: number required: [ country, code, firstPositive, firstTenth, firstFifth, yearsPositive, yearsAboveTenth, yearsAboveFifth, streakAboveZero, latestValue, cumulativeRise, ] ThresholdCrossingSummary: type: object properties: crossedZero: type: integer crossedTenth: type: integer crossedFifth: type: integer total: type: integer avgFirstPositiveYear: type: number required: [crossedZero, crossedTenth, crossedFifth, total, avgFirstPositiveYear] ThresholdCrossingsData: type: object properties: nations: type: array items: $ref: "#/components/schemas/ThresholdCrossingNation" summary: $ref: "#/components/schemas/ThresholdCrossingSummary" required: [nations, summary] ENSONation: type: object properties: country: type: string code: type: string elNinoAvg: type: number description: Average sea level anomaly during El Niño years (1997-98, 2015-16) laNinaAvg: type: number description: Average sea level anomaly during La Niña years (2010-11, 2020-21) neutralAvg: type: number description: Average sea level anomaly during neutral years sensitivity: type: number description: La Niña avg minus El Niño avg — higher = more ENSO-sensitive required: [country, code, elNinoAvg, laNinaAvg, neutralAvg, sensitivity] ENSOGlobal: type: object properties: elNinoAvg: type: number laNinaAvg: type: number neutralAvg: type: number required: [elNinoAvg, laNinaAvg, neutralAvg] ENSOSensitivityData: type: object properties: nations: type: array items: $ref: "#/components/schemas/ENSONation" global: $ref: "#/components/schemas/ENSOGlobal" elNinoYears: type: array items: type: integer laNinaYears: type: array items: type: integer required: [nations, global, elNinoYears, laNinaYears] AnnualDeviationEntry: type: object properties: year: { type: integer } avg: { type: number } deviation: { type: number } enso: { type: string } required: [year, avg, deviation, enso] AnnualDeviationData: type: object properties: deviations: type: array items: $ref: "#/components/schemas/AnnualDeviationEntry" mean30yr: { type: number } maxDeviation: { type: number } minDeviation: { type: number } required: [deviations, mean30yr, maxDeviation, minDeviation] HeroSectionData: type: object properties: overview: $ref: "#/components/schemas/SeaLevelAnomaliesOverview" decadeAnalysis: $ref: "#/components/schemas/DecadeAnalysis" acceleration: type: array items: $ref: "#/components/schemas/AccelerationPoint" volatility: $ref: "#/components/schemas/VolatilityData" required: [overview, decadeAnalysis, acceleration, volatility] RegionalClusterNation: type: object properties: code: type: string name: type: string value: type: number required: [code, name, value] RegionalCluster: type: object properties: region: type: string enum: [Melanesia, Micronesia, Polynesia] nationsCount: type: integer d1AvgCm: type: number d2AvgCm: type: number d3AvgCm: type: number shiftCm: type: number avgSlopeMmYr: type: number latest2023AvgCm: type: number nations: type: array items: $ref: "#/components/schemas/RegionalClusterNation" description: type: string required: - region - nationsCount - d1AvgCm - d2AvgCm - d3AvgCm - shiftCm - avgSlopeMmYr - latest2023AvgCm - nations - description RawCsvRecord: type: object properties: STRUCTURE: type: string STRUCTURE_ID: type: string STRUCTURE_NAME: type: string ACTION: type: string FREQ: type: string Frequency: type: string CLIMATE_CHANGE_INDICATORS: type: string Climate Change Indicators: type: string GEO_PICT: type: string Pacific Island Countries and territories: type: string TIME_PERIOD: type: string Time: type: string OBS_VALUE: type: string Observation value: type: string OBS_STATUS: type: string Observation Status: type: string UNIT_MEASURE: type: string Unit of measure: type: string ERROR_TYPE: type: string Error type: type: string ERROR_VAL: type: string Error value: type: string REPORTING_TYPE: type: string Reporting Type: type: string OBS_COMMENT: type: string Comment: type: string required: - STRUCTURE - STRUCTURE_ID - STRUCTURE_NAME - ACTION - FREQ - Frequency - CLIMATE_CHANGE_INDICATORS - Climate Change Indicators - GEO_PICT - Pacific Island Countries and territories - TIME_PERIOD - Time - OBS_VALUE - Observation value - OBS_STATUS - Observation Status - UNIT_MEASURE - Unit of measure - ERROR_TYPE - Error type - ERROR_VAL - Error value - REPORTING_TYPE - Reporting Type - OBS_COMMENT - Comment