DigitalOcean
List DigitalOcean Droplets by tag
Filter Droplets by tag in the API or with doctl. Both return non-GPU Droplets by default. The API’s tag filter cannot be combined with the name or GPU filter.
Documentation reviewed · 2 methods with sources
Ways to do it
API
GET /v2/droplets
List Droplets with the exact tag_name and read region, size, and status metadata.
Read source: DigitalOcean list Droplets API- Requirements
- A DigitalOcean token with droplet:read and tag:read, and the name of the tag.
- Limitations
- per_page accepts 1 to 200 and defaults to 20. Follow links.pages.next to retrieve the full tagged inventory.
Example shell
curl --fail --get "https://api.digitalocean.com/v2/droplets" --data-urlencode "tag_name=$DIGITALOCEAN_TAG" --data-urlencode "per_page=100" -H "Authorization: Bearer $DIGITALOCEAN_TOKEN"CLI
doctl compute droplet list
Use --tag-name to list tagged Droplets, with --region to narrow the display and --format to select columns.
Read source: doctl droplet list- Requirements
- An authenticated doctl context with droplet:read and tag:read.
- Limitations
- The normal list excludes GPU Droplets. Use a separate GPUs-only listing when auditing GPU capacity.
Example shell
doctl compute droplet list --tag-name "$DIGITALOCEAN_TAG" --format ID,Name,Region,Status