I'm using a wikipedia API (https://www.mediawiki.org/wiki/API:Parsing_wikitext) to get the content of a Wikipedia pages in wikitext format and then parse it manually.
Some pages that I wanted to parse data from, use Scribunto extension and Lua scripting, which is embedded to a page content in form of a {{#invoke:}} template. I saw an API for expanding templates (https://www.mediawiki.org/wiki/API:Expandtemplates) but I didn't have much success with it because url parameters have limited length so the invoke templates that I needed were too long and didn't fit.
Is there any other way to parse/expand those {#invoke}} templates? Is there a wikipedia API which allows us to get wikitext of page with already expanded content?