Example:
If I wanted to take a backup of my virtual machine, I'd have to login to DigitalOcean.com. Search for the machine, click on create a snapshot, name it, click on create. Then I'd have to wait for the process to complete and delete any existing snapshots (it costs money to have multiple snapshots just sitting there).
With the help of DigitalOcean API I can automate this. Wrote a short program with Python, that provides a unique API key (generated by DigitalOcean). This key is used to authenticate, access the virtual machine and create a snapshot. If there are more than 1 snapshots existing, delete the oldest one with an API call. I put this script in a "cron job", which basically means that the script gets called any time I want. I run it each sunday at 00:00 hours.