Hetzner Data Centers API

Each Datacenter represents a _virtual_ Datacenter which may consist of possibly many physical Datacenters. A physical Datacenter is where [Servers](#tag/servers) are hosted. See the [Hetzner Locations Docs](https://docs.hetzner.com/cloud/general/locations/#what-datacenters-are-there) for more details about Datacenters.

Operations 2

GET /datacenters List Data Centers #
GET /datacenters/{id} Get a Data Center #

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-data-centers-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-data-centers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hetzner Cloud Data Centers 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: Data Centers
  description: 'Each Datacenter represents a _virtual_ Datacenter which may consist of possibly many physical Datacenters. A physical Datacenter is where Servers are hosted.


    See the Hetzner Locations Docs for more details about Datacenters.'
paths:
  /datacenters:
    get:
      operationId: list_datacenters
      summary: List Data Centers
      description: Returns all Data Centers.
      tags:
      - Data Centers
      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:
                  datacenters:
                    description: List of [Data Centers](#tag/data-centers).
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          description: ID of the [Data Center](#tag/data-centers).
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 9007199254740991
                          example: 42
                        name:
                          description: 'Unique name for the [Data Center](#tag/data-centers).


                            May be used as a more descriptive identifier.

                            '
                          type: string
                          pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                          example: fsn1-dc8
                        description:
                          description: 'Descriptive name for the [Data Center](#tag/data-centers).


                            Desired to be easy to understand for humans. May change for cosmetic reasons. Must not be used as an identifier.

                            '
                          type: string
                          example: Falkenstein DC Park 8
                        location:
                          description: '[Location](#tag/locations) the [Data Center](#tag/data-centers) is located at.

                            '
                          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
                        server_types:
                          deprecated: true
                          description: 'This field is deprecated, as all of it''s properties are deprecated.


                            [Server Types](#tag/server-types) supported and available in this [Data Center](#tag/data-centers).

                            '
                          type: object
                          properties:
                            supported:
                              deprecated: true
                              description: 'This field is deprecated. Use the [Server Type](#tag/server-types) `locations` field instead.


                                List of [Server Types](#tag/server-types) supported in this [Data Center](#tag/data-centers).


                                These [Server Types](#tag/server-types) are generally available in this Data Center, but may be

                                temporarily out of stock.

                                '
                              type: array
                              items:
                                type: integer
                                format: int64
                              example:
                              - 1
                              - 2
                              - 3
                            available:
                              deprecated: true
                              description: 'This field is deprecated. Use the `available` flag in the [Server Type](#tag/server-types) `locations` field instead (`server_type.locations[].available`).


                                [Server Types](#tag/server-types) currently available in this [Data Center](#tag/data-centers).


                                These [Server Types](#tag/server-types) can currently be purchased. Types that are temporarily unavailable

                                but are supported in this [Data Center](#tag/data-centers) are listed as `supported`.

                                '
                              type: array
                              items:
                                type: integer
                                format: int64
                              example:
                              - 1
                              - 2
                              - 3
                            available_for_migration:
                              deprecated: true
                              description: 'This field is deprecated. Use the `available` flag in the [Server Type](#tag/server-types) `locations` field instead (`server_type.locations[].available`).


                                [Server Types](#tag/server-types) available to migrate to in this [Data Center](#tag/data-centers).


                                Existing [Servers](#tag/servers) can be migrated to these [Server Types](#tag/server-types).

                                '
                              type: array
                              items:
                                type: integer
                                format: int64
                              example:
                              - 1
                              - 2
                              - 3
                          required:
                          - supported
                          - available
                          - available_for_migration
                      required:
                      - id
                      - name
                      - description
                      - location
                      - server_types
                  recommendation:
                    deprecated: true
                    description: 'This field is deprecated. Use the `recommended` flag in the [Server Type](#tag/server-types) `locations` field instead (`server_type.locations[].recommended`).


                      Recommended [Data Center](#tag/data-centers) for creating new resources.

                      '
                    type: integer
                    format: int64
                    example: 1
                  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:
                - datacenters
                - recommendation
                - 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\tdatacenters, err := client.Datacenter.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)


          datacenters = client.datacenters.get_all()'
      - lang: Shell
        label: CLI
        source: hcloud datacenter list
  /datacenters/{id}:
    get:
      operationId: get_datacenter
      summary: Get a Data Center
      description: Returns a single Data Center.
      tags:
      - Data Centers
      parameters:
      - description: ID of the Data Center.
        name: id
        in: path
        required: true
        schema:
          description: ID of the [Data Center](#tag/data-centers).
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          example: 42
      responses:
        '200':
          description: Request succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  datacenter:
                    type: object
                    properties:
                      id:
                        description: ID of the [Data Center](#tag/data-centers).
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 9007199254740991
                        example: 42
                      name:
                        description: 'Unique name for the [Data Center](#tag/data-centers).


                          May be used as a more descriptive identifier.

                          '
                        type: string
                        pattern: ^[a-z0-9]+(-?[a-z0-9]*)*$
                        example: fsn1-dc8
                      description:
                        description: 'Descriptive name for the [Data Center](#tag/data-centers).


                          Desired to be easy to understand for humans. May change for cosmetic reasons. Must not be used as an identifier.

                          '
                        type: string
                        example: Falkenstein DC Park 8
                      location:
                        description: '[Location](#tag/locations) the [Data Center](#tag/data-centers) is located at.

                          '
                        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
                      server_types:
                        deprecated: true
                        description: 'This field is deprecated, as all of it''s properties are deprecated.


                          [Server Types](#tag/server-types) supported and available in this [Data Center](#tag/data-centers).

                          '
                        type: object
                        properties:
                          supported:
                            deprecated: true
                            description: 'This field is deprecated. Use the [Server Type](#tag/server-types) `locations` field instead.


                              List of [Server Types](#tag/server-types) supported in this [Data Center](#tag/data-centers).


                              These [Server Types](#tag/server-types) are generally available in this Data Center, but may be

                              temporarily out of stock.

                              '
                            type: array
                            items:
                              type: integer
                              format: int64
                            example:
                            - 1
                            - 2
                            - 3
                          available:
                            deprecated: true
                            description: 'This field is deprecated. Use the `available` flag in the [Server Type](#tag/server-types) `locations` field instead (`server_type.locations[].available`).


                              [Server Types](#tag/server-types) currently available in this [Data Center](#tag/data-centers).


                              These [Server Types](#tag/server-types) can currently be purchased. Types that are temporarily unavailable

                              but are supported in this [Data Center](#tag/data-centers) are listed as `supported`.

                              '
                            type: array
                            items:
                              type: integer
                              format: int64
                            example:
                            - 1
                            - 2
                            - 3
                          available_for_migration:
                            deprecated: true
                            description: 'This field is deprecated. Use the `available` flag in the [Server Type](#tag/server-types) `locations` field instead (`server_type.locations[].available`).


                              [Server Types](#tag/server-types) available to migrate to in this [Data Center](#tag/data-centers).


                              Existing [Servers](#tag/servers) can be migrated to these [Server Types](#tag/server-types).

                              '
                            type: array
                            items:
                              type: integer
                              format: int64
                            example:
                            - 1
                            - 2
                            - 3
                        required:
                        - supported
                        - available
                        - available_for_migration
                    required:
                    - id
                    - name
                    - description
                    - location
                    - server_types
                required:
                - datacenter
        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\tdatacenter, _, err := client.Datacenter.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)


          datacenter = client.datacenters.get_by_id(123)'
      - lang: Shell
        label: CLI
        source: hcloud datacenter describe $DATACENTER
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