Take a look at the example: https://github.com/romkatv/gitstatus#gitstatusd. Even though this example uses ZSH, it's just for exposition. It launches gitstatusd, writes a request to its stdin, reads the request from stdout and prints it. You can discern from it the format it uses for requests and responses.
There is also a formal description of request/response format in `gitstatusd --help`, or in https://github.com/romkatv/gitstatus/blob/master/src/options....