OCPI 2.2.1 · 2.1.1
Explorer Console /versions PT/EN

Documentation · updated November 3, 2026

TriCharge OCPI API

Open data on the TriCharge network in the OCPI standard: where the charging stations are, which connectors they have, how much charging costs and whether each plug is free right now. Public read access, no sign-up.

Versions URL
https://ocpi.tricharge.com.br/ocpi/versions
Versions
2.2.1 (recommended) · 2.1.1
Role
CPO · party BR*TRC · SENDER modules
Modules
locations · tariffs · credentials
Access
public, no token (60 req/min per IP), or partner token
Format
JSON UTF-8 · OCPI envelope · UTC timestamps (RFC 3339)
Scope
read-only — nothing here starts or stops a charging session

The network right now

Read live from this same API, no token.

curl https://ocpi.tricharge.com.br/ocpi/2.2.1/locations

Quick start

No account and no token needed. The examples below download every location and count the free plugs.

# Every location in one page (limit up to 1000)
curl -s "https://ocpi.tricharge.com.br/ocpi/2.2.1/locations?limit=1000" | jq '.data | length'

# One location (id = TriCharge station number)
curl -s https://ocpi.tricharge.com.br/ocpi/2.2.1/locations/1 | jq '.data.evses[] | {evse_id, status}'

# Tariffs
curl -s "https://ocpi.tricharge.com.br/ocpi/2.2.1/tariffs?limit=1000" | jq '.data[0]'
// Works straight from the browser (CORS is open) or in Node 18+.
const BASE = "https://ocpi.tricharge.com.br/ocpi/2.2.1";

async function all(path) {
  const out = [];
  let url = `${BASE}/${path}?limit=1000`;
  while (url) {
    const r = await fetch(url);
    if (r.status === 429) {                      // honour Retry-After
      await new Promise(ok => setTimeout(ok, 1000 * (+r.headers.get("Retry-After") || 30)));
      continue;
    }
    const body = await r.json();
    if (body.status_code !== 1000) throw new Error(body.status_message);
    out.push(...body.data);
    const next = (r.headers.get("Link") || "").match(/<([^>]+)>;\s*rel="next"/);
    url = next ? next[1] : null;
  }
  return out;
}

const locations = await all("locations");
const evses = locations.flatMap(l => l.evses);
console.log(`${locations.length} locations, ${evses.filter(e => e.status === "AVAILABLE").length} free plugs`);
import time, requests

BASE = "https://ocpi.tricharge.com.br/ocpi/2.2.1"

def all_pages(path):
    url, out = f"{BASE}/{path}?limit=1000", []
    while url:
        r = requests.get(url, timeout=30)
        if r.status_code == 429:                       # honour Retry-After
            time.sleep(int(r.headers.get("Retry-After", 30)))
            continue
        body = r.json()
        if body["status_code"] != 1000:
            raise RuntimeError(body.get("status_message"))
        out += body["data"]
        url = r.links.get("next", {}).get("url")       # Link header
    return out

locations = all_pages("locations")
tariffs = {t["id"]: t for t in all_pages("tariffs")}

for loc in locations:
    free = sum(e["status"] == "AVAILABLE" for e in loc["evses"])
    price = tariffs[loc["id"]]["tariff_alt_text"][0]["text"]
    print(f'{loc["name"][:32]:32} {loc["city"]:18} {free}/{len(loc["evses"])} free  {price}')
<?php
$base = 'https://ocpi.tricharge.com.br/ocpi/2.2.1';

function ocpiAll(string $url): array {
    $out = [];
    while ($url) {
        $hdr = [];
        $ch = curl_init($url);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT        => 30,
            CURLOPT_HEADERFUNCTION => function ($c, $line) use (&$hdr) {
                if (strpos($line, ':')) { [$k, $v] = explode(':', $line, 2); $hdr[strtolower(trim($k))] = trim($v); }
                return strlen($line);
            },
        ]);
        $body = json_decode(curl_exec($ch), true);
        $code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
        if ($code === 429) { sleep((int)($hdr['retry-after'] ?? 30)); continue; }
        if (($body['status_code'] ?? 0) !== 1000) throw new RuntimeException($body['status_message'] ?? "HTTP $code");
        $out = array_merge($out, $body['data']);
        $url = preg_match('/<([^>]+)>;\s*rel="next"/', $hdr['link'] ?? '', $m) ? $m[1] : null;
    }
    return $out;
}

$locations = ocpiAll("$base/locations?limit=1000");
printf("%d published locations\n", count($locations));

Public vs. partner access

Both modes return the same data. The difference is identification and what you can do besides reading.

PublicPartner (OCPI token)
Formaps, apps, research, anyone curiousroaming platforms / eMSPs that run the OCPI handshake
HowGET with no Authorization headerAuthorization: Token <token>
Endpoints/versions, /{version}, locations, tariffsthe same + credentials (registration)
Limit60 requests/min per IPno fixed limit (fair use: poll every ≥ 30 s)
CORSopen (*)open (*)
Supportbest effortdirect contact, advance notice of changes
An invalid token does not fall back to public

If you send an Authorization header, it must be valid. A wrong or revoked token returns 401 — the API does not silently switch to public mode, so you notice when your credential stops working.

To become a partner, write to [email protected] with your platform name and your Versions URL. You will receive a Token A and follow the handshake below.

OCPI handshake (partners)

This is the standard registration of the credentials module. It is only needed by platforms that want their own credential; read-only users can skip this section.

  1. TriCharge sends you Token A and the Versions URL https://ocpi.tricharge.com.br/ocpi/versions. We only store a hash of the token: if you lose it, we issue a new one.
  2. You discover the endpoints with Token A: GET /versions, then GET /2.2.1.
  3. You register with POST /2.2.1/credentials, sending your Token B, your Versions URL and your roles.
  4. The response contains Token C. Use it for every call from then on. To rotate Token C, call PUT /credentials; to unregister, DELETE /credentials.
Token encoding

OCPI 2.2.x sends the token Base64-encoded (Token base64(token)); 2.1.1 sends it raw. We accept both forms in any version.

No push

We store your Token B and URL, but we never call your platform: there are no PUT/PATCH calls to your locations receiver. The integration is pull only (see incremental sync).

Reference

Every route accepts the /ocpi prefix (https://ocpi.tricharge.com.br/ocpi). For convenience, /ocpi/locations and /ocpi/tariffs without a version respond as 2.2.1.

GET/ocpi/versionspublic

Lists the supported OCPI versions and the URL of each. It is the entry point for any OCPI client.

{
    "data": [
        {
            "version": "2.2.1",
            "url": "https://ocpi.tricharge.com.br/ocpi/2.2.1"
        },
        {
            "version": "2.1.1",
            "url": "https://ocpi.tricharge.com.br/ocpi/2.1.1"
        }
    ],
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}
GET/ocpi/{version}public

Modules available in the version. In 2.2.1 every module has role: SENDER; in 2.1.1 the field does not exist.

{version}: 2.2.1 or 2.1.1. Any other version returns 404.

{
    "data": {
        "version": "2.2.1",
        "endpoints": [
            {
                "identifier": "credentials",
                "role": "SENDER",
                "url": "https://ocpi.tricharge.com.br/ocpi/2.2.1/credentials"
            },
            {
                "identifier": "locations",
                "role": "SENDER",
                "url": "https://ocpi.tricharge.com.br/ocpi/2.2.1/locations"
            },
            {
                "identifier": "tariffs",
                "role": "SENDER",
                "url": "https://ocpi.tricharge.com.br/ocpi/2.2.1/tariffs"
            }
        ]
    },
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}
GET/ocpi/{version}/locationspublic

Paginated list of Locations, each with its EVSEs and connectors embedded. Order: ascending last_updated, then id.

Query parameters

NameTypeDescription
offsetintStart position. Default 0.
limitintItems per page. Default 100, max 1000.
date_fromRFC 3339Only objects with last_updated >= this instant.
date_toRFC 3339Only objects with last_updated < this instant.

Response headers

X-Total-Count (total after the date filter), X-Limit (limit applied) and Link: <…>; rel="next" when there is a next page.

{
    "data": [
        {
            "country_code": "BR",
            "party_id": "TRC",
            "id": "1",
            "publish": true,
            "name": "Viguine Multimarcas",
            "address": "Avenida Ferreira Viana",
            "city": "Pelotas",
            "postal_code": "96085-000",
            "state": "RS",
            "country": "BRA",
            "coordinates": {
                "latitude": "-31.759646",
                "longitude": "-52.320426"
            },
            "evses": [
                {
                    "uid": "1-1",
                    "evse_id": "BR*TRC*E1*1",
                    "status": "AVAILABLE",
                    "capabilities": [],
                    "connectors": [
                        {
                            "id": "1",
                            "standard": "IEC_62196_T2_COMBO",
                            "format": "CABLE",
                            "power_type": "DC",
                            "max_voltage": 1000,
                            "max_amperage": 200,
                            "max_electric_power": 80000,
                            "tariff_ids": [
                                "1"
                            ],
                            "last_updated": "2026-10-10T02:11:42Z"
                        }
                    ],
                    "physical_reference": "Plug A",
                    "coordinates": {
                        "latitude": "-31.759646",
                        "longitude": "-52.320426"
                    },
                    "last_updated": "2026-11-03T14:48:38Z"
                },
                {
                    "uid": "1-2",
                    "evse_id": "BR*TRC*E1*2",
                    "status": "CHARGING",
                    "capabilities": [],
                    "connectors": [
                        {
                            "id": "1",
                            "standard": "IEC_62196_T2_COMBO",
                            "format": "CABLE",
                            "power_type": "DC",
                            "max_voltage": 1000,
                            "max_amperage": 200,
                            "max_electric_power": 80000,
                            "tariff_ids": [
                                "1"
                            ],
                            "last_updated": "2026-10-10T02:11:42Z"
                        }
                    ],
                    "physical_reference": "Plug B",
                    "coordinates": {
                        "latitude": "-31.759646",
                        "longitude": "-52.320426"
                    },
                    "last_updated": "2026-11-03T15:00:50Z"
                }
            ],
            "operator": {
                "name": "TriCharge",
                "website": "https://tricharge.com.br"
            },
            "time_zone": "America/Sao_Paulo",
            "opening_times": {
                "twentyfourseven": true
            },
            "directions": [
                {
                    "language": "pt",
                    "text": "24/7"
                }
            ],
            "images": [
                {
                    "url": "https://images.tiny-lk.com/uploads/image_68f834b50c7bb4.99942916.webp",
                    "category": "LOCATION",
                    "type": "webp"
                }
            ],
            "last_updated": "2026-11-03T15:00:50Z"
        }
    ],
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}
GET/ocpi/{version}/locations/{location_id}public

One Location by id. The id is the TriCharge station number — the same as in pay.tricharge.com.br/station/{id} and in the QR code on the charger.

Unknown or unpublished location: 404 with status_code 2003.

curl -s https://ocpi.tricharge.com.br/ocpi/2.2.1/locations/1
GET/ocpi/{version}/locations/{location_id}/{evse_uid}[/{connector_id}]public

One EVSE (plug) or one specific connector. The cheapest way to follow the status of a single plug.

evse_uid has the form {location_id}-{n} (e.g. 1-2). Each EVSE has a single connector with id 1.

{
    "data": {
        "uid": "1-1",
        "evse_id": "BR*TRC*E1*1",
        "status": "AVAILABLE",
        "capabilities": [],
        "connectors": [
            {
                "id": "1",
                "standard": "IEC_62196_T2_COMBO",
                "format": "CABLE",
                "power_type": "DC",
                "max_voltage": 1000,
                "max_amperage": 200,
                "max_electric_power": 80000,
                "tariff_ids": [
                    "1"
                ],
                "last_updated": "2026-10-10T02:11:42Z"
            }
        ],
        "physical_reference": "Plug A",
        "coordinates": {
            "latitude": "-31.759646",
            "longitude": "-52.320426"
        },
        "last_updated": "2026-11-03T14:48:38Z"
    },
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}
GET/ocpi/{version}/tariffspublic

Paginated list of Tariffs, one per station (tariff.id = location.id). Same parameters and headers as locations.

There is no single-tariff route (the OCPI tariffs module defines no GET by id for the SENDER role). Filter the list by id, or use connector.tariff_ids.

{
    "data": [
        {
            "country_code": "BR",
            "party_id": "TRC",
            "id": "2",
            "currency": "BRL",
            "type": "AD_HOC_PAYMENT",
            "tariff_alt_text": [
                {
                    "language": "pt",
                    "text": "PIX R$ 1,78/kWh · Cartão R$ 1,88/kWh · Taxa de ativação R$ 2,00 · Preço varia por horário"
                }
            ],
            "tariff_alt_url": "https://pay.tricharge.com.br/station/2",
            "elements": [
                {
                    "price_components": [
                        {
                            "type": "FLAT",
                            "price": 2,
                            "step_size": 1
                        }
                    ]
                },
                {
                    "price_components": [
                        {
                            "type": "ENERGY",
                            "price": 2,
                            "step_size": 1
                        }
                    ],
                    "restrictions": {
                        "start_time": "18:00",
                        "end_time": "21:00",
                        "day_of_week": [
                            "TUESDAY",
                            "WEDNESDAY",
                            "THURSDAY",
                            "FRIDAY"
                        ]
                    }
                },
                {
                    "price_components": [
                        {
                            "type": "ENERGY",
                            "price": 1.39,
                            "step_size": 1
                        }
                    ],
                    "restrictions": {
                        "start_time": "00:00",
                        "end_time": "07:00"
                    }
                },
                {
                    "price_components": [
                        {
                            "type": "ENERGY",
                            "price": 1.78,
                            "step_size": 1
                        }
                    ]
                }
            ],
            "last_updated": "2026-10-10T02:11:42Z"
        }
    ],
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}
POST/ocpi/{version}/credentialstoken

Partner handshake (see the flow). Requires Authorization: Token ….

MethodTokenEffect
GETA or CReturns our credentials (with the token you used).
POSTARegisters and returns Token C. With Token C: 405 (use PUT).
PUTCUpdates Token B/URL and issues a new Token C. Not registered: 405.
DELETECUnregisters (back to pending; Token A remains valid).

Required body for POST/PUT: token (up to 255 characters) and url (http/https, up to 500). Missing: 400 / 2001. In 2.1.1 the body carries party_id, country_code and business_details at the top level instead of roles.

curl -X POST https://ocpi.tricharge.com.br/ocpi/2.2.1/credentials \
  -H "Authorization: Token $(printf %s "$TOKEN_A" | base64)" \
  -H "Content-Type: application/json" \
  -d @registration.json
{
    "token": "TOKEN-B-QUE-VOCE-GEROU",
    "url": "https://sua-plataforma.com/ocpi/versions",
    "roles": [
        {
            "role": "EMSP",
            "party_id": "XYZ",
            "country_code": "BR",
            "business_details": {
                "name": "Sua Plataforma"
            }
        }
    ]
}
{
    "data": {
        "token": "9f2c…(Token C, 48 hex)…41ab",
        "url": "https://ocpi.tricharge.com.br/ocpi/versions",
        "roles": [
            {
                "role": "CPO",
                "party_id": "TRC",
                "country_code": "BR",
                "business_details": {
                    "name": "TriCharge",
                    "website": "https://tricharge.com.br"
                }
            }
        ]
    },
    "status_code": 1000,
    "timestamp": "2026-11-03T15:02:11Z"
}

Identifiers

ObjectFieldFormatExampleNotes
Partycountry_code / party_idBR / TRCBR*TRCFixed, also for stations in Paraguay.
LocationidTriCharge station id"1"Stable. Maps to pay.tricharge.com.br/station/1.
EVSEuid{location_id}-{n}"1-2"n = connector number on the charger (OCPP connectorId).
EVSEevse_id{BR|PY}*TRC*E{location_id}*{n}BR*TRC*E1*2eMI3 format. Prefix is the country where the plug is.
Connectorid"1""1"One connector per EVSE.
Tariffidstation id"1"One tariff per station, referenced in connector.tariff_ids.

physical_reference is the plug label as shown on the payment screen (e.g. Plug A, Esquerdo), up to 16 characters.

Location

FieldAlways?Source and rule
nameyesStation name as registered.
addressyesStreet obtained by reverse geocoding the coordinates (OpenStreetMap). Without a street, falls back to the city.
city / statecity yesFrom the registration (City/State). state is the two-letter Brazilian state code when known; city may be "-" if the registration has no city.
postal_codenoPostal code (CEP) from geocoding, when available.
countryyesISO 3166-1 alpha-3: BRA or PRY.
coordinatesyesDecimal strings with 6 places (OCPI standard), WGS 84.
time_zoneyesAmerica/Sao_Paulo or America/Asuncion.
opening_timesnoWe only publish twentyfourseven: true when the operator declared 24h. When absent we don't know the hours — don't assume closed.
directionsnoFree-text availability provided by the operator (e.g. “Seg a Sáb 8h–18h”), in pt or es.
imagesnoStation photo, category LOCATION, https URLs only.
operatoryesTriCharge (the platform). The site owner may be a different company.
publishyesAlways true: we only list what is public.
evsesyesAt least one. Plugs hidden by the operator are not listed.

We do not publish parking_type, facilities, related_locations or energy_mix.

Language of free text

Names, addresses, directions and tariff_alt_text come from the operators and are in Portuguese (Brazil) or Spanish (Paraguay). Field names and enum values are standard OCPI.

EVSE and Connector

Each physical plug is an EVSE with a single Connector. capabilities is empty: payment happens through the station QR code / link, not through RFID cards or roaming apps.

Registered typestandardformatpower_type
CCS / CCS2IEC_62196_T2_COMBOCABLEDC
GB/TGBT_DCCABLEDC
Type 2 (AC) up to 7.4 kWIEC_62196_T2SOCKETAC_1_PHASE
Type 2 (AC) above 7.4 kWIEC_62196_T2SOCKETAC_3_PHASE
Which number to use

max_electric_power (in watts) is the real registered value — use it to display power. max_voltage and max_amperage are nominal values derived from the power (DC: 1000 V and the current for a 400 V battery; AC: 230 V), because voltage and current are not registered.

EVSE status

Derived from the last OCPP StatusNotification of each connector, combined with the charger's connection state and with open charging sessions.

OCPIWhenHow to display
AVAILABLEAvailable with no open sessionFree to use.
CHARGINGPreparing, Charging, SuspendedEV, SuspendedEVSE, Finishing, Occupied — or Available while a session is still openOccupied. Includes a car plugged in waiting to start and a session paused by the car.
RESERVEDReservedReserved at the charger.
INOPERATIVEUnavailable, or plug flagged as under maintenance by the operatorOut of service, planned.
OUTOFORDERFaultedFault reported by the charger.
UNKNOWNcharger has not communicated for more than 15 min, or no StatusNotification yetWe don't know. Show it as “no information”, not as occupied.

We do not use BLOCKED, PLANNED or REMOVED. A station that leaves the catalogue simply stops being listed — see how to detect removals.

Tariff

The published tariff is the consumer price when paying by PIX (the station's reference price), taxes included. type is always AD_HOC_PAYMENT: pay on the spot, no contract. currency is BRL or PYG (guaraníes, no decimals).

Element order

  1. Activation fee (optional) — element with only a FLAT component, charged once per session.
  2. Time/day bands (optional) — ENERGY elements with restrictions (start_time, end_time, day_of_week), from highest to lowest priority.
  3. Base price — last element, ENERGY with no restriction.

Per the OCPI rule, the first element whose restrictions match applies for each component type — exactly the priority rule used at checkout. ENERGY price is per kWh and step_size: 1 means billing per Wh. Times are in the Location's time zone.

FieldContent
tariff_alt_textHuman-readable summary: PIX price, card price (if different), activation fee and the “price varies by time” notice. It is the only place where the card price appears.
tariff_alt_urlThe station's payment page, where the driver starts the session.
Indicative price

Coupons, vouchers, ride-hailing driver prices and cashback are not part of the public tariff. The final amount is always the one shown at tariff_alt_url at payment time.

A station is in the catalogue when all of the following hold:

A charger offline for less than 30 days stays listed, with its plugs as UNKNOWN.

Pagination

OCPI offset/limit pagination. Follow the Link header until it disappears; don't build the offset by hand — the link keeps your filters.

$ curl -si "https://ocpi.tricharge.com.br/ocpi/2.2.1/locations?limit=50" | grep -iE '^(x-total|x-limit|link|x-ratelimit)'
X-Total-Count: 164
X-Limit: 50
Link: <https://ocpi.tricharge.com.br/ocpi/2.2.1/locations?limit=50&offset=50>; rel="next"
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59

The whole network fits in one page of 1000: for most clients a single call with ?limit=1000 is enough.

Incremental sync

last_updated only changes when the object's content changes (status, price, name…). Charger heartbeats don't touch it. That lets you ask only for what changed:

  1. The first time, download everything and keep the highest last_updated you saw.
  2. Then, every 1–5 minutes, request ?date_from=<that value> and apply the differences. A status change on a plug updates the EVSE and the Location that contains it.
  3. Once a day, do a full load and delete whatever did not come back: that is how you detect stations removed from the catalogue.
curl -s "https://ocpi.tricharge.com.br/ocpi/2.2.1/locations?date_from=2026-11-03T15:00:00Z&limit=1000"

Freshness and caching

Errors

Every response uses the OCPI envelope. On error there is no data:

{
    "status_code": 2003,
    "timestamp": "2026-11-03T15:02:11Z",
    "status_message": "Unknown location"
}
HTTPstatus_codeWhenWhat to do
2001000Success.—
4002001Invalid date_from/date_to, incomplete credentials body.Fix the parameter.
4012000Missing token on credentials, malformed header (expected Token <token>), invalid or revoked token.Check the credential; for public reads, remove the header.
4042000Unsupported version or module (e.g. sessions, commands).Use only the modules listed in /{version}.
4042003Unknown Location, EVSE or connector.Drop it from your cache; reload the list.
4052000Method not allowed (the API is read-only) or wrong handshake step.See status_message.
4292000Public access rate limit exceeded.Wait Retry-After seconds.
5003000Our fault.Retry with exponential backoff.

Send X-Request-ID and/or X-Correlation-ID (up to 64 characters) and they are echoed back — useful when reporting a problem to us.

Limits and CORS

Differences in 2.1.1

2.1.1 is derived from 2.2.1, with the same data:

What is not available

The API is read-only by design. The sessions, cdrs, tokens, commands, chargingprofiles and hubclientinfo modules do not exist: you cannot start, stop or reserve a charging session here, nor query session history. Charging is always started by the driver at tariff_alt_url.

TriCharge operators who need data about their own network (sessions, revenue, uptime) use the Charging Station API (Portuguese), which is authenticated per account.

Public explorer

The whole network, read right now from this same API with no token (2 requests). Filter and download as CSV or GeoJSON.

Loading…

IDLocationCityPlugsPowerPrice

Console

Build a request and see the raw response, with headers. The token is optional and only used in this browser tab.

Recipe: web map in 30 lines

A static page with Leaflet, no backend. Each marker shows the free plugs and a link to charge.

<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css">
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<div id="map" style="height:100vh"></div>
<script>
const map = L.map("map").setView([-15.8, -50], 4);
L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",
  { attribution: "© OpenStreetMap · Data: TriCharge" }).addTo(map);

const API = "https://ocpi.tricharge.com.br/ocpi/2.2.1";
Promise.all([
  fetch(`${API}/locations?limit=1000`).then(r => r.json()),
  fetch(`${API}/tariffs?limit=1000`).then(r => r.json()),
]).then(([locs, tars]) => {
  const price = Object.fromEntries(tars.data.map(t => [t.id, t.tariff_alt_text[0].text]));
  for (const l of locs.data) {
    const free = l.evses.filter(e => e.status === "AVAILABLE").length;
    const kw = Math.max(...l.evses.map(e => e.connectors[0].max_electric_power)) / 1000;
    L.circleMarker([+l.coordinates.latitude, +l.coordinates.longitude], {
      radius: 7, color: free ? "#0a6a69" : "#8a5a05",
    }).addTo(map).bindPopup(
      `<b>${l.name}</b><br>${l.address}, ${l.city}<br>` +
      `${free}/${l.evses.length} free · up to ${kw} kW<br>${price[l.id] ?? ""}<br>` +
      `<a href="https://pay.tricharge.com.br/station/${l.id}" target="_blank">Charge</a>`);
  }
});
</script>

In production, escape name and address before putting them into the popup HTML.

Recipe: export GeoJSON

import json, requests

API = "https://ocpi.tricharge.com.br/ocpi/2.2.1"
locs = requests.get(f"{API}/locations", params={"limit": 1000}, timeout=30).json()["data"]

features = [{
    "type": "Feature",
    "geometry": {"type": "Point",
                 "coordinates": [float(l["coordinates"]["longitude"]), float(l["coordinates"]["latitude"])]},
    "properties": {
        "id": l["id"], "name": l["name"], "city": l["city"], "state": l.get("state"),
        "plugs": len(l["evses"]),
        "available": sum(e["status"] == "AVAILABLE" for e in l["evses"]),
        "max_kw": max(e["connectors"][0]["max_electric_power"] for e in l["evses"]) / 1000,
        "connectors": sorted({e["connectors"][0]["standard"] for e in l["evses"]}),
        "url": f"https://pay.tricharge.com.br/station/{l['id']}",
    },
} for l in locs]

json.dump({"type": "FeatureCollection", "features": features},
          open("tricharge.geojson", "w"), ensure_ascii=False)

Recipe: free plugs right now

# Free DC plugs right now, with city and power
curl -s "https://ocpi.tricharge.com.br/ocpi/2.2.1/locations?limit=1000" | jq -r '
  .data[] | . as $l | .evses[]
  | select(.status == "AVAILABLE" and .connectors[0].power_type == "DC")
  | [$l.city, $l.name, .physical_reference, (.connectors[0].max_electric_power/1000|tostring) + " kW"]
  | @tsv'

# Watch one plug every minute
watch -n 60 "curl -s https://ocpi.tricharge.com.br/ocpi/2.2.1/locations/1/1-1 | jq -r .data.status"

Using the data

Changelog

DateChange
2026-11-03Public access without a token to versions, locations and tariffs (60 req/min per IP), open CORS and this documentation, in Portuguese and English.
2026-10-21/ocpi/locations and /ocpi/tariffs without a version respond as 2.2.1; limit accepts up to 1000.
2026-10-09Launch: OCPI 2.2.1 and 2.1.1, credentials, locations and tariffs modules.