The info
operation of the Mediawiki API gives it, among other information:
HTTP request:
http://en.wikipedia.org/w/api.php?action=query&prop=info&format=xml&titles=Main%20Page
HTTP response:
<?xml version="1.0"?>
<api>
<query>
<pages>
<page pageid="15580374" ns="0" title="Main Page" contentmodel="wikitext"
pagelanguage="en" touched="2014-01-21T08:00:12Z" lastrevid="574690625"
counter="" length="6391" />
</pages>
</query>
</api>
The part you want is lastrevid.