Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
You should check out the full API documentation as well as this tutorial. They should point you in the right direction.
The /v2/droplets endpoint will return a list of of droplet objects with information about each one. The droplet’s id is included in this information. An abridged droplet object might look like:
{
"id": 14,
"name": "test.example.com",
"memory": 512,
"vcpus": 1,
"disk": 20,
"region": {
....
If you’re doing this with a shell script, I’d suggest looking into jq to parse the json objects. For instance, if you know the name of a droplet you can find its id with:
curl -X GET "https://api.digitalocean.com/v2/droplets" -H "Authorization: Bearer $TOKEN" \
| jq '.droplets[] | select(.name=="test.example.com") | .id'