Find the NW and SE coordinates for a given center

Hello, I have the lat, log for a location and I want to get the NW and SE coordinates for a specific radius e.g. 10 miles around the location. I want to do this programmatically so I can pass the the NW and SE boundaries to the purpleair api to get a list of sensors in that region. I can then collect the data from each of those sensors to determine the AQI. How can I find the NW and SE coordinates to use with the api?

If you’re just doing a one-off, you could use Google Maps to get coordinates, or this “Find Terminal Coordinates” calculator at https://www.fcc.gov/media/radio/find-terminal-coordinates

But if you want to do it programmatically, maybe this page will help: http://www.movable-type.co.uk/scripts/latlong.html

Purple Air is using a rectangle/square not a circle, but I’ll leave it to you to figure out what workaround for that works for you.