The Csound API allows users to call the Csound engine from a host language, and to communicate with Csound during the performance in many ways. The Csound API is written in C, but there are wrappers for other programming languages, like C++, Python, Java and others.
There is a description of François Pinot about how to use the API in the Csound FLOSS Manual: The Csound API.
There is a huge collection of examples for the Python API by Steven Yi in the form of a practical and in-depth tutorial. The examples have been amended by translations into other programming languages by others contributors and can be found ->here