It's not obvious currently how the API can be used to achieve that. This thread is intended for collection of examples, which you're very welcome to post as comments.