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/locationsQuick 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.
| Public | Partner (OCPI token) | |
|---|---|---|
| For | maps, apps, research, anyone curious | roaming platforms / eMSPs that run the OCPI handshake |
| How | GET with no Authorization header | Authorization: Token <token> |
| Endpoints | /versions, /{version}, locations, tariffs | the same + credentials (registration) |
| Limit | 60 requests/min per IP | no fixed limit (fair use: poll every ≥ 30 s) |
| CORS | open (*) | open (*) |
| Support | best effort | direct contact, advance notice of changes |
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.
- 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. - You discover the endpoints with Token A:
GET /versions, thenGET /2.2.1. - You register with
POST /2.2.1/credentials, sending your Token B, your Versions URL and your roles. - The response contains Token C. Use it for every call from then on. To rotate Token C, call
PUT /credentials; to unregister,DELETE /credentials.
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.
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.
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"
}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"
}Paginated list of Locations, each with its EVSEs and connectors embedded. Order: ascending last_updated, then id.
Query parameters
| Name | Type | Description |
|---|---|---|
| offset | int | Start position. Default 0. |
| limit | int | Items per page. Default 100, max 1000. |
| date_from | RFC 3339 | Only objects with last_updated >= this instant. |
| date_to | RFC 3339 | Only 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"
}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/1One 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"
}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"
}Partner handshake (see the flow). Requires Authorization: Token ….
| Method | Token | Effect |
|---|---|---|
| GET | A or C | Returns our credentials (with the token you used). |
| POST | A | Registers and returns Token C. With Token C: 405 (use PUT). |
| PUT | C | Updates Token B/URL and issues a new Token C. Not registered: 405. |
| DELETE | C | Unregisters (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
| Object | Field | Format | Example | Notes |
|---|---|---|---|---|
| Party | country_code / party_id | BR / TRC | BR*TRC | Fixed, also for stations in Paraguay. |
| Location | id | TriCharge station id | "1" | Stable. Maps to pay.tricharge.com.br/station/1. |
| EVSE | uid | {location_id}-{n} | "1-2" | n = connector number on the charger (OCPP connectorId). |
| EVSE | evse_id | {BR|PY}*TRC*E{location_id}*{n} | BR*TRC*E1*2 | eMI3 format. Prefix is the country where the plug is. |
| Connector | id | "1" | "1" | One connector per EVSE. |
| Tariff | id | station 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
| Field | Always? | Source and rule |
|---|---|---|
| name | yes | Station name as registered. |
| address | yes | Street obtained by reverse geocoding the coordinates (OpenStreetMap). Without a street, falls back to the city. |
| city / state | city yes | From the registration (City/State). state is the two-letter Brazilian state code when known; city may be "-" if the registration has no city. |
| postal_code | no | Postal code (CEP) from geocoding, when available. |
| country | yes | ISO 3166-1 alpha-3: BRA or PRY. |
| coordinates | yes | Decimal strings with 6 places (OCPI standard), WGS 84. |
| time_zone | yes | America/Sao_Paulo or America/Asuncion. |
| opening_times | no | We only publish twentyfourseven: true when the operator declared 24h. When absent we don't know the hours — don't assume closed. |
| directions | no | Free-text availability provided by the operator (e.g. “Seg a Sáb 8h–18h”), in pt or es. |
| images | no | Station photo, category LOCATION, https URLs only. |
| operator | yes | TriCharge (the platform). The site owner may be a different company. |
| publish | yes | Always true: we only list what is public. |
| evses | yes | At least one. Plugs hidden by the operator are not listed. |
We do not publish parking_type, facilities, related_locations or energy_mix.
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 type | standard | format | power_type |
|---|---|---|---|
| CCS / CCS2 | IEC_62196_T2_COMBO | CABLE | DC |
| GB/T | GBT_DC | CABLE | DC |
| Type 2 (AC) up to 7.4 kW | IEC_62196_T2 | SOCKET | AC_1_PHASE |
| Type 2 (AC) above 7.4 kW | IEC_62196_T2 | SOCKET | AC_3_PHASE |
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.
| OCPI | When | How to display |
|---|---|---|
| AVAILABLE | Available with no open session | Free to use. |
| CHARGING | Preparing, Charging, SuspendedEV, SuspendedEVSE, Finishing, Occupied — or Available while a session is still open | Occupied. Includes a car plugged in waiting to start and a session paused by the car. |
| RESERVED | Reserved | Reserved at the charger. |
| INOPERATIVE | Unavailable, or plug flagged as under maintenance by the operator | Out of service, planned. |
| OUTOFORDER | Faulted | Fault reported by the charger. |
| UNKNOWN | charger has not communicated for more than 15 min, or no StatusNotification yet | We 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
- Activation fee (optional) — element with only a
FLATcomponent, charged once per session. - Time/day bands (optional) —
ENERGYelements withrestrictions(start_time,end_time,day_of_week), from highest to lowest priority. - Base price — last element,
ENERGYwith 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.
| Field | Content |
|---|---|
| tariff_alt_text | Human-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_url | The station's payment page, where the driver starts the session. |
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.
Which stations are listed
A station is in the catalogue when all of the following hold:
- the charger has connected to the platform and was seen in the last 30 days;
- its coordinates fall inside Brazil/Paraguay (registrations without a real location are excluded);
- its name does not indicate a test station;
- the operator has not opted out of publishing;
- it has at least one plug visible to the public.
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: 59The 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:
- The first time, download everything and keep the highest
last_updatedyou saw. - 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. - 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
- The catalogue is rebuilt at most every 60 seconds. Requesting more than once a minute returns the same content.
- Status comes from the charger's latest event; a plug is considered out of contact after 15 minutes without communication.
- Responses carry
Cache-Control: no-store. If you redistribute the data to many users, cache it on your side (60 s is a good number) instead of having every end user call this API.
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"
}| HTTP | status_code | When | What to do |
|---|---|---|---|
| 200 | 1000 | Success. | — |
| 400 | 2001 | Invalid date_from/date_to, incomplete credentials body. | Fix the parameter. |
| 401 | 2000 | Missing token on credentials, malformed header (expected Token <token>), invalid or revoked token. | Check the credential; for public reads, remove the header. |
| 404 | 2000 | Unsupported version or module (e.g. sessions, commands). | Use only the modules listed in /{version}. |
| 404 | 2003 | Unknown Location, EVSE or connector. | Drop it from your cache; reload the list. |
| 405 | 2000 | Method not allowed (the API is read-only) or wrong handshake step. | See status_message. |
| 429 | 2000 | Public access rate limit exceeded. | Wait Retry-After seconds. |
| 500 | 3000 | Our 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
- Public: 60 requests per minute per IP, in a fixed 1-minute window. Every public response carries
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Reset(seconds until the window resets). - Partner: no fixed limit; please poll at most once every 30 seconds.
- CORS:
Access-Control-Allow-Origin: *on every route, with the pagination and rate-limit headers exposed. You can consume it straight from a web page, no backend needed.
Differences in 2.1.1
2.1.1 is derived from 2.2.1, with the same data:
- Location has no
country_code/party_id/publish/state; it gainstype: "UNKNOWN";postal_codeis""when unknown. - Connector uses
voltage/amperageandtariff_id(singular), and has nomax_electric_power— if you need the power, use 2.2.1. - Tariff has no
country_code/party_id/type. - Version details have no
role; token is not Base64-encoded.
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…
| ID | Location | City | Plugs | Power | Price |
|---|
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
- You may display it in maps, apps, route planners and studies, commercial or not.
- Credit the source: “Data: TriCharge” near the map or list.
- Send drivers to
tariff_alt_urlto charge; don't present the price as guaranteed. - Don't overload the API: cache, honour
Retry-Afterand preferdate_fromover downloading everything every minute. - Found wrong data (address, connector, price)? Write to [email protected] with the
location_id.
Changelog
| Date | Change |
|---|---|
| 2026-11-03 | Public 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-09 | Launch: OCPI 2.2.1 and 2.1.1, credentials, locations and tariffs modules. |