def get_geo_url(geo_list):
    """
    :param geo_list: list of (geo, geo_id) pair (smallest first)
                     e.g. [(block%20group, *), (state, 01), (county, 02), (track, *), ]
    :return: url for geo query
    """
    total_level = len(geo_list)
    url = ""
    for i in range(total_level):
        level, val = geo_list[i]
        if i == 0:
            url += "&for=%s:%s" % (level, val)
        else:
            url += "&in=%s:%s" % (level, val)
    return url