Is there a way to Pragmatically find the Docker API listening ports?

One use case of such a detection would be for an application that would like to integrate automatically with docker. The application detects the engine’s presence on a host and automatically finds the sockets that the API is listening to.

I currently have an implementation that does that by scanning the command line, docker config file and systemD settings and merges them together in order to get (guess) that info. It would be preferable if Docker API would publish the sockets it listens too, say similar to publishing its pid through the docker.pid file.

Docker actually does publish those sockets into the logs but those might not be available to the application for various reasons and parsing them is unnecessarily complex.

Is there a better way for obtaining this info?