> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ocpplab.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.io/_mcp/server.

# List locations

GET https://api.ocpplab.io/cpo/locations

Your locations and those received from roaming partners, most recently changed first.

Reference: https://docs.ocpplab.io/api-reference/cpo/locations/list

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `country_code` (string, optional, nullable) — Only this OCPI party country code, e.g. NL.
- `party_id` (string, optional, nullable) — Only this OCPI party id, e.g. OCP.
- `origin` (enum, optional, nullable) — LOCAL rows are yours; REMOTE rows came from a roaming partner.
  - Allowed values: `LOCAL`, `REMOTE`
- `publish` (boolean, optional, nullable) — Only published (true) or unpublished (false) locations.
- `offset` (integer, optional, default: 0) — Rows to skip. Pass the previous page's ``next_offset`` to continue.
- `limit` (integer, optional, default: 50) — Maximum rows per page (default 50, max 200).

## Response

### 200

One page of results; ``next_offset`` is null on the last page.

- `items` (list of CpoGatewaySchemaLocationsLocationOut, required)
- `offset` (integer, required)
- `limit` (integer, required)
- `next_offset` (integer, optional, nullable)

## Errors

### 401 Unauthorized Error

Missing or invalid Bearer token

- `detail` (string, required) — Human-readable error message returned by the API.

### 422 Unprocessable Entity Error

The request does not match the schema

- `detail` (list of ValidationError, optional) — One entry per invalid field.

### 429 Too Many Requests Error

Gateway rate limit reached; retry after the given seconds

- `detail` (string, required) — Human-readable error message returned by the API.

### 502 Bad Gateway Error

Gateway unreachable, failing, or misconfigured

- `detail` (string, required) — Human-readable error message returned by the API.

### 504 Gateway Timeout Error

Gateway timed out

- `detail` (string, required) — Human-readable error message returned by the API.

## Types

### CpoGatewaySchemaLocationsLocationOut

One OCPI location row in ocpp.ocpp_locations.

- `id` (integer, required)
- `location_id` (string, required)
- `publish` (boolean, required)
- `address` (string, required)
- `city` (string, required)
- `country` (string, required)
- `coordinates` (OcpiGeoLocation, required)
- `time_zone` (string, required)
- `last_updated` (datetime, required)
- `revision` (integer, required)
- `role` (CpoGatewaySchemaLocationsLocationOutRole, required)
- `origin` (CpoGatewaySchemaLocationsLocationOutOrigin, required)
- `country_code` (string, required)
- `party_id` (string, required)
- `ocpi_version` (CpoGatewaySchemaLocationsLocationOutOcpiVersion, required)
- `organization_id` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `publish_allowed_to` (list of OcpiPublishToken, optional, nullable)
- `name` (string, optional, nullable)
- `postal_code` (string, optional, nullable)
- `state` (string, optional, nullable)
- `related_locations` (list of OcpiRelatedLocation, optional, nullable)
- `parking_type` (CpoGatewaySchemaLocationsLocationOutParkingType, optional, nullable)
- `parking_places` (list of OcpiParkingPlace, optional, nullable)
- `directions` (list of OcpiDisplayText, optional, nullable)
- `operator` (OcpiBusinessDetails, optional, nullable)
- `suboperator` (OcpiBusinessDetails, optional, nullable)
- `owner` (OcpiBusinessDetails, optional, nullable)
- `facilities` (list of string, optional, nullable)
- `opening_times` (OcpiOpeningTimes, optional, nullable)
- `charging_when_closed` (boolean, optional, nullable)
- `images` (list of OcpiImage, optional, nullable)
- `energy_mix` (OcpiEnergyMix, optional, nullable)
- `help_phone` (string, optional, nullable)
- `ocpp_version` (string, optional, nullable)

### ValidationError

Why one field is invalid.

- `loc` (list of ValidationErrorLocItems, required) — Where the field is: ``body`` / ``query`` / ``path`` / ``header``, then its name.
- `msg` (string, required) — What is wrong, in English.
- `type` (string, required) — Machine-readable error code, e.g. ``missing``.
- `input` (any, optional) — The value that was sent.
- `ctx` (ValidationErrorCtx, optional) — Details of the rule that failed, e.g. `{"le": 200}`.

### OcpiGeoLocation

- `latitude` (string, required)
- `longitude` (string, required)

### CpoGatewaySchemaLocationsLocationOutRole

### CpoGatewaySchemaLocationsLocationOutOrigin

### CpoGatewaySchemaLocationsLocationOutOcpiVersion

### OcpiPublishToken

- `uid` (string, required)
- `type` (string, required)
- `visual_number` (string, optional, nullable)
- `issuer` (string, optional, nullable)
- `group_id` (string, optional, nullable)

### OcpiRelatedLocation

- `latitude` (string, required)
- `longitude` (string, required)
- `name` (OcpiDisplayText, optional, nullable)

### CpoGatewaySchemaLocationsLocationOutParkingType

### OcpiParkingPlace

- `id` (string, required)
- `vehicle_types` (list of string, required)
- `restricted_to_type` (boolean, required)
- `reservation_required` (boolean, required)
- `physical_reference` (string, optional, nullable)
- `max_vehicle_weight` (double, optional, nullable)
- `max_vehicle_height` (double, optional, nullable)
- `max_vehicle_length` (double, optional, nullable)
- `max_vehicle_width` (double, optional, nullable)
- `parking_space_length` (double, optional, nullable)
- `parking_space_width` (double, optional, nullable)
- `dangerous_goods_allowed` (boolean, optional, nullable)
- `direction` (string, optional, nullable)
- `drive_through` (boolean, optional, nullable)
- `time_limit` (double, optional, nullable)
- `roofed` (boolean, optional, nullable)
- `images` (list of OcpiImage, optional, nullable)
- `lighting` (boolean, optional, nullable)
- `refrigeration_outlet` (boolean, optional, nullable)
- `standards` (list of string, optional, nullable)
- `apds_reference` (string, optional, nullable)

### OcpiDisplayText

- `language` (string, required)
- `text` (string, required)

### OcpiBusinessDetails

- `name` (string, required)
- `website` (string, optional, nullable)
- `logo` (OcpiImage, optional, nullable)

### OcpiOpeningTimes

- `twentyfourseven` (boolean, optional, nullable)
- `regular_hours` (list of OcpiRegularHours, optional, nullable)
- `exceptional_openings` (list of OcpiExceptionalPeriod, optional, nullable)
- `exceptional_closings` (list of OcpiExceptionalPeriod, optional, nullable)

### OcpiImage

- `url` (string, required)
- `category` (string, required)
- `type` (string, required)
- `thumbnail` (string, optional, nullable)
- `width` (integer, optional, nullable)
- `height` (integer, optional, nullable)

### OcpiEnergyMix

- `is_green_energy` (boolean, required)
- `energy_sources` (list of OcpiEnergySource, optional, nullable)
- `environ_impact` (list of OcpiEnvironmentalImpact, optional, nullable)
- `supplier_name` (string, optional, nullable)
- `energy_product_name` (string, optional, nullable)

### ValidationErrorLocItems

### ValidationErrorCtx

Details of the rule that failed, e.g. `{"le": 200}`.

### OcpiRegularHours

- `weekday` (integer, required)
- `period_begin` (string, required)
- `period_end` (string, required)

### OcpiExceptionalPeriod

- `period_begin` (datetime, required)
- `period_end` (datetime, required)

### OcpiEnergySource

- `source` (string, required)
- `percentage` (double, required)

### OcpiEnvironmentalImpact

- `category` (string, required)
- `amount` (double, required)

## Examples

**Response**

```json
{
  "items": [
    {
      "id": 12,
      "location_id": "LOC-AMS-01",
      "publish": true,
      "address": "Stationsplein 1",
      "city": "Amsterdam",
      "country": "NLD",
      "coordinates": {
        "latitude": "52.37310",
        "longitude": "4.88970"
      },
      "time_zone": "Europe/Amsterdam",
      "last_updated": "2026-09-30T10:00:00Z",
      "revision": 1,
      "role": "CPO",
      "origin": "LOCAL",
      "country_code": "NL",
      "party_id": "OCP",
      "ocpi_version": "2.2.1",
      "organization_id": "550e8400-e29b-41d4-a716-446655440000",
      "created_at": "2026-09-01T09:00:00Z",
      "updated_at": "2026-09-30T10:00:00Z",
      "name": "Amsterdam depot",
      "postal_code": "1012AB",
      "parking_type": "PARKING_LOT",
      "facilities": [
        "TRAIN_STATION"
      ]
    }
  ],
  "offset": 0,
  "limit": 50
}
```

**SDK Code**

```python
import requests

url = "https://api.ocpplab.io/cpo/locations"

querystring = {"publish":"true","limit":"50","offset":"0"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/cpo/locations?publish=true&limit=50&offset=0")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```