# Alternative Fuels Data Center API

> Alternative Fuels Data Center returns nearby EV charging station details and is available as a workflow and API.

Alternative Fuels Data Center (AFDC) finds nearby public EV chargers from a US or Canadian location. Search ev chargers uses a US or Canadian city, address, ZIP code, or postal code, with optional network and connector filters.

- Page: https://fous.com/workflows/alternative-fuels-data-center
- Handle: `@alternative-fuels-data-center`
- Category: [Energy](https://fous.com/workflows/category/energy)
- Source website: https://afdc.energy.gov
- Last verified: Sep 29, 2026
- Fous is not affiliated with Alternative Fuels Data Center.

## Methods

### Search ev chargers

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

Find public, open EV charging stations near a US or Canadian city, address, or postal code, sorted by distance. Power is the highest listed connector output at each station; unavailable details are null.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `network` | string | no | `"Tesla"` | Charging network name, such as Tesla or ChargePoint; any includes all networks. |
| `location` | string | yes | `"Austin, TX"` | A US or Canadian city, street address, ZIP code, or postal code, such as Austin, TX. |
| `max_results` | integer | no | `5` | Maximum stations to return, for example 20 (up to 100). |
| `radius_miles` | number | no | `5` | Search radius in miles, for example 5 (up to 50). |
| `charging_level` | string | no | `"dc_fast"` | Charging level to match, such as dc_fast; any includes all levels. |
| `connector_type` | string | no | `"tesla_nacs"` | Connector to match, such as ccs; any includes all connectors. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "location"
  ],
  "properties": {
    "network": {
      "type": "string",
      "default": "any",
      "description": "Charging network name, such as Tesla or ChargePoint; any includes all networks.",
      "examples": [
        "Tesla"
      ]
    },
    "location": {
      "type": "string",
      "minLength": 2,
      "description": "A US or Canadian city, street address, ZIP code, or postal code, such as Austin, TX.",
      "examples": [
        "Austin, TX",
        "San Francisco, CA",
        "Toronto, ON"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum stations to return, for example 20 (up to 100).",
      "x-fous-developer": true,
      "examples": [
        5,
        3
      ]
    },
    "radius_miles": {
      "type": "number",
      "default": 5,
      "maximum": 50,
      "minimum": 0.1,
      "description": "Search radius in miles, for example 5 (up to 50).",
      "examples": [
        5,
        10
      ]
    },
    "charging_level": {
      "enum": [
        "any",
        "level_2",
        "dc_fast"
      ],
      "type": "string",
      "default": "any",
      "description": "Charging level to match, such as dc_fast; any includes all levels.",
      "examples": [
        "dc_fast"
      ]
    },
    "connector_type": {
      "enum": [
        "any",
        "j1772",
        "ccs",
        "chademo",
        "tesla_nacs"
      ],
      "type": "string",
      "default": "any",
      "description": "Connector to match, such as ccs; any includes all connectors.",
      "examples": [
        "tesla_nacs",
        "ccs"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "location": "Austin, TX"
    },
    {
      "network": "Tesla",
      "location": "San Francisco, CA",
      "max_results": 5,
      "radius_miles": 5,
      "charging_level": "dc_fast",
      "connector_type": "tesla_nacs"
    },
    {
      "location": "Toronto, ON",
      "max_results": 3,
      "radius_miles": 10,
      "charging_level": "dc_fast",
      "connector_type": "ccs"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `stations` | array |  | Nearby EV charging stations, nearest first. |
| `stations[].hours` | string or null | `"24 hours daily. Open to Teslas only."` | Opening hours. |
| `stations[].phone` | string or null | `"877-798-3752"` | Station phone number. |
| `stations[].access` | string or null | `"Public"` | Access information. |
| `stations[].address` | string | `"601 Van Ness Avenue, San Francisco, CA 94102, US"` | Full street address. |
| `stations[].network` | string or null | `"Tesla Supercharger"` | Charging network name. |
| `stations[].pricing` | string or null | `"$24 per hour"` | Charging pricing text. |
| `stations[].latitude` | number or null | `37.781103` | Station latitude. |
| `stations[].map_link` | string | `"https://www.google.com/maps/search/?api=1&query=37.781103%2C-122.422019"` | Link to this station on a map. |
| `stations[].power_kw` | number or null | `150` | Highest listed connector power in kilowatts. |
| `stations[].longitude` | number or null | `-122.422019` | Station longitude. |
| `stations[].station_id` | integer | `165417` | Station identifier. |
| `stations[].station_name` | string | `"San Francisco, CA - Van Ness Avenue - Tesla Supercharger"` | Station name. |
| `stations[].dc_fast_ports` | integer | `12` | Number of DC fast ports. |
| `stations[].level_2_ports` | integer | `0` | Number of Level 2 ports. |
| `stations[].distance_miles` | number | `0.31211` | Distance from the searched place in miles. |
| `stations[].connector_types` | array |  | Connector types in words. |
| `stations[].date_last_confirmed` | string or null | `"2026-06-18"` | Date the station was last confirmed, YYYY-MM-DD. |

**Example input**

```json
{
  "network": "Tesla",
  "location": "San Francisco, CA",
  "max_results": 5,
  "radius_miles": 5,
  "charging_level": "dc_fast",
  "connector_type": "tesla_nacs"
}
```

**Example output**

```json
{
  "stations": [
    {
      "hours": "24 hours daily. Open to Teslas only.",
      "phone": "877-798-3752",
      "access": "Public",
      "address": "601 Van Ness Avenue, San Francisco, CA 94102, US",
      "network": "Tesla Supercharger",
      "pricing": null,
      "latitude": 37.781103,
      "map_link": "https://www.google.com/maps/search/?api=1&query=37.781103%2C-122.422019",
      "power_kw": 150,
      "longitude": -122.422019,
      "station_id": 165417,
      "station_name": "San Francisco, CA - Van Ness Avenue - Tesla Supercharger",
      "dc_fast_ports": 12,
      "level_2_ports": 0,
      "distance_miles": 0.31211,
      "connector_types": [
        "NACS (J3400 AC/DC)"
      ],
      "date_last_confirmed": "2026-06-18"
    },
    {
      "hours": "24 hours daily. Open to Teslas only.",
      "phone": "877-798-3752",
      "access": "Public",
      "address": "2300 16th Street, San Francisco, CA 94103, US",
      "network": "Tesla Supercharger",
      "pricing": null,
      "latitude": 37.765819,
      "map_link": "https://www.google.com/maps/search/?api=1&query=37.765819%2C-122.409854",
      "power_kw": 75,
      "longitude": -122.409854,
      "station_id": 302961,
      "station_name": "San Francisco, CA - 16th Street - Tesla Supercharger",
      "dc_fast_ports": 12,
      "level_2_ports": 0,
      "distance_miles": 0.93761,
      "connector_types": [
        "NACS (J3400 AC/DC)"
      ],
      "date_last_confirmed": "2026-06-18"
    }
  ]
}
```

## 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": "@alternative-fuels-data-center",
  "visibility": "public",
  "operation": "search_ev_chargers",
  "version": 1,
  "input": {
    "location": "Austin, TX"
  },
  "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\": \"@alternative-fuels-data-center\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_ev_chargers\",\n  \"version\": 1,\n  \"input\": {\n    \"location\": \"Austin, TX\"\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": "@alternative-fuels-data-center",
  "visibility": "public",
  "operation": "search_ev_chargers",
  "version": 1,
  "input": {
    "location": "Austin, TX"
  },
  "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":"@alternative-fuels-data-center","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

- Find nearby charging stations for a planned trip
- Compare station distance, power, and connector types
- Check station access, hours, and phone numbers
- Review listed charging prices by station

## FAQ

### Is Fous affiliated with Alternative Fuels Data Center?

No. Fous is not affiliated with Alternative Fuels Data Center. This workflow reads the public afdc.energy.gov 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 Alternative Fuels Data Center account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from afdc.energy.gov 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.

### Which EV chargers are near a city or address?

Search ev chargers returns nearby public, open stations sorted by distance from a US or Canadian location.

### What connectors and power do nearby stations offer?

Search ev chargers returns connector types and the highest listed connector output for each station.

### How much do nearby charging stations cost?

Search ev chargers returns listed pricing text when available.

## Related

- [PlugShare API](https://fous.com/workflows/plugshare.md): EV charging station map and driver reviews.
- [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.
- [Open Charge Map API](https://fous.com/workflows/open-charge-map.md): Public electric-vehicle charging location listings.
- [GasBuddy API](https://fous.com/workflows/gasbuddy.md): GasBuddy finds stations and community-reported fuel prices in the US and Canada, with nearby prices that may be missing or out of date and regional averages that may lag the day.
- [FuelEconomy.gov API](https://fous.com/workflows/fueleconomy-gov.md): FuelEconomy.gov provides official vehicle fuel economy ratings, driving range, emissions, five-year savings, and annual fuel costs based on current fuel prices and EPA’s 15,000-mile annual driving assumption.
- [US Energy Information Administration API](https://fous.com/workflows/us-energy-information-administration.md): US Energy Information Administration provides official energy statistics and analysis, including latest weekly fuel prices and preliminary monthly state electricity prices with historical comparisons.
- [AAA API](https://fous.com/workflows/aaa.md): AAA daily gas price averages for the United States, states and metro areas.
- [AutoZone API](https://fous.com/workflows/autozone.md): AutoZone finds parts and stores; engine fit may need confirmation, prices or warranties may be missing beyond 24 parts, and store listings cap at 25.
- [All Energy workflows](https://fous.com/workflows/category/energy)
