# 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/tools/carmax
- Handle: `@carmax`
- Category: [Commerce](https://fous.com/tools/category/commerce)
- Source website: https://carmax.com
- Last verified: Sep 29, 2026

## Methods

### Search cars

Operation `search_cars`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/carmax`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `search_cars`: Search cars. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-carmax https://api.fous.com/mcp/tools/carmax --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## 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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this CarMax tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/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/tools/carvana.md): Search used vehicles for sale on Carvana.
- [CarGurus API](https://fous.com/tools/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/tools/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/tools/autotrader.md): Search new, used and certified cars for sale across the United States.
- [mobile.de API](https://fous.com/tools/mobile-de.md): Search cars for sale on mobile.de.
- [Tesla API](https://fous.com/tools/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/tools/offerup.md): Local marketplace for buying and selling items.
- [All Commerce tools](https://fous.com/tools/category/commerce)
