accessing the clipboard via an API?

I want to access the clipboard programmatically. What is the API for this?

E.g., I want my Solar2D app to check the contents of the clipboard, and if there is text available to copy into a TextField in my app.