Do a little googling and you can probably find code on github to take care of the "get me terrain for these coordinates" part for you. That's how I managed it a few years ago when I was programmatically downloading tiles from google earth without understanding how to convert from coordinates to their url scheme.
Might have to wait a week though.