To build educational coding sites, there are some useful online APIs. For example, I just find out this: https://sphere-engine.com/compilers.
I think that this option is valid because the site provides also a nice documentation and tutorial about how to integrate their compilers in your site, for example using Javascript SDK.
Important: it is necessary to sign up to the site.