How to generate Letsencrypt certificates with Verifying domain using API

How to install acme.sh? How to Generate Certificates? REFERENCE