import re


def get_api_route(link):
    """Returns the api root URL given a link header string"""
    links = [l.strip() for l in link.split(",")]
    if not links:
        return None

    for l in links:
        if 'rel="https://api.w.org/"' in l:
            m = re.match(r"<(.*?)>", l)
            if not m:
                continue
            else:
                return m.group(1)
    return None