Need to pull CDP information based on a search for a guest server



My first post here so my apologies if I'm barking up the wrong tree here but I am searching for a way via API calls to do the following. It really doesn't matter what language but C# may be a good choice.

I need to be able to enter in an IP or hostname of a VM and have the app return 2 pieces of information:
1) The name of the ESX host that the server is one
2) the CDP information from the configuration tab in vCenter

I have no idea where to begin with regard to the API calls to accomplish that. Any guidance would be greatly appreciated.