This is not an official API, but it is not too hard to simulate the login via OAuth2 and use the session to start executing a query, poll the job that executes it and retrieve the results in the end. I do most of my Stack Exchange development work in Java, but it should be easy to port to other languages even if you don't know Java. I'm using fairly standard libraries: Apache HTTP client, JSON parser org.json and HTML parser Jsoup.
The source code can be found here on GitHub; you'll need to provide your own email address and password which you use for logging in to Stack Exchange at the bottom. To run a query, you'll need the site ID which you can obtain from this list; the query ID (visible in the URL) and the revision ID of the query (visible when you edit the query (left), or otherwise in the HTML of the 'Run Query' form (right)).
(originally posted here)