If you want to do this from scratch, then you would have to basically do the following:
- Return the key/value from the webservice
- Build the html in Javascript that will display the key/value in a nice format
- Add the html into a hidden div and set it to display if the onkeyenter event fires
However I think that there might be already some solutions out there, I would do a simple google search to see what results you get.