I have a casperJS script which returns JSON when run via commandline. I want to make an API preferably in PHP which runs the script as in commandline (casperJS sample.js) an
You can use php-casperjs library which is a simple wrapper for casperjs.
casperjs