The JS API V2.4 added the KMLLayer class to create a layer based on a KML file (.kml,.kmz). It supports the ExtendedData feature attributes from JS API V2.5. The ExtendedData can be obtained by using the "attributes" of an object, such as:
dojo.forEach(graphics, function(graphic){
console.log(graphic.attributes.City);
The attached code sample shows how to obtain KML extendedData from KMLLayer using JS API.