A few problems: if I have multiple droplets then how do I know which droplet to retrieve the name from? And in the case I have an identifier (e.g IP address) for the droplet, then retrieving the name only half the serves the purpose of what I am trying to do which is retrieving an identifier of the droplet I am currently ON.

So you’d need to pull the JSON object with all the droplets you own and loop through each one and match the $IP from above to it. Once you get a match you can extract the droplet name and other info if needed.