import requests

url = ["https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1970-W53","https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1971-W01","https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1971-W02","https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1971-W03","https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1971-W04","https://www.veikkaus.fi/api/draw-results/v1/games/LOTTO/draws/by-week/1971-W05"]

for x in url:
	response = requests.get(x.strip(), timeout=10)
	response.raise_for_status()
	data = response.json()

	# Since the top-level object is a list, access the first item
	if isinstance(data, list) and len(data) > 0:
	    first_draw = data[0]
	    results = first_draw.get("results", [])
	    if results and isinstance(results[0], dict):
	        primary_numbers = results[0].get("primary", [])
	        print("Primary numbers:", primary_numbers)
	    else:
	        print("⚠️ No valid results found.")
	else:
	    print("⚠️ Unexpected response format.")

