Hi Diksha,
I've did a search on more specific terms ‘finding nearest postal code’, and this result came up:
http://www.geonames.org/export/web-services.html#findNearbyPostalCodes
This one provides this specific function:
Result : returns a list of postalcodes and places for the lat/lng query as xml document. The result is sorted by distance.
I think if you figure out whether this API accepts postal codes as input OR otherwise to convert your specified postal code to a geo location that is accepted, you can accomplish what you're aming for.
Alternatively, you can also take a look into the geolocation API from Google:
https://developers.google.com/maps/documentation/geolocation/intro