import requests
import json

def fetch_sample_setlists():
    url = "https://elgoose.net/api/v2/setlists.json"
    try:
        response = requests.get(url, params={"page": 1})
        data = response.json()
        if 'data' in data:
            print(json.dumps(data['data'][:5], indent=2))
            # Stats on setnumber
            setnumbers = [x.get('setnumber') for x in data['data']]
            print(f"\nUnique setnumbers in page 1: {set(setnumbers)}")
    except Exception as e:
        print(f"Error: {e}")

if __name__ == "__main__":
    fetch_sample_setlists()
