Using material generator through script

Is there are any way to use material generator through script or api?

This might help you: