Lulu.com is a "self-publishing" service. It appears that they used to have an api, but it is no longer offered.
I was wondering if there are any similar services in which I could use a scripting language to generate book documents (pdf, xml, whatever), and programatically place individual orders for custom books.