How to get the URL of the Checkmk site associated to a given host or service?

What do you mean with a service?

The state of one individual service? Have you checked the RestAPI as it allows for this?