Methodology
How this site gets a number onto a page
kWhWise is an energy-data site for people shopping a used EV. The nightly job pulls public files, writes JSON, and rebuilds the HTML. A page is published only when the data clears a thin-content rule. The snapshot on this build is November 19, 2026.
Sources
- FuelEconomy.gov vehicles.csv, retrieved November 19, 2026. Range, MPGe, kWh per 100 miles, 240-volt charge time, annual fuel-cost estimate, and the motor description all come from that file. Only rows with fuel type Electricity and an EV flag are used.
- NHTSA recalls and complaints APIs. Recall text is quoted. Complaint totals are counts of ODI filings, grouped by the top-level component. Model names are mapped with /products/vehicle/models?issueType=c, plus a fixed alias list where that directory omits a real EV name such as Mustang Mach-E.
- U.S. Department of Energy, Alternative Fuels Data Center alt-fuel stations, retrieved November 19, 2026. Public sites, status code E. API docs.
- Battery context is EV battery health: what 22,700 vehicles showed and the New Geotab data shows EV battery health remains strong as fast charging use increases (January 13, 2026). Average degradation in that study is 2.3% per year across 22,700 vehicles. It is not a reading for the car on the page.
- The VIN tool calls NHTSA vPIC in your browser: vpic.nhtsa.dot.gov.
Rules the generator follows
- A model year is eligible when FuelEconomy.gov has a battery-electric row, or NHTSA returns at least one recall campaign, or NHTSA returns at least 8 complaints for a matched model name.
- Years are ranked on raw NHTSA complaint counts and raw recall-campaign counts. Counts are not rates. Model years newer than the snapshot year minus 2 are shown and not labeled quietest or busiest.
- Model names come from NHTSA /products/vehicle/models?issueType=c when they match the model, plus aliases where that list omits a real EV name. Filings are deduped by ODI number. A filing that names two systems is counted under each top-level system. The total counts the filing once.
- Recall rows come from NHTSA recallsByVehicle. Duplicate campaign numbers are removed. Summary, consequence, and remedy text is NHTSA's, clipped only when it is very long.
- Implied usable kWh equals EPA range miles times EPA combined kWh per 100 miles, divided by 100. That is not the manufacturer's gross pack size. Estimated hours at 7.2 kW equal that kWh divided by 7.2, with no losses. EPA's published 240-volt charge time is shown beside it when the file has one.
- Station counts are public AFDC locations with status code E. A DC fast station has EV DC Fast Count above zero. A Level 2 station has EV Level 2 EVSE Num above zero. A site can be both. Connector counts overlap for the same reason. Port counts are the sums of those EVSE fields.
- kWhWise does not publish a used-car price until a cited market dataset is connected.
- Battery guidance quotes Geotab's published fleet study. It is not a test of the car in the ad.
What we leave out
- No per-model battery state of health. Pages cite Geotab's fleet average only.
- No used transaction prices. The price module is intentionally empty.
- No year-by-year charge-inlet dataset is wired in, so pages do not state a connector for a specific model.
- Complaint and recall counts are not divided by sales. A common car can collect more filings and still be fine.
- NHTSA's complaint model list is incomplete for some EVs, so the refresh also queries a fixed alias list and drops HTTP 400s.
Update cadence
A single command, npm run ship, refreshes the public files, releases queued pages, builds the static site, and prints what changed.
The launch set goes out on the first run. After that, each run publishes up to 15 ready pages that were waiting in data/queue.json.
Re-running on the same day reuses the HTTP cache, so it does not hammer the APIs. The AFDC file is cached longer when the only key available is the shared demo key, which allows about 50 requests a day.
The build writes static HTML to dist/. It does not need a server, an API key, or a database. Deploy that folder to Cloudflare Pages.
Thin pages
A model year needs an EPA battery-electric row, or at least one recall, or at least 8 complaints. A best-and-worst page needs three published years. A comparison needs one shared year with EPA range on both sides. A state page needs at least 15 public sites. A city page needs at least 40, plus a connector or network breakdown. Anything short of that stays out of the HTML.