To make the API resolve redirects, just add redirects
to a query. So, for example:
http://en.wikipedia.org/w/api.php?action=query&format=json&pageids=11601783&redirects
will give you the page id of the redirect target.
There doesn't seem to be a good way to do this using a single query for multiple pages, because the redirects
part of the response maps from title to title, not page id (I'm assuming you don't know the title of the redirect page).
One way to work around that would be to combine redirects
with prop=redirects
:
This will give you all redirects to the target page, including their page ids.