import requests


def get_count_clicks(link, service_url, headers):
    """Return clicks count for bitlink."""
    payload = {"units": "-1", "unit": "day"}
    url = service_url.format("bitlinks") + "/{}/clicks/summary".format(link)
    response = requests.get(url, headers=headers, params=payload)
    response.raise_for_status()
    count_clicks = response.json()["total_clicks"]
    return count_clicks