{
 "openapi": "3.1.0",
 "info": {
  "title": "THRIVE Fleet Intelligence data API",
  "version": "1.0.0",
  "summary": "Free UK fleet data: fuel prices, running-cost indices, EV charging costs, company car tax and HMRC rates.",
  "description": "Free, open, no key. Figures come from DESNZ, HMRC, Ofgem and GOV.UK (OGL v3.0) and THRIVE's own published methods. Attribution is requested, not required. Each response names its source; quote figures with their date. AI agents can also use THRIVE's MCP server at https://www.thrivefleet.co.uk/mcp.",
  "contact": {
   "name": "THRIVE Fleet Intelligence",
   "url": "https://www.thrivefleet.co.uk/contact",
   "email": "hello@thrivefleet.co.uk"
  },
  "license": {
   "name": "THRIVE data terms",
   "url": "https://www.thrivefleet.co.uk/data/terms"
  }
 },
 "externalDocs": {
  "description": "API documentation",
  "url": "https://www.thrivefleet.co.uk/data/api"
 },
 "servers": [
  {
   "url": "https://www.thrivefleet.co.uk/api/v1"
  }
 ],
 "paths": {
  "/fuel-prices": {
   "get": {
    "operationId": "getFuelPrices",
    "summary": "UK weekly pump prices",
    "description": "DESNZ weekly road fuel prices: diesel and petrol, pence per litre, last 26 weeks, newest first.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "UK weekly pump prices",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/cost-index": {
   "get": {
    "operationId": "getFleetCostIndex",
    "summary": "Fleet Cost Index",
    "description": "Weekly energy cost per mile of a diesel van against an electric van (home, public, blended) and the ratio.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fleet Cost Index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/fuel-bill-index": {
   "get": {
    "operationId": "getFuelBillIndex",
    "summary": "Fleet Fuel Bill Index",
    "description": "UK diesel price rebased to 100 at THRIVE's base week.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fleet Fuel Bill Index",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/charging-cost-gap": {
   "get": {
    "operationId": "getChargingCostGap",
    "summary": "Charging cost gap",
    "description": "Public against home charging cost per mile on HMRC's advisory electric rates.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Charging cost gap",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/break-even": {
   "get": {
    "operationId": "getVanBreakEven",
    "summary": "Electric van break-even",
    "description": "Miles for an electric van to repay its price premium over a diesel in fuel savings.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Electric van break-even",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/cost-to-charge": {
   "get": {
    "operationId": "getCostToCharge",
    "summary": "Real cost to charge at home",
    "description": "Home charging cost per mile from the DESNZ domestic electricity price, against HMRC's advisory electric rate.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Real cost to charge at home",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/fleet-charging-costs": {
   "get": {
    "operationId": "getFleetChargingCosts",
    "summary": "Fleet charging costs",
    "description": "Depot (DESNZ non-domestic by business size), home (Ofgem cap) and public charging prices and cost per mile.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Fleet charging costs",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/bik": {
   "get": {
    "operationId": "getCompanyCarTaxRates",
    "summary": "Company car tax (BiK) rates",
    "description": "HMRC appropriate percentages by CO2 band and electric range, every legislated tax year.",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "csv for a CSV download instead of JSON",
      "schema": {
       "type": "string",
       "enum": [
        "csv"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Company car tax (BiK) rates",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/rates": {
   "get": {
    "operationId": "getCurrentRates",
    "summary": "Current HMRC advisory fuel and electric rates, and method constants",
    "description": "Current advisory fuel rates by engine size, advisory electric rates for home and public charging, and the constants THRIVE's indices use. JSON only.",
    "responses": {
     "200": {
      "description": "Current rates",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  },
  "/rate-card": {
   "get": {
    "operationId": "getFleetRateCard",
    "summary": "Fleet Rate Card",
    "description": "The rates and dates UK fleets work to (AFR, BiK, mileage allowance, eVED, ZEV mandate, van grant, van benefit and upcoming changes), each with its official source.",
    "responses": {
     "200": {
      "description": "Fleet Rate Card",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "description": "Envelope with source, terms, unit and the data; see the docs page for each shape"
        }
       }
      }
     }
    }
   }
  }
 }
}