This tutorial explains how to construct a request for the EV Smart Routing API that includes charging station filters (csfs). Filters allow you to restrict or prioritize which charging stations are considered during route planning.
A request including charging station filters looks like this:
{
"geoserver": "osm",
"csps": ["ecoMovement"],
"csfs": [
"chargingPoint.nominalPower >= 50",
"pool.brand != Electra"
],
"vehicle": {
"initBatLvl": 100,
"key": "eb1e9464-8654-4c01-bedd-b2f95412a60d",
"payload": 75
},
"start": {
"lon": 2.34755,
"lat": 48.85708
},
"stop": {
"lon": 4.35497,
"lat": 50.83857
},
"condition": {
"chargePluggingTime": 300
},
"routingVehicleProfile": {
"transportMode": "CAR"
}
}The csfs parameter is an array of string filters. Each filter follows the syntax:
CLASS.FIELD OPERATOR VALUE- CLASS β
pool,station,chargingPoint,vehicleAccess - FIELD β a supported field (e.g.
brand,nominalPower,creditCardPayment) - OPERATOR β
==,!=,>=,/=/(regex), β¦ - VALUE β the value to compare against π Multiple filters can be listed in the array. π Use
||for OR conditions between filters.
β Example: Keep only fast charging stations
"csfs": [
"chargingPoint.nominalPower >= 50"
]β‘οΈ Keeps only stations with at least 50 kW.
β Example: Prefer IONITY or Tesla stations
"csfs": [
"pool.brand /= /IONITY|TESLA/"
]β‘οΈ Prioritizes stations operated by IONITY or Tesla.
β Example: Exclude a specific brand
"csfs": [
"pool.brand != Electra"
]β‘οΈ Excludes stations operated by Electra.
β Example: Select stations based on the total number of charging points available in the pool.
"csfs": [
"pool.numberOfChargingPoint >= 4"
]β‘οΈ Keeps only pools that have at least 4 charging points.
β Example: Keep only charging stations currently reported as available
"csfs": [
"station.available == true"
]β‘οΈ Excludes stations flagged as unavailable.
β Example: Filter charging points by the supported billing currency.
"csfs": [
"chargingPoint.currency IN EUR;GBP;DKK"
]β‘οΈ Keeps only charging points that accept EUR, GBP, or DKK.
Besides simple filters, you can also define actions that are executed when a condition is matched.
The syntax is:
Multiple actions can be chained with ->.
The prefCoeff (preference coefficient) is used to prioritize or deprioritize charging stations when a filter matches.
It does not exclude stations but adjusts their weight in the selection process.
- Neutral value:
1.0β default, no preference. - Preferred:
]1.0, 10.0]β increases priority.- Example:
prefCoeff=5.0;β station is 5x more likely to be chosen.
- Example:
- Avoided:
[0.1, 1.0[β decreases priority.- Example:
prefCoeff=0.5;β station is half as likely to be chosen.
- Example:
- Bounds:
- Minimum:
0.1(cannot be 0 or negative). - Maximum:
10.0.
- Minimum:
β
Use prefCoeff > 1 to encourage preferred partners/networks.
β Use prefCoeff < 1 to discourage costly or unwanted stations.
π Quick reference
| Value | Meaning | Example usage |
|---|---|---|
1.0 | Neutral (default, no preference) | No preference |
0.5 | Avoid (half as likely) | Discourage expensive networks |
0.1 | Strongly avoid (minimum) | Last resort only |
2.0 | Prefer (2x more likely) | Encourage trusted partners |
5.0 | Strong preference | Prioritize IONITY or Tesla |
10.0 | Maximum preference (cap) | Force ultra-fast chargers |
"csfs": [
"pool.brand == IONITY -> prefCoeff=5.0;"
]β‘οΈ In this case, IONITY stations are prioritized.
Another combined example:
"csfs": [
"chargingPoint.nominalPower >= 7",
"chargingPoint.nominalPower >= 50 -> prefCoeff=6.0;",
"pool.brand == IONITY -> prefCoeff=5.0;",
"pool.brand == TESLA -> prefCoeff=5.0;",
"chargingPoint.currency IN EUR;GBP;DKK -> prefCoeff=3.0;"
]β‘οΈ This keeps only charging points with β₯7 kW, prefers fast chargers (β₯50 kW), gives higher priority to IONITY and TESLA networks, and favors charging points that accept EUR, GBP, or DKK currencies.
Full Example with prefCoeff
{
"geoserver": "osm",
"csps": [
"ecoMovement"
],
"csfs": [
"chargingPoint.nominalPower >= 50",
"pool.brand /= /Electra/-> prefCoeff=9.0;"
],
"vehicle": {
"initBatLvl": 40,
"key": "4d4f1d56-5014-4840-b5cf-7c42aad2d309",
"payload": 75
},
"start": {
"lon": 7.23521295426402,
"lat": 44.0040293
},
"stop": {
"lon": -4.48656,
"lat": 48.39043
},
"condition": {
"minBatLvl": 10,
"minArrivalBatLvl": 15,
"temperature": 20,
"currency": "EUR",
"encodedGeometry": true,
"departureTime": 1758877080000,
"chargePluggingTime": 300,
"allowNaStatus": true
}
}"vehicle": {
"initBatLvl": 100,
"key": "d729502b-12ba-4adb-89bd-cff6a2d00919",
"payload": 75
}"start": {
"lon": 7.27768,
"lat": 43.70032
},
"stop": {
"lon": 1.44863,
"lat": 43.60579
}"condition": {
"minBatLvl": 10,
"minArrivalBatLvl": 15,
"chargePluggingTime": 300
}"routingVehicleProfile": {
"transportMode": "CAR"
}{
"geoserver": "osm",
"csps": ["ecoMovement"],
"csfs": [
"chargingPoint.nominalPower >= 50",
"pool.brand /= /IONITY/"
],
"vehicle": {
"initBatLvl": 100,
"key": "d729502b-12ba-4adb-89bd-cff6a2d00919",
"payload": 75
},
"start": {
"lon": 7.27768,
"lat": 43.70032
},
"stop": {
"lon": 1.44863,
"lat": 43.60579
},
"condition": {
"minBatLvl": 10,
"minArrivalBatLvl": 15,
"temperature": 20,
"chargePluggingTime": 300
},
"routingVehicleProfile": {
"transportMode": "CAR"
}
}