Find electric vehicle charging with Iggy.

Joshua Matfess
Iggy Tech
Published in
2 min readAug 3, 2021

Volkswagen projects that by 2030 half of its sales in the U.S. will be electric vehicles. Unfortunately, not all regions have access to public charging stations, which could greatly affect your ability to travel if you own or plan to own an electric vehicle.

Public DC fast charging stations in the continental U.S. Data from The National Renewable Energy Laboratory (NREL), map layer courtesy of OpenStreetMap.

So whether you‘re planning to buy a new home, want to help your customers plan a road trip, or are looking to highlight amenities near your businesses or rental properties, you’ll need to access to data about nearby vehicle charging infrastructure.

Just Ask Iggy.

Using Ask Iggy’s self-serve APIs, finding charging stations near a list of properties, points of interest, or route stops couldn’t be easier. Here’s one way to do it:

First, grab your Iggy API token by signing up here and then store it as an environment variable on your computer by adding the following line to your bash profile (~/.bash_profile) to set it permanently, or just run the command in your terminal to set it temporarily, substituting in your API token.

export IGGY_API_TOKEN="your_token_here"

Next, open up a Python script or Jupyter notebook and get started with the basics.

import json
import os
import requests
api_token = os.getenv("IGGY_API_TOKEN")

Now add your location list.

locations = [
{"name": "Frisco, TX", "latitude": 33.143772, "longitude": -96.790743},
{"name": "Goodyear, AZ", "latitude": 33.432501, "longitude": -112.403174},
{"name": "Durham, NC", "latitude": 36.014183, "longitude": -78.924521}
]

Since we’re interested in finding nearby charging stations, we can query Iggy’s electric vehicle charging station dataset, sourced from The National Renewable Energy Laboratory (NREL), using this URL:

dataset = "nrel_ev_stations"
url = f"https://api.askiggy.com/properties/v1/datasets/{dataset}/select/buffered-point"

And, finally, to enrich your list of locations, you can make simple API requests to that URL, passing in each location’s latitude and longitude as query parameters.

for i, location in enumerate(locations):
response = requests.request(
"GET",
url,
params={
"latitude": location["latitude"],
"longitude": location["longitude"],
"radius": 10000,
"limit": 10
},
headers={
"X-Iggy-Token": api_token,
"Accept": "application/json"
},
)
json_data = json.loads(response.text)
locations[i]["ev_stations"] = json_data["data"]

Each of these requests will fetch up to 10 (limit) charging stations within 10 kilometers (radius) of the location. This is just one example. If you’re building an application, you can use Iggy to pull in charging stations on the fly.

The best part is that with Iggy, you’re not limited to a single dataset. You can use this exact same technique to further enrich your location data with points of interest, travel and leisure locations, and so much more using any of the datasets available in our growing catalog.

Want to know more?

Grab your API token to get started, check out our API reference, and read through our other code samples for some inspiration.

--

--