Hetzner Locations API

Datacenters are organized by Locations. Datacenters in the same Location are connected with very low latency links.

Operations 2

GET /locations List Locations #
GET /locations/{id} Get a Location #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hetzner-locations-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hetzner-locations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hetzner Cloud Locations API
  version: 1.0.0
  x-summary: 'Manage Hetzner Cloud services and resources linked to them, such as Floating IPs, Volumes and Load Balancers.

    '
  description: '# Overview


    This is the official documentation for the Hetzner Cloud API.'
servers:
- url: https://api.hetzner.cloud/v1
security:
- APIToken: []
tags:
- name: Locations
  description: Datacenters are organized by Locations. Datacenters in the same Location are connected with very low latency links.
paths:
  /locations:
    get:
      operationId: list_locations
      summary: List Locations
      description: Returns all Locations.
      tags:
      - Locations
      parameters:
      - description: 'Filter resources by their name.


          The response will only contain the resources

          matching exactly the specified name.

          '
        name: name
        in: query
        required: false
        schema:
          type: string
      - description: 'Sort resources by field and direction. May be used multiple times.


          For more information, see "[Sorting](#description/sorting)".

          '
        name: sort
        in: query
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - id
            - id:asc
            - id:desc
            - name
            - name:asc
            - name:desc
      - description: Page number to return. For more information, see "[Pagination](#description/pagination)".
        name: page
        in: query
        required: false
        schema:
          type: integer
          format: int64
          default: 1
          example: 1
      - description: Maximum number of entries returned per page. For more information, see "[Pagination](#description/pagination)".
        name: per_page
        in: query
        required: false
        schema:
          type: integer
          format: int64
          default: 25
          example: 25
      responses:
        '200':
          description: Request succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  locations:
                    description: List of [Locations](#tag/locations).
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          description: ID of the [Location](#tag/locations).
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 9007199254740991
                          example: 42
                        name:
                          description: Unique identifier of the [Location](#tag/locations).
                          type: string
                          pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                          example: fsn1
                        description:
                          description: Human readable description of the [Location](#tag/locations).
                          type: string
                          example: Falkenstein DC Park 1
                        country:
                          description: 'Country the [Location](#tag/locations) resides in.


                            ISO 3166-1 alpha-2 code of the country.

                            '
                          type: string
                          example: DE
                        city:
                          description: 'Name of the closest city to the [Location](#tag/locations).


                            City name or city name and state in short form. E.g. `Falkenstein` or `Ashburn, VA`.

                            '
                          type: string
                          example: Falkenstein
                        latitude:
                          description: Latitude of the city closest to the [Location](#tag/locations).
                          type: number
                          format: double
                          example: 50.47612
                        longitude:
                          description: Longitude of the city closest to the [Location](#tag/locations).
                          type: number
                          format: double
                          example: 12.370071
                        network_zone:
                          description: Name of the Network Zone this [Location](#tag/locations) resides in.
                          type: string
                          pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                          example: eu-central
                      required:
                      - id
                      - name
                      - description
                      - country
                      - city
                      - latitude
                      - longitude
                      - network_zone
                  meta:
                    title: ListMeta
                    type: object
                    properties:
                      pagination:
                        description: See "[Pagination](#description/pagination)" for more information.
                        type: object
                        properties:
                          page:
                            description: Current page number.
                            type: integer
                            format: int64
                            example: 3
                          per_page:
                            description: Maximum number of entries returned per page.
                            type: integer
                            format: int64
                            example: 25
                          previous_page:
                            description: Page number of the previous page. Can be null if the current page is the first one.
                            type:
                            - integer
                            - 'null'
                            format: int64
                            example: 2
                          next_page:
                            description: Page number of the next page. Can be null if the current page is the last one.
                            type:
                            - integer
                            - 'null'
                            format: int64
                            example: 4
                          last_page:
                            description: Page number of the last page available. Can be null if the current page is the last one.
                            type:
                            - integer
                            - 'null'
                            format: int64
                            example: 4
                          total_entries:
                            description: Total number of entries that exist for this query. Can be null if unknown.
                            type:
                            - integer
                            - 'null'
                            format: int64
                            example: 100
                        required:
                        - page
                        - per_page
                        - previous_page
                        - next_page
                        - last_page
                        - total_entries
                    required:
                    - pagination
                required:
                - locations
                - meta
        4xx:
          description: Request failed with a user error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code for machines.
                        type: string
                      message:
                        description: Error message for humans.
                        type: string
                      details:
                        description: Details about the error.
                        type:
                        - object
                        - 'null'
                    required:
                    - code
                    - message
                required:
                - error
                example:
                  error:
                    code: unauthorized
                    message: unable to authenticate
                    details: null
        5xx:
          description: Request failed with a server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code for machines.
                        type: string
                      message:
                        description: Error message for humans.
                        type: string
                      details:
                        description: Details about the error.
                        type:
                        - object
                        - 'null'
                    required:
                    - code
                    - message
                required:
                - error
                example:
                  error:
                    code: timeout
                    message: request timeout
                    details: null
      security:
      - APIToken: []
      x-codeSamples:
      - lang: Go
        label: Go
        source: "package examples\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/hetznercloud/hcloud-go/v2/hcloud\"\n)\n\nfunc main() {\n\ttoken := os.Getenv(\"HCLOUD_TOKEN\")\n\n\tclient := hcloud.NewClient(hcloud.WithToken(token))\n\tctx := context.TODO()\n\n\tlocations, err := client.Location.All(ctx)\n}"
      - lang: Python
        label: Python
        source: 'from __future__ import annotations


          from os import environ


          from hcloud import Client


          token = environ["HCLOUD_TOKEN"]

          client = Client(token=token)


          locations = client.locations.get_all()'
      - lang: Shell
        label: CLI
        source: hcloud location list
  /locations/{id}:
    get:
      operationId: get_location
      summary: Get a Location
      description: Returns a Location.
      tags:
      - Locations
      parameters:
      - description: ID of the Location.
        name: id
        in: path
        required: true
        schema:
          description: ID of the [Location](#tag/locations).
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          example: 42
      responses:
        '200':
          description: Request succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  location:
                    type: object
                    properties:
                      id:
                        description: ID of the [Location](#tag/locations).
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 9007199254740991
                        example: 42
                      name:
                        description: Unique identifier of the [Location](#tag/locations).
                        type: string
                        pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                        example: fsn1
                      description:
                        description: Human readable description of the [Location](#tag/locations).
                        type: string
                        example: Falkenstein DC Park 1
                      country:
                        description: 'Country the [Location](#tag/locations) resides in.


                          ISO 3166-1 alpha-2 code of the country.

                          '
                        type: string
                        example: DE
                      city:
                        description: 'Name of the closest city to the [Location](#tag/locations).


                          City name or city name and state in short form. E.g. `Falkenstein` or `Ashburn, VA`.

                          '
                        type: string
                        example: Falkenstein
                      latitude:
                        description: Latitude of the city closest to the [Location](#tag/locations).
                        type: number
                        format: double
                        example: 50.47612
                      longitude:
                        description: Longitude of the city closest to the [Location](#tag/locations).
                        type: number
                        format: double
                        example: 12.370071
                      network_zone:
                        description: Name of the Network Zone this [Location](#tag/locations) resides in.
                        type: string
                        pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                        example: eu-central
                    required:
                    - id
                    - name
                    - description
                    - country
                    - city
                    - latitude
                    - longitude
                    - network_zone
                required:
                - location
        4xx:
          description: Request failed with a user error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code for machines.
                        type: string
                      message:
                        description: Error message for humans.
                        type: string
                      details:
                        description: Details about the error.
                        type:
                        - object
                        - 'null'
                    required:
                    - code
                    - message
                required:
                - error
                example:
                  error:
                    code: unauthorized
                    message: unable to authenticate
                    details: null
        5xx:
          description: Request failed with a server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code for machines.
                        type: string
                      message:
                        description: Error message for humans.
                        type: string
                      details:
                        description: Details about the error.
                        type:
                        - object
                        - 'null'
                    required:
                    - code
                    - message
                required:
                - error
                example:
                  error:
                    code: timeout
                    message: request timeout
                    details: null
      security:
      - APIToken: []
      x-codeSamples:
      - lang: Go
        label: Go
        source: "package examples\n\nimport (\n\t\"context\"\n\t\"os\"\n\n\t\"github.com/hetznercloud/hcloud-go/v2/hcloud\"\n)\n\nfunc main() {\n\ttoken := os.Getenv(\"HCLOUD_TOKEN\")\n\n\tclient := hcloud.NewClient(hcloud.WithToken(token))\n\tctx := context.TODO()\n\n\tlocation, _, err := client.Location.GetByID(ctx, 123)\n}"
      - lang: Python
        label: Python
        source: 'from __future__ import annotations


          from os import environ


          from hcloud import Client


          token = environ["HCLOUD_TOKEN"]

          client = Client(token=token)


          location = client.locations.get_by_id(123)'
      - lang: Shell
        label: CLI
        source: hcloud location describe $LOCATION
components:
  securitySchemes:
    APIToken:
      type: http
      scheme: bearer
x-tagGroups:
- name: Actions
  tags:
  - Actions
- name: Servers
  tags:
  - Servers
  - Server Actions
  - Server Types
  - Images
  - Image Actions
  - ISOs
  - Placement Groups
  - Primary IPs
  - Primary IP Actions
- name: Volumes
  tags:
  - Volumes
  - Volume Actions
- name: Floating IPs
  tags:
  - Floating IPs
  - Floating IP Actions
- name: Firewalls
  tags:
  - Firewalls
  - Firewall Actions
- name: Load Balancers
  tags:
  - Load Balancers
  - Load Balancer Actions
  - Load Balancer Types
- name: Networks
  tags:
  - Networks
  - Network Actions
- name: DNS
  tags:
  - Zones
  - Zone Actions
  - Zone RRSets
  - Zone RRSet Actions
- name: Security
  tags:
  - Certificates
  - Certificate Actions
  - SSH Keys
- name: Locations
  tags:
  - Locations
  - Data Centers
- name: Billing
  tags:
  - Pricing