The scale legend itself is pretty ambiguous, since Google Earth is a globe in 3D, and perspective obviously isn't a projection that preserves distances (or even ratios between distances). This is less of an issue when looking straight down and fairly close to the surface of the earth, but as soon as the view is tilted, the land closer to the camera is going to have a very different scale than the land at the horizon.
At that point it makes more sense to ask about the current scale at a certain point on the screen. There is no direct API for this, but you can always find lat/lng coordinates for any two points on the screen and then find the distance between them.
GEView.hitTest is probably the easiest way of doing this. You can specify where the hit test should be done in pixels or as a fraction of the size of the plugin, offset from the edges of its DOM container. So if you wanted km/pixel near the middle of the view, for instance, you could: take the width and height of the plugin, divide them by two, then offset in each direction by 10 pixels, do the hittest query, find the distance between the returned coordinates, then finally divide by 10. How you actually offset those pixels is, again, up to where exactly you want to measure the scale (and note that if your hit test misses the earth, you'll get a null return value).
Warning: this is a very quickly thrown together bit of code (using the distance calculation from this thread). Please test thoroughly before using anywhere, but it should look something like this:
function getSomethingResemblingScale() {
var earthDiv = document.getElementById('map3d');
var hw = earthDiv.offsetWidth / 2;
var hh = earthDiv.offsetHeight / 2;
var view = ge.getView();
var hitTest1 = view.hitTest(hw - 5, ge.UNITS_PIXELS, hh, ge.UNITS_PIXELS, ge.HIT_TEST_TERRAIN);
var hitTest2 = view.hitTest(hw + 5, ge.UNITS_PIXELS, hh, ge.UNITS_PIXELS, ge.HIT_TEST_TERRAIN);
var dist = calcDistance(hitTest1.getLatitude(), hitTest1.getLongitude(), hitTest2.getLatitude(), hitTest2.getLongitude());
console.log('scale: ' + (dist/10) + ' km/pixel');
}
function calcDistance(lat1, lon1, lat2, lon2) {
var R = 6371; // Radius of the earth in km
var dLat = (lat2-lat1) * (Math.PI / 180);
var dLon = (lon2-lon1) * (Math.PI / 180);
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1*(Math.PI / 180)) * Math.cos(lat2*(Math.PI / 180)) *
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;
return d;
}