How can I generate a path on a curve?

Is there any APIs to do this? Thank you!