Droplet Properties

Generated on 18 Mar 2026

Returns general information about the Droplet, including the Droplet's region, hostname, and ID.

Base URL http://169.254.169.254

GET Get Metadata Index

/metadata/v1

The top-level metadata index. This index can be navigated to find all available Metadata endpoints.

curl -X GET \
  "http://169.254.169.254/metadata/v1"

Responses

200

A list of metadata endpoints.

id
hostname
user-data
vendor-data
public-keys
region
interfaces/
dns/
floating_ip/
reserved_ip/
tags/
features/

GET Get Droplet's Metadata

/metadata/v1.json

Returns the entire contents of Droplet's matadata, in JSON. This endpoint is unique because it returns all of the metadata at once, instead of individual metadata items.

curl -X GET \
  "http://169.254.169.254/metadata/v1.json"

Responses

200

A JSON array of Droplet metadata.

301

If you access an index endpoint but forget to add the trailing slash, you will receive a 301 Moved Permanently response.

404

If you access an endpoint that does not exist, you will receive a 404 Not Found response. Resolve this by using an existing endpoint.

[
  {
    "dns": {
      "nameservers": [
        "2001:4860:4860::8844",
        "2001:4860:4860::8888",
        "8.8.8.8"
      ]
    },
    "droplet_id": 2756294,
    "features": {
      "dhcp_enabled": true
    },
    "hostname": "sample-droplet",
    "interfaces": {
      "private": [],
      "public": []
    },
    "public_keys": [
      "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcbi6cygCUmuNlB0KqzBpHXf7CFYb3VE4pDOf/RLJ8OFDjOM+fjF83a24QktSVIpQnHYpJJT2pQMBxD+ZmnhTbKv+OjwHSHwAfkBullAojgZKzz+oN35P4Ea4J78AvMrHw0zp5MknS+WKEDCA2c6iDRCq6/hZ13Mn64f6c372JK99X29lj/B4VQpKCQyG8PUSTFkb5DXTETGbzuiVft+vM6SF+0XZH9J6dQ7b4yD3sOder+M0Q7I7CJD4VpdVD/JFa2ycOS4A4dZhjKXzabLQXdkWHvYGgNPGA5lI73TcLUAueUYqdq3RrDRfaQ5Z0PEw0mDllCzhk5dQpkmmqNi0F [email protected]"
    ],
    "region": "nyc3",
    "vendor_data": "#cloud-config\ndisable_root: false\nmanage_etc_hosts: true\n\ncloud_config_modules:\n - ssh\n - set_hostname\n - [ update_etc_hosts, once-per-instance ]\n\ncloud_final_modules:\n - scripts-vendor\n - scripts-per-once\n - scripts-per-boot\n - scripts-per-instance\n - scripts-user\n"
  }
]
301 Moved Permanently
404 Not Found

GET Get Hostname

/metadata/v1/hostname

The Droplet's hostname, as specified by the user during Droplet creation.

curl -X GET \
  "http://169.254.169.254/metadata/v1/hostname"

Responses

200

The Droplet's hostname as plain text.

sample-droplet

GET Get Droplet ID

/metadata/v1/id

The Droplet's unique identifier. This is automatically generated upon Droplet creation.

curl -X GET \
  "http://169.254.169.254/metadata/v1/id"

Responses

200

The Droplet's ID as an integer.

2756294

GET Get Public Keys

/metadata/v1/public-keys

Public SSH key(s) that were added to the Droplet's root user's authorized_keys file during Droplet creation.

curl -X GET \
  "http://169.254.169.254/metadata/v1/public-keys"

Responses

200

The Droplet's public key in plain text.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcbi6cygCUmuNlB0KqzBpHXf7CFYb3VE4pDOf/RLJ8OFDjOM+fjF83a24QktSVIpQnHYpJJT2pQMBxD+ZmnhTbKv+OjwHSHwAfkBullAojgZKzz+oN35P4Ea4J78AvMrHw0zp5MknS+WKEDCA2c6iDRCq6/hZ13Mn64f6c372JK99X29lj/B4VQpKCQyG8PUSTFkb5DXTETGbzuiVft+vM6SF+0XZH9J6dQ7b4yD3sOder+M0Q7I7CJD4VpdVD/JFa2ycOS4A4dZhjKXzabLQXdkWHvYGgNPGA5lI73TcLUAueUYqdq3RrDRfaQ5Z0PEw0mDllCzhk5dQpkmmqNi0F [email protected]

GET Get Region

/metadata/v1/region

The region code of where the Droplet resides.

curl -X GET \
  "http://169.254.169.254/metadata/v1/region"

Responses

200

The Droplet's region as plain text.

nyc3

GET Get User Data

/metadata/v1/user-data

The user data that was provided by the user during Droplet creation. User data can contain arbitrary data for miscellaneous use or, with certain Linux distributions, an arbitrary shell script or cloud-config file that will be consumed by a variation of cloud-init upon boot. At this time, cloud-config support is included with Ubuntu 14.04, and CentOS 7 images on DigitalOcean.

curl -X GET \
  "http://169.254.169.254/metadata/v1/user-data"

Responses

200

The user data provided as plain text.

#! /bin/bash
echo "Data from user"

GET Get Vendor Data

/metadata/v1/vendor-data

Vendor-provided data that can be used to configure Droplets upon their creation. This is similar to user data, but it is provided by DigitalOcean instead of the user.

curl -X GET \
  "http://169.254.169.254/metadata/v1/vendor-data"

Responses

200

The vendor data provided as plain text.

#cloud-config
disable_root: false
manage_etc_hosts: true
cloud_config_modules:
 - ssh
 - set_hostname
 - [ update_etc_hosts, once-per-instance ]
cloud_final_modules:
 - scripts-vendor
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user

We can't find any results for your search.

Try using different keywords or simplifying your search terms.