Is it possible to use caddy to retrieve a LE certificate for something else than a web site?

The Caddyfile is for configuring sites to serve. If you don’t want to serve any sites, I think you’ll have to use JSON.