Developer Network NREL NREL Developer Network

Nearest Stations (GET /api/alt-fuel-stations/v1/nearest)

Return the nearest alternative fuel stations within a distance of a given location.

Request URL

GET /api/alt-fuel-stations/v1/nearest.format?parameters

Request Parameters

The following query parameters may be passed in the request to control the output:

Parameter Required Value Description
format Yes
Type: string
Default: None
Options: json, xml, csv

The output response format. Given in the URL as the file extension.

api_key Yes
Type: string
Default: None

Your developer API key. See API key usage for more information.

location Depends
Type: string
Default: None

A free-form input describing the address of the location. This may include the address given in a variety of formats, such as:

  • street, city, state, postal code
  • street, city, state
  • street, postal code
  • postal code
  • city, state

(Either the location parameter or both the latitude and longitude parameters are required)

latitude Depends
Type: decimal
Range: -90 to 90

The latitude of the desired location.

(Either the location parameter or both the latitude and longitude parameters are required)

longitude Depends
Type: decimal
Range: -180 to 180

The longitude of the desired location.

(Either the location parameter or both the latitude and longitude parameters are required)

radius No
Type: decimal or string
Default: 5.0
Range: 0.0 to 500.0, or infinite

The radius (in miles) around the search location to search for stations within.

An explicit radius of up to 500.0 miles may be passed in, or the special infinite string may be passed in to find the nearest stations regardless of distance.

status No
Type: string
Default: all
Options: all, E, P, T

Return stations that match the given status. A single status, or a comma-separated list of multiple statuses, may be given.

Option Description
all Include both open and planned stations.
E Open: The station is open and carries alternative fuel.
P Planned: The station is not yet open, but plans to carry alternative fuel in the future, or the station is temporarily out of service.
T Temporarily unavailable: The station is temporarily unavailable. See the “Expected Date” field for an anticipated open date.
access No
Type: string
Default: all
Options: all, public, private

Return stations with the given access type.

fuel_type No
Type: string
Default: all
Options: all, BD, CNG, E85, ELEC, HY, LNG, LPG

Return stations that supply any of the given fuel types. A single fuel type, or a comma-separated list of multiple fuel types, may be given.

Option Description
all Include all fuel types
BD Biodiesel (B20 and above)
CNG Compressed Natural Gas
E85 Ethanol (E85)
ELEC Electric
HY Hydrogen
LNG Liquefied Natural Gas
LPG Liquefied Petroleum Gas (Propane)
cards_accepted No
Type: string
Default: all
Options: all, A, D, M, V, Cash, Checks, CFN, CleanEnergy, Comdata, EFS, FleetOne, FuelMan, GasCard, PHH, PacificPride, Speedway, Tchek, TCH, Trillium, Voyager, Wright_Exp

Return stations that accept any of the given payment methods. A single payment method, or a comma-separated list of multiple payment methods, may be given.

Option Description
all Include all payment types
A American Express
D Discover
M MasterCard
V VISA
Cash Cash
Checks Check
CFN Commercial Fueling Network
CleanEnergy Clean Energy
Comdata Comdata
EFS EFS
FleetOne Fleet One
FuelMan Fuelman
GasCard GASCARD
PHH PHH
PacificPride Pacific Pride
Speedway Speedway
Tchek T-Chek T-Card
TCH TCH
Trillium Trillium
Voyager Voyager
Wright_Exp WEX
owner_type No
Type: string
Default: all
Options: all, FG, LG, P, SG, T

Return stations owned by the given types of owners. A single owner type, or a comma-separated list of multiple owner types, may be given.

Option Description
all Include all owner types
P Privately owned
T Utility owned
FG Federal government owned
LG Local government owned
SG State government owned
J Jointly owned (combination of owner types)
federal_agency_id No
Type: integer
Default: all
Options: all, (see table to right for IDs)

Return stations owned by the given federal agency. A federal agency ID, or a comma-separated list of multiple federal agency IDs, may be given.

Option Description
all Include all stations, regardless of federal agency owner
3 Defense Agencies
4 U.S. Department of Agriculture
5 Department of Air Force
6 Department of Army
7 Department of Commerce
8 U.S. Department of Energy
9 Department of Health and Human Services
10 Department of Homeland Security
12 Department of Justice
14 Department of Navy
16 Department of the Interior
17 U.S. Department of Transportation
19 Department of Veterans Affairs
20 U.S. Environmental Protection Agency
22 National Aeronautics and Space Administration
23 Smithsonian Institution
24 Social Security Administration
25 U.S. Postal Service
26 United States Marine Corps
ev_network No
Type: string
Default: all
Options: all, AeroVironment Network, Blink Network, ChargePoint Network, EV Connect, eVgo Network, GE WattStation, Greenlots, OpConnect, SemaCharge Network, Tesla

Return only electric charging stations that belong to the given network. A single network, or a comma separate list of multiple networks, may be given.

Option
all
AeroVironment Network
Blink Network
ChargePoint Network
EV Connect
eVgo Network
GE WattStation
Greenlots
OpConnect
SemaCharge Network
Tesla
ev_charging_level No
Type: string
Default: all
Options: all, 1, 2, dc_fast, legacy

Return only electric charging stations that provide the given level of electric vehicle supply equipment (EVSE).

Option Description
all Include all charging levels
1 Level 1 EVSE (standard 110V outlet)
2 Level 2 EVSE (J1772 connector)
dc_fast DC Fast Charging
legacy Legacy charging systems (such as inductive paddles)
ev_connector_type No
Type: string
Default: all
Options: all, NEMA515, NEMA520, NEMA1450, J1772, CHADEMO, J1772COMBO, TESLA

Return only electric charging stations that provide the given connector types.

Option Description
all Include all electric connector types
NEMA515 NEMA 5-15 (Level 1)
NEMA520 NEMA 5-20 (Level 1)
NEMA1450 NEMA 14-50 (Level 1)
J1772 J1772 (Level 2)
CHADEMO CHAdeMO (DC fast charging)
J1772COMBO SAE J1772 Combo (DC fast charging)
TESLA Tesla (DC fast charging and Level 2)
state No
Type: string
Default: None
Return only stations within the given state. State must be given as a two character state code (eg, "CO" for Colorado). A single state, or a comma-separate list of multiple states, may be given.
zip No
Type: string
Default: None
Return only stations within the given ZIP code. ZIP codes must be exactly 5 digits long. A single ZIP code, or a comma-separate list of multiple ZIP codes, may be given.
limit No
Type: integer
Default: 20
Minimum: 1
The maximum number of results to return.
offset No
Type: integer
Default: 0
Minimum: 0
Offset the results found (can be used with the limit parameter to paginate the results).

Response Fields

The response is composed of the fuel stations matching the requested query. For JSON or XML formats, additional metadata is supplied in the following structure:

Field Value Description
total_results
Type: integer

How many total stations match your requested query (regardless of any "limit" applied).

offset
Type: integer

The result offset applied to this query (if the "offset" parameter was given).

station_locator_url
Type: string

The URL of the Alternative Fueling Station Locator, the web application that supplies this data.

latitude Type: decimal The latitude of the given location. This either matches the "latitude" parameter passed in, or is the geocoded latitude of the "location" parameter.
longitude Type: decimal The longitude of the given location. This either matches the "longitude" parameter passed in, or is the geocoded longitude of the "location" parameter.
precision Type: record Details on the precision of the geocoded "location" parameter (if given). See precision record fields for response details.
fuel_stations
Type: array
An array of matching fuel station records returned in order of ascending distance from the given location. See fuel station record fields for response details.

Fuel Station Record Fields

The individual fuel station records are returned in order of ascending distance from the given location. Each station has the following attributes:

Field Value Description
fuel_type_code
Type: string

The type of alternative fuel the station provides. Fuel types are given as code values as described below:

Value Description
BD Biodiesel (B20 and above)
CNG Compressed Natural Gas
E85 Ethanol (E85)
ELEC Electric
HY Hydrogen
LNG Liquefied Natural Gas
LPG Liquefied Petroleum Gas (Propane)
station_name
Type: string
The name of the station.
street_address
Type: string
The street address of the station's location.
intersection_directions
Type: string
Brief additional information about how to locate the station.
city
Type: string
The city of the station's location.
state
Type: string
The two character U.S. state code of the station's location.
zip
Type: string
The ZIP code (postal code) of the station's location.
plus4
Type: string
The plus-4 portion of the station's ZIP code (U.S. ZIP codes only).
station_phone
Type: string
The phone number of the station.
status_code
Type: string

The current status of the station, given as code values as described below:

Value Description
E Open: The station is open.
P Planned: The station is not yet open, but plans to carry alternative fuel in the future, or the station is temporarily out of service. See the "Expected Date" field for an anticipated open date.
T Temporarily unavailable: The station is temporarily unavailable. See the “Expected Date” field for an anticipated open date.
expected_date
Type: date
For planned stations, the date the station is expected to open or start carrying alternative fuel. For temporarily unavailable stations, the expected date is the date the station is expected to reopen. This date is estimated but not guaranteed.
groups_with_access_code
Type: string

A description of who is allowed to access the station and other station access information.

Value Description
Private Private station.
Private - fleet customers only Private station that may allow other entities to fuel through a business-to-business arrangement. For more information, fleet customers should refer to the “Access Days Time” field for contact information or contact the station directly.
Private – government only Private station available only to government vehicles, or some subset of government vehicles.
Public Publicly available to all customers.
Public – call ahead Publicly available, but customers should call before visiting the station. See “Station Phone” for more details.
Public – credit card at all times Publicly available, but only accepts credit cards as payment. The station may also accept fleet cards or station-specific fueling cards. See “Cards Accepted” field for more details.
Public – card key at all times Publicly available, but only accepts fleet cards or station-specific fueling cards as payment. See “Cards Accepted” field for more details.
Public – credit card after hours Publicly available, and accepts credit cards 24 hours a day. See “Access Days Time” and “Cards Accepted” fields for more details.
Public – card key after hours Publicly available, and accepts fleet cards or station-specific fueling cards 24 hours a day. See “Access Days Time” and “Cards Accepted” fields for more details.
PLANNED – not yet available Not yet open, but plans to carry alternative fuel in the future. See the "Expected Date" field for an anticipated open date.
TEMPORARILY UNAVAILBLE Temporarily unavailable. See the “Expected Date” field for an anticipated open date.
access_days_time
Type: string
Hours of operation for the station.
cards_accepted
Type: string

A space-separated list of payment methods accepted. Payment methods are given as code values as described below:

Value Description
A American Express
D Discover
M MasterCard
V VISA
Cash Cash
Checks Check
CFN Commercial Fueling Network
CleanEnergy Clean Energy
Comdata Comdata
EFS EFS
FleetOne Fleet One
FuelMan Fuelman
GasCard GASCARD
PHH PHH
PacificPride Pacific Pride
Speedway Speedway
Tchek T-Chek T-Card
TCH TCH
Trillium Trillium
Voyager Voyager
Wright_Exp WEX
owner_type_code
Type: string

The type of organization that owns the fueling infrastructure. Owner types are given as code values as described below:

Option Description
P Privately owned
T Utility owned
FG Federal government owned
LG Local government owned
SG State government owned
J Jointly owned (combination of owner types)
federal_agency
Type: record
If the station is owned by a federal agency, a record for the federal agency that owns this station. See federal agency record fields for response details.
bd_blends
Type: string
For biodiesel stations, the level of biodiesel blends the station provides.
e85_blender_pump
Type: boolean

For E85 stations, an indication of whether the station has a blender pump on site, given as a boolean:

Value Description
true In addition to E85, the station has a blender pump capable of providing mid-level ethanol blends.
false The station does not have a blender pump.
lpg_primary
Type: boolean

For propane stations, the type of station, given as a boolean:

Value Description
true Primary: A propane station is considered primary because it meets the following criteria, developed based on feedback from the propane industry:
  1. The station is staffed and able to fuel vehicles during normal business hours (e.g., 8am-5pm M-F), and does not require drivers to call ahead;
  2. The station is equipped with a dedicated or purpose-built fuel dispenser for vehicle fueling; and
  3. The station accepts credit cards or fleet cards.
false Secondary: The station does not meet the criteria to be considered primary.
ng_fill_type_code
Type: string

For CNG stations, the type of dispensing capability available, given as code values as described below:

Value Description
Q Quick fill
T Timed fill
B Both: quick fill and timed fill
ng_psi
Type: string
For CNG stations, a space separated list of PSI pressures available.
ng_vehicle_class
Type: string

For CNG and LNG stations, the maximum vehicle size that can physically access the fueling infrastructure, given as code values as described below:

Value Description
LD Station can only accommodate light-duty vehicles (Classes 1-2).
MD Station can accommodate light- and medium-duty vehicles (Classes 1-5).
HD Station can accommodate light-, medium-, and heavy-duty vehicles (Classes 1-8).

Note: This field does not take into account station capacity or other considerations.

ev_level1_evse_num
Type: integer
For electric stations, the number of Level 1 EVSE (standard 110V outlet).
ev_level2_evse_num
Type: integer
For electric stations, the number of Level 2 EVSE (J1772 connector).
ev_dc_fast_num
Type: integer
For electric stations, the number of DC Fast Chargers.
ev_other_evse
Type: string
For electric stations, the number and type of additional EVSE, such as:
  • SP Inductive - Small paddle inductive
  • LP Inductive - Large paddle inductive
  • Avcon Conductive
ev_connector_types
Type: array

For electric stations, an array of strings identifying the connector types available at this station. Valid connector types are:

Value Description
NEMA515 NEMA 5-15 (Level 1)
NEMA520 NEMA 5-20 (Level 1)
NEMA1450 NEMA 14-50 (Level 1)
J1772 J1772 (Level 2)
CHADEMO CHAdeMO (DC fast charging)
J1772COMBO SAE J1772 Combo (DC fast charging)
TESLA Tesla (DC fast charging and Level 2)
ev_network
Type: string
For electric stations, the name of the EVSE network, if applicable.
ev_network_web
Type: string
For electric stations, the EVSE network Web site, if applicable.
hy_status_link
Type: string
For hydrogen stations, a link to a website that provides up-to-date information about the current status of this hydrogen station.
geocode_status
Type: string

A rating indicating the approximate accuracy of the latitude and longitude for the station's address, given as code values as described below:

Value Description
GPS The location is from a real GPS readout at the station.
200-9 Premise (building name, property name, shopping center, etc.) level accuracy.
200-8 Address level accuracy.
200-7 Intersection level accuracy.
200-6 Street level accuracy.
200-5 ZIP code (postal code) level accuracy.
200-4 Town (city, village) level accuracy.
200-3 Sub-region (county, municipality, etc.) level accuracy.
200-2 Region (state, province, prefecture, etc.) level accuracy.
200-1 Country level accuracy.
200-0 Unknown accuracy.
latitude
Type: decimal
Range: -90 to 90
The latitude of the station's address (see the "Geocode Status" field for details on the latitude's accuracy).
longitude
Type: decimal
Range: -180 to 180
The longitude of the station's address (see the "Geocode Status" field for details on the longitude's accuracy).
open_date
Type: date
The date that the station began offering the fuel. Please note that most LPG (propane) stations do not have open dates. Some open dates are approximate. Also note that electric station records that are imported to the Station Locator on a daily basis through a network API do not have open dates. See the About the Alternative Fueling Station Data page for more information.
date_last_confirmed
Type: date
The date the station's details were last confirmed.
updated_at
Type: datetime
The time the station's details were last updated (ISO 8601 format).
id
Type: integer
A unique identifier for this specific station.
distance
Type: decimal
The distance, in miles, from the given location and this station.

Federal Agency Record Fields

Field Value Description
id
Type: integer
A unique identifier for the federal agency.
name
Type: string
The name of the federal agency.

Precision Record Fields

Field Value Description
name
Type: string
A textual code for the accuracy of the geocoded location.
value
Type: integer
A numeric code for the accuracy of the geocoded location. These generally match the Google Geocoding API V2 accuracy values.
types
Type: array
An array of strings describing the type of location matched. These refer to the Google Geocoding API V3 address component types.

Examples

JSON Output Format

GET /api/alt-fuel-stations/v1/nearest.json?api_key=DEMO_KEY&location=1617+Cole+Blvd+Golden+CO&fuel_type=ELEC&limit=1
{
  "fuel_stations": [
    {
      "access_days_time": null,
      "bd_blends": null,
      "cards_accepted": null,
      "city": "Golden",
      "date_last_confirmed": "2012-12-31",
      "expected_date": null,
      "fuel_type_code": "ELEC",
      "geocode_status": "200-8",
      "groups_with_access_code": "Private access only",
      "hy_status_link": null,
      "intersection_directions": "Building 17",
      "latitude": 39.7408399,
      "longitude": -105.1685277,
      "open_date": "2011-05-20",
      "owner_type_code": "FG",
      "plus4": null,
      "station_name": "National Renewable Energy Laboratory - Denver West",
      "station_phone": null,
      "status_code": "E",
      "street_address": "15013 Denver West Pkwy",
      "zip": "80401",
      "state": "CO",
      "ng_fill_type_code": null,
      "ng_psi": null,
      "ng_vehicle_class": null,
      "e85_blender_pump": null,
      "ev_level1_evse_num": null,
      "ev_level2_evse_num": 38,
      "ev_dc_fast_num": null,
      "ev_other_evse": null,
      "ev_network": null,
      "ev_network_web": null,
      "lpg_primary": null,
      "id": 39534,
      "updated_at": "2013-01-16T16:09:02Z",
      "distance": 0.92673,
      "federal_agency": {
        "id": 8,
        "name": "U.S. Department of Energy"
      }
    }
  ],
  "latitude": 39.744696,
  "longitude": -105.15186,
  "offset": 0,
  "precision": {
    "name": "address",
    "types": [
      "street_address"
    ],
    "value": 8
  },
  "station_locator_url": "http://www.afdc.energy.gov/afdc/locator/stations/",
  "total_results": 12
}

XML Output Format

GET /api/alt-fuel-stations/v1/nearest.xml?api_key=DEMO_KEY&location=1617+Cole+Blvd+Golden+CO&fuel_type=ELEC&limit=1
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <latitude>39.744696</latitude>
  <longitude>-105.15186</longitude>
  <precision>
    <name>address</name>
    <types type="array">
      <type>street_address</type>
    </types>
    <value type="integer">8</value>
  </precision>
  <station-locator-url>http://www.afdc.energy.gov/afdc/locator/stations/</station-locator-url>
  <total-results>12</total-results>
  <offset>0</offset>
  <fuel-stations type="array">
    <fuel-station>
      <access-days-time nil="true"/>
      <bd-blends nil="true"/>
      <cards-accepted nil="true"/>
      <city>Golden</city>
      <date-last-confirmed>2012-12-31</date-last-confirmed>
      <expected-date nil="true"/>
      <fuel-type-code>ELEC</fuel-type-code>
      <geocode-status>200-8</geocode-status>
      <groups-with-access-code>Private access only</groups-with-access-code>
      <hy-status-link nil="true"/>
      <intersection-directions>Building 17</intersection-directions>
      <latitude>39.7408399</latitude>
      <longitude>-105.1685277</longitude>
      <open-date>2011-05-20</open-date>
      <owner-type-code>FG</owner-type-code>
      <plus4 nil="true"/>
      <station-name>National Renewable Energy Laboratory - Denver West</station-name>
      <station-phone nil="true"/>
      <status-code>E</status-code>
      <street-address>15013 Denver West Pkwy</street-address>
      <zip>80401</zip>
      <state>CO</state>
      <ng-fill-type-code nil="true"/>
      <ng-psi nil="true"/>
      <ng-vehicle-class nil="true"/>
      <e85-blender-pump nil="true"/>
      <ev-level1-evse-num nil="true"/>
      <ev-level2-evse-num>38</ev-level2-evse-num>
      <ev-dc-fast-num nil="true"/>
      <ev-other-evse nil="true"/>
      <ev-network nil="true"/>
      <ev-network-web nil="true"/>
      <lpg-primary nil="true"/>
      <id>39534</id>
      <updated-at>2013-01-16T16:09:02Z</updated-at>
      <distance>0.92673</distance>
      <federal-agency>
        <id type="integer">8</id>
        <name>U.S. Department of Energy</name>
      </federal-agency>
    </fuel-station>
  </fuel-stations>
</response>

CSV Output Format

GET /api/alt-fuel-stations/v1/nearest.csv?api_key=DEMO_KEY&location=1617+Cole+Blvd+Golden+CO&fuel_type=ELEC&limit=1
Fuel Type Code,Station Name,Street Address,Intersection Directions,City,State,ZIP,Plus4,Station Phone,Status Code,Expected Date,Groups With Access Code,Access Days Time,Cards Accepted,BD Blends,NG Fill Type Code,NG PSI,EV Level1 EVSE Num,EV Level2 EVSE Num,EV DC Fast Count,EV Other Info,EV Network,EV Network Web,Geocode Status,Latitude,Longitude,Date Last Confirmed,ID,Distance,Updated At,Owner Type Code,Federal Agency ID,Federal Agency Name,Open Date,Hydrogen Status Link,NG Vehicle Class,LPG Primary,E85 Blender Pump
ELEC,National Renewable Energy Laboratory - Denver West,15013 Denver West Pkwy,Building 17,Golden,CO,80401,,,E,,Private access only,,,,,,,38,,,,,200-8,39.7408399,-105.1685277,2012-12-31,39534,0.92673,2013-01-16 16:09:02 UTC,FG,8,U.S. Department of Energy,2011-05-20,,,,

Rate Limits

Standard rate limits apply. No more than 1,000 requests may be made in any hour

Errors

Standard errors may be returned. In addition, the following service-specific errors may be returned:

HTTP Status Code Description
422 Unprocessable Entity - An invalid value was given for a query parameter. The response body will describe the specific error.
Help Improve this Content