# Manage & Operate › Locations API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 2 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/manage-operate/locations/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/locations.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/locations.json?format=openapi3

## Operations

- `GET /location` — List available regions and their availability zones
- `GET /location/{name}` — Get available region and its availability zones

## List available regions and their availability zones

`GET /v2/location`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/locations/#get-location

**Status:** Stable production version

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `availabilityZone` | query | string |  | Filter by availability zone. Returns locations having this availability zone. |
| `cityCode` | query | string |  | Filter by city ISO code |
| `cityName` | query | string |  | Filter by city name |
| `code` | query | string |  | Filter by region code |
| `countryCode` | query | string |  | Filter by country ISO code |
| `countryName` | query | string |  | Filter by country name |
| `datacenter` | query | string |  | Filter by datacenter |
| `geographyCode` | query | string |  | Filter by geography code |
| `geographyName` | query | string |  | Filter by geography name |
| `ids` | query | integer[] |  | Filter by region IDs |
| `language` | query | common.LanguageEnum |  | Locale name for translation — one of `cs_CZ`, `de_DE`, `en_AS`, `en_AU`, `en_CA`, `en_GB`, `en_IE`, `en_IN`, `en_SG`, `en_US`, `en_WW`, `es_ES`, … |
| `location` | query | string |  | Filter by region location |
| `name` | query | string |  | Filter by region name |
| `services` | query | location.ServicesEnum |  | Filter by services. Returns locations having at least one of the services in the list. — one of `OCC`, `PEERING` |
| `specificType` | query | location.SpecificTypeEnum |  | Filter by specific region type — one of `BACKUP`, `LZ`, `SNC`, `STANDARD` |
| `status` | query | location.StatusEnum |  | Filter by status — one of `NON_OPERATIONAL`, `OPERATIONAL` |
| `type` | query | location.TypeEnum |  | Filter by general region type — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |
| `withNonOperational` | query | boolean |  | also return NON_OPERATIONAL regions that are planned |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | location.Location[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availabilityZoneDatacenters` | object | read-only | List of datacenters by availability zone |
| `availabilityZones` | string[] | read-only | List of availability zones for the region |
| `cardinalPoint` | string | read-only | Localized cardinal direction where the region is located. The value depends on the language query parameter. |
| `cityCode` | string | read-only | ISO code of the city |
| `cityLatitude` | number | read-only | Geographical latitude of the city |
| `cityLongitude` | number | read-only | Geographical longitude of the city |
| `cityName` | string | read-only | Full name of the city |
| `code` | string | read-only | Region's short code |
| `countryCode` | string | read-only | ISO code of the country |
| `countryName` | string | read-only | Full name of the country |
| `geographyCode` | string | read-only | Short code representing the geographical area |
| `geographyName` | string | read-only | Name of the geographical area |
| `location` | string | read-only | Location of the region |
| `name` | string | read-only | Name of the region |
| `openingYear` | integer | read-only | Year the region was opened |
| `services` | location.ServicesEnum[] | read-only | List of services available in the region |
| `specificType` | location.SpecificTypeEnum | read-only | Specific typology of the region — one of `BACKUP`, `LZ`, `SNC`, `STANDARD` |
| `status` | location.StatusEnum | read-only | Operational status of the region — one of `NON_OPERATIONAL`, `OPERATIONAL` |
| `type` | location.TypeEnum | read-only | General typology of the region — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |

```json
[
  {
    "availabilityZoneDatacenters": {
      "key": [
        "string"
      ]
    },
    "availabilityZones": [
      "string"
    ],
    "cardinalPoint": "string",
    "cityCode": "string",
    "cityLatitude": 0,
    "cityLongitude": 0,
    "cityName": "string",
    "code": "string",
    "countryCode": "string",
    "countryName": "string",
    "geographyCode": "string",
    "geographyName": "string",
    "location": "string",
    "name": "string",
    "openingYear": 0,
    "services": [
      "OCC"
    ],
    "specificType": "BACKUP",
    "status": "NON_OPERATIONAL",
    "type": "LOCAL-ZONE"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/location" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/location")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/location");

print_r($result);
?>
```

## Get available region and its availability zones

`GET /v2/location/{name}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/locations/#get-location-name

**Status:** Stable production version

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | location.Location | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availabilityZoneDatacenters` | object | read-only | List of datacenters by availability zone |
| `availabilityZones` | string[] | read-only | List of availability zones for the region |
| `cardinalPoint` | string | read-only | Localized cardinal direction where the region is located. The value depends on the language query parameter. |
| `cityCode` | string | read-only | ISO code of the city |
| `cityLatitude` | number | read-only | Geographical latitude of the city |
| `cityLongitude` | number | read-only | Geographical longitude of the city |
| `cityName` | string | read-only | Full name of the city |
| `code` | string | read-only | Region's short code |
| `countryCode` | string | read-only | ISO code of the country |
| `countryName` | string | read-only | Full name of the country |
| `geographyCode` | string | read-only | Short code representing the geographical area |
| `geographyName` | string | read-only | Name of the geographical area |
| `location` | string | read-only | Location of the region |
| `name` | string | read-only | Name of the region |
| `openingYear` | integer | read-only | Year the region was opened |
| `services` | location.ServicesEnum[] | read-only | List of services available in the region |
| `specificType` | location.SpecificTypeEnum | read-only | Specific typology of the region — one of `BACKUP`, `LZ`, `SNC`, `STANDARD` |
| `status` | location.StatusEnum | read-only | Operational status of the region — one of `NON_OPERATIONAL`, `OPERATIONAL` |
| `type` | location.TypeEnum | read-only | General typology of the region — one of `LOCAL-ZONE`, `REGION-1-AZ`, `REGION-3-AZ` |

```json
{
  "availabilityZoneDatacenters": {
    "key": [
      "string"
    ]
  },
  "availabilityZones": [
    "string"
  ],
  "cardinalPoint": "string",
  "cityCode": "string",
  "cityLatitude": 0,
  "cityLongitude": 0,
  "cityName": "string",
  "code": "string",
  "countryCode": "string",
  "countryName": "string",
  "geographyCode": "string",
  "geographyName": "string",
  "location": "string",
  "name": "string",
  "openingYear": 0,
  "services": [
    "OCC"
  ],
  "specificType": "BACKUP",
  "status": "NON_OPERATIONAL",
  "type": "LOCAL-ZONE"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/location/{name}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/location/{name}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/location/{name}");

print_r($result);
?>
```
