# CarMax API

> CarMax returns used-car listings and details as a workflow and API.

CarMax, also called CarMax.com or CarMax Used Cars, returns used-car listings with prices, mileage, vehicle details, and store information. Search cars needs a make and model; optionally narrow results by year, ZIP code, distance, price, or mileage.

- Page: https://fous.com/workflows/carmax
- Handle: `@carmax`
- Category: [Commerce](https://fous.com/workflows/category/commerce)
- Source website: https://carmax.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with CarMax.

## Methods

### Search cars

Operation `search_cars`, version 1. 1 credit per call.

Search CarMax used cars by make and model with optional ZIP, distance, year, price and mileage filters. CarMax order is preserved. Pages expose only the first 48 cars; distance is CarMax’s distance from the selected local store, and larger limits or narrow distance filters may return fewer matches.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `car` | string | yes | `"Toyota RAV4"` | Make and model to search, for example Toyota RAV4. |
| `max_year` | integer | no | `2024` | Latest model year, for example 2024. |
| `min_year` | integer | no | `2022` | Earliest model year, for example 2020. |
| `zip_code` | string | no | `"10001"` | US ZIP code for local car ordering, for example 10001. |
| `max_price` | number | no | `35000` | Maximum price in USD, for example 30000. |
| `max_mileage` | integer | no | `50000` | Maximum odometer mileage, for example 50000. |
| `max_results` | integer | no | `5` | Maximum number of cars, for example 24. Public pages show at most 48 cars. |
| `radius_miles` | integer | no | `500` | Maximum listed distance in miles from your ZIP, for example 75; 0 means nationwide. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "car"
  ],
  "properties": {
    "car": {
      "type": "string",
      "description": "Make and model to search, for example Toyota RAV4.",
      "examples": [
        "Toyota RAV4",
        "Honda Civic",
        "Toyota Blahblah"
      ]
    },
    "max_year": {
      "type": "integer",
      "default": null,
      "maximum": 2100,
      "minimum": 1900,
      "description": "Latest model year, for example 2024.",
      "examples": [
        2024,
        2035
      ]
    },
    "min_year": {
      "type": "integer",
      "default": null,
      "maximum": 2100,
      "minimum": 1900,
      "description": "Earliest model year, for example 2020.",
      "examples": [
        2022,
        2021,
        2035
      ]
    },
    "zip_code": {
      "type": "string",
      "default": null,
      "pattern": "^[0-9]{5}$",
      "description": "US ZIP code for local car ordering, for example 10001.",
      "examples": [
        "10001",
        "90210"
      ]
    },
    "max_price": {
      "type": "number",
      "default": null,
      "minimum": 0,
      "description": "Maximum price in USD, for example 30000.",
      "examples": [
        35000,
        25000
      ]
    },
    "max_mileage": {
      "type": "integer",
      "default": null,
      "minimum": 0,
      "description": "Maximum odometer mileage, for example 50000.",
      "examples": [
        50000
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 24,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of cars, for example 24. Public pages show at most 48 cars.",
      "x-fous-developer": true,
      "examples": [
        5,
        8,
        3
      ]
    },
    "radius_miles": {
      "type": "integer",
      "default": 0,
      "minimum": 0,
      "description": "Maximum listed distance in miles from your ZIP, for example 75; 0 means nationwide.",
      "examples": [
        500
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "car": "Toyota RAV4",
      "min_year": 2022,
      "zip_code": "10001",
      "max_price": 35000,
      "max_results": 5
    },
    {
      "car": "Honda Civic",
      "max_year": 2024,
      "min_year": 2021,
      "zip_code": "90210",
      "max_price": 25000,
      "max_mileage": 50000,
      "max_results": 8,
      "radius_miles": 500
    },
    {
      "car": "Toyota RAV4",
      "max_year": 2035,
      "min_year": 2035,
      "max_results": 3
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `cars` | array |  |  |
| `cars[].vin` | string or null | `"JTMMWRFVXND145263"` |  |
| `cars[].make` | string or null | `"Toyota"` |  |
| `cars[].trim` | string or null | `"LE"` |  |
| `cars[].year` | integer or null | `2022` |  |
| `cars[].model` | string or null | `"RAV4 Hybrid"` |  |
| `cars[].price` | number or null | `31998` | Price in US dollars. |
| `cars[].mileage` | integer or null | `27445` | Miles. |
| `cars[].car_link` | string | `"https://www.carmax.com/car/70265421"` |  |
| `cars[].photo_link` | string or null | `"https://img2.carmax.com/assets/70265421/hero.jpg?width=400"` |  |
| `cars[].store_name` | string or null | `"Edison"` |  |
| `cars[].store_state` | string or null | `"New Jersey"` |  |
| `cars[].fuel_economy` | string or null | `"41 city / 38 highway MPG"` |  |
| `cars[].stock_number` | string or null | `"70265421"` |  |
| `cars[].transfer_fee` | string or null |  | Shipping or transfer fee text when shown. |
| `cars[].currency_code` | string | `"USD"` | USD. |
| `cars[].distance_miles` | number or null | `30` | CarMax listing distance from its selected local store, if a ZIP is given. |
| `cars[].exterior_colour` | string or null | `"White"` |  |
| `cars[].highlighted_features` | array |  |  |

**Example input**

```json
{
  "car": "Toyota RAV4",
  "min_year": 2022,
  "zip_code": "10001",
  "max_price": 35000,
  "max_results": 5
}
```

**Example output**

```json
{
  "cars": [
    {
      "vin": "JTMMWRFVXND145263",
      "make": "Toyota",
      "trim": "LE",
      "year": 2022,
      "model": "RAV4 Hybrid",
      "price": 31998,
      "mileage": 27445,
      "car_link": "https://www.carmax.com/car/70265421",
      "photo_link": "https://img2.carmax.com/assets/70265421/hero.jpg?width=400",
      "store_name": "Edison",
      "store_state": "New Jersey",
      "fuel_economy": "41 city / 38 highway MPG",
      "stock_number": "70265421",
      "transfer_fee": null,
      "currency_code": "USD",
      "distance_miles": 30,
      "exterior_colour": "White",
      "highlighted_features": [
        "4WD/AWD",
        "Satellite Radio Ready"
      ]
    },
    {
      "vin": "JTMRWRFVXPD191801",
      "make": "Toyota",
      "trim": "XLE",
      "year": 2023,
      "model": "RAV4 Hybrid",
      "price": 34998,
      "mileage": 27033,
      "car_link": "https://www.carmax.com/car/28466741",
      "photo_link": "https://img2.carmax.com/assets/28466741/hero.jpg?width=400",
      "store_name": "East Meadow",
      "store_state": "New York",
      "fuel_economy": "38 city / 35 highway MPG",
      "stock_number": "28466741",
      "transfer_fee": null,
      "currency_code": "USD",
      "distance_miles": 40,
      "exterior_colour": "White",
      "highlighted_features": [
        "4WD/AWD",
        "Satellite Radio Ready"
      ]
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@carmax",
  "visibility": "public",
  "operation": "search_cars",
  "version": 1,
  "input": {
    "car": "Toyota RAV4",
    "min_year": 2022,
    "zip_code": "10001",
    "max_price": 35000,
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@carmax\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_cars\",\n  \"version\": 1,\n  \"input\": {\n    \"car\": \"Toyota RAV4\",\n    \"min_year\": 2022,\n    \"zip_code\": \"10001\",\n    \"max_price\": 35000,\n    \"max_results\": 5\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@carmax",
  "visibility": "public",
  "operation": "search_cars",
  "version": 1,
  "input": {
    "car": "Toyota RAV4",
    "min_year": 2022,
    "zip_code": "10001",
    "max_price": 35000,
    "max_results": 5
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@carmax","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare prices for used cars by make and model
- Find listings near a chosen ZIP code
- Filter cars by model year and mileage
- Review vehicle details and store locations
- Estimate listed distance from a local store

## FAQ

### Is Fous affiliated with CarMax?

No. Fous is not affiliated with CarMax. This workflow reads the public carmax.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a CarMax account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from carmax.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What used cars are available for a make and model?

Search cars returns matching listings, including make, model, year, trim, price, and mileage.

### What cars are listed near a ZIP code?

Search cars can use a ZIP code and radius to return locally ordered listings with distance when available.

### How much does a listed car cost?

Search cars returns each listing’s price in US dollars.

## Related

- [Cars.com API](https://fous.com/workflows/cars-com.md): Cars.com finds car listings by make, model, and U.S. ZIP code, and provides dealerships’ latest customer reviews when available.
- [Carvana API](https://fous.com/workflows/carvana.md): Search used vehicles for sale on Carvana.
- [CarGurus API](https://fous.com/workflows/cargurus.md): CarGurus helps shoppers browse dealer-listed new and used cars with deal ratings, and view average used prices, price ranges and 12-month price history by model year.
- [Carfax API](https://fous.com/workflows/carfax.md): Carfax provides used-car listings near a US ZIP code with free history highlights, plus open safety recalls reported by CARFAX for a VIN or US plate.
- [Autotrader API](https://fous.com/workflows/autotrader.md): Search new, used and certified cars for sale across the United States.
- [mobile.de API](https://fous.com/workflows/mobile-de.md): Search cars for sale on mobile.de.
- [Tesla API](https://fous.com/workflows/tesla.md): Tesla offers new and certified pre-owned vehicles across the United States and nearby open Supercharger sites, with delivery estimates and opening hours only when available.
- [OfferUp API](https://fous.com/workflows/offerup.md): Local marketplace for buying and selling items.
- [All Commerce workflows](https://fous.com/workflows/category/commerce)
