Live Ford data on a home page with the FordConnect API
We wanted one page at home that shows each car's miles, fuel, oil life and tire pressure, without opening an app for each one. Ford has an official read-only API for this, called FordConnect. A small Python script on a Raspberry Pi now asks Ford every four hours what our two Fords last reported. Here's how it's built and what tripped us up.
What the page shows
Each car gets a card with its odometer, what's due next (oil, brake fluid, registration) and any booked shop dates. Click a card and you see what the car itself reports: fuel, oil life, the pressure in each tire, the 12 V battery, and whether it's locked. A low tire or a weak battery also sends a message to a phone.
Two sources feed the page. A file we keep by hand holds the service history and due dates. Ford's API fills in the live numbers.
What you need
- A Ford account with the car in it, the same one the FordPass app uses. This is for your own cars: each one needs its owner's sign-in before Ford shares anything.
- An app registered on Ford's developer site. That gives
you a client ID and a client secret. Set the redirect address
to
http://localhost:8080/callback. - Something that's always on to run the script. Ours is a Raspberry Pi. The script uses only Python's standard library, so there's nothing to install.
Link each car once
Ford ties each sign-in to one vehicle. When you log in, Ford asks which car to share, and the token you get back works for that car only. Two Fords means doing this twice.
- Start a tiny web server on your computer that listens on
port 8080 for
/callback. - Open Ford's login address in a browser, with your client
ID, the redirect address and a random
statevalue. - Sign in and pick one car.
- Ford sends the browser back to your local server with a code. Trade the code for an access token and a refresh token.
- Call
/garageto find out which car you just linked, and save the tokens in a file named after it.
All of the addresses sit under
https://api.vehicle.ford.com:
| Path | What it's for |
|---|---|
/fcon-public/v1/auth/init | The login page |
/fcon-query/v1/garage | Which car this token is for |
/fcon-query/v1/telemetry | Everything the car last reported |
/fcon-query/v1/vehicle-health/alerts | Warnings the car has raised |
/fcon-query/v1/vehicle-image | A link to a picture of the exact car |
Our link script does all five steps and then copies the token file to the Pi. We run it by hand, once per car.
Ask every four hours
The collector is one Python script in a Docker container. Every four hours, for each linked car, it does this:
- If the access token is about to run out, it trades the refresh token for a new one. Ford sends back a new refresh token too, so the script saves it each time.
- It reads
/telemetryand/vehicle-health/alerts. - It converts the units and writes one JSON file for the web page, plus a few numbers for the alert rules.
A read looks like this:
curl -s -H "Authorization: Bearer $TOKEN" \
https://api.vehicle.ford.com/fcon-query/v1/telemetry
Four hours is plenty, because the numbers only change when the car drives. The script reads what Ford already has on file. It doesn't send the car any commands.
What Ford sends back
Every reading comes with the time the car reported it, which tells you how fresh the number is.
| Reading | How it arrives | What we show |
|---|---|---|
| Odometer | Kilometers | Miles |
| Fuel | Percent, plus range in kilometers | Percent and miles |
| Oil life | Percent | Percent |
| Tires | kPa per wheel, the door-sticker value, and the car's own OK or low flag | psi, with low tires marked |
| 12 V battery | Volts and charge percent | Volts |
| Locks and doors | Locked or not, and any door or hood left open | A flag on the card |
| Position | Latitude, longitude and heading | A pin on a map |
There's more in the reply: ignition state, gear, coolant and outside temperature, window gaps, alarm state. We list those on the car's page under their own names.
The map
Under the cards, a map shows a pin at each car's last reported position. It's about thirty lines of JavaScript.
- Leaflet 1.9.4 draws the map. The page loads it from unpkg with integrity hashes, so the browser refuses a changed file.
- The tiles come from OpenStreetMap. There's no API key and no account. Keep their credit line on the map.
- Cars parked within about 50 meters of each other share one pin and one label. Without that, the cars in one garage pile up into a single blob.
- Leaflet and the tiles are the only outside things the page loads. Each viewer's browser asks OpenStreetMap for tiles of the area on screen, so that server can tell roughly where the cars are.
Alerts to a phone
The collector writes its numbers where Prometheus can read them, and four rules send a Telegram message:
- A tire the car itself flags as low, for 15 minutes.
- The 12 V battery under 12.2 volts for six hours.
- Ford refuses the token, so the car needs linking again.
- No clean read in 14 hours.
If you don't run Prometheus, the script could send the message itself with one call to Telegram's bot API.
What Ford doesn't know
Ford knows the oil life the car worked out. It doesn't know our own rule, which is an oil change every 5,000 miles or 12 months. It doesn't know what the shop did last spring or when the registration is due either. All of that lives in one JSON file we edit by hand, with one entry per car and a source for every number, such as a repair order.
The page matches the two by VIN. It uses Ford's odometer only when it's newer than ours and not lower, so one bad reading can't move the miles backward.
Things that bit us
- Ford limits how often you can ask about each car. We hit the limit at about a dozen calls an hour. Ford answers 429 with a wait time, and the script waits that long. Don't test calls by hand while the collector is running.
- The
statevalue in the login address can't be longer than 16 bytes. A longer one fails. - Distances are in kilometers and tire pressure is in kPa. Convert once, in the collector, so the page never has to.
- The garage reply has blanks for some models. Our F-350 came back named "2022 --", so the script falls back to the model year and the last six of the VIN.
- The health alerts reply isn't documented in detail. It comes wrapped in a "Success" message that looks like an alert if you aren't careful. We keep anything that has text and a severity, and skip the wrapper.
- Ford gives you a link to a picture of the exact car, but
the image server turned down Python's built-in downloader
with a 403. Plain
curlworked. We fetch the picture once when linking and keep the file. SwappingHD-FULLforHD-TILEin the link gets the same picture at a fifth of the size. - There's no list of trips. To see driving by month, the script notes how far the odometer moved between two reads.
- A gas car's reply still has empty fields for electric drive. We leave those out.
What we chose on purpose
- Read only. The app we registered can look, and nothing in our scripts tries to lock, unlock or start a car.
- The client secret and the token files stay out of git. The token files are readable only by the account that runs the collector.
- We save Ford's full reply so we can spot new fields later, but we strip the position out of that copy first. Only a rounded position goes to the page, which is reachable only on the home network.
- No extra Python packages, so there's less to update and less to break.
The yearly redo
Ford's consent lasts one year. After that the refresh is turned down, the page shows "relink" next to the car, and someone has to run the link script again. We linked ours in November 2026, so we haven't been through a renewal yet. We'll update this page when we have.
A thank-you to Ford
We're glad Ford gives owners this access, and we haven't paid anything for it. An official, read-only way to see our own cars' data is what made this easy to build.
The code
The two scripts we run are on GitHub at cxnielsen/fordconnect-home-dashboard, with our host names and paths taken out. One links a car and the other is the collector. Both are plain Python with no extra packages.
The repo also has a sample of the JSON file the collector writes, so you can see the output before you link a car. A one-file map page and an example Docker setup are in there too. The scripts are examples of what works for us. They come with no support, and Ford didn't make or approve them.
Sources
- The two scripts and a sample output file on GitHub
- Ford Developer, where you register an app and find the FordConnect docs
- Prometheus Alertmanager, which sends our alerts to Telegram