Hello all!
We now have better documentation [1] on how to use WCQS with OAuth, in particular how to use it programmatically. If anything is unclear, please let us know via the Discussion page [2].
Thanks to Erik for writing that documentation and validating that it actually works as expected!
Have fun!
Guillaume
[1] https://commons.wikimedia.org/wiki/Commons:SPARQL_query_service/API_endpoint [2] https://commons.wikimedia.org/w/index.php?title=Commons_talk:SPARQL_query_se...