Python script to collect flights is returning 0 rows?

i had this code working a little while ago, but now it’s returning 0 rows… I’ve tried everything i can think of, and i just cant make it work anymore… Can someone help me understand whats going on?

import requests
import pandas as pd
API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxx"
def get_flights(carrier, start_time, end_time, max_pages=1, cursor=None):
    base_url = f"https://aeroapi.flightaware.com/aeroapi/operators/{carrier}/flights"
    headers = {"x-apikey": API_KEY}
    params = {"start": start_time, "end": end_time, "max_pages": max_pages}

    if cursor:
        params["cursor"] = cursor

    all_flights = []
    for _ in range(max_pages):
        response = requests.get(base_url, headers=headers, params=params)
        print(f"Status Code: {response.status_code}")  # Print the response status code for debugging
        if response.status_code == 200:
            data = response.json()
            flights = data.get("flights", [])
            print(f"Number of Flights Returned: {len(flights)}")  # Debug: number of flights in this page

            if len(flights) == 0:  # If no flights are returned, break the loop early
                print("No flights returned, stopping the loop.")
                break

            all_flights.extend(flights)
            
            # Check if 'links' exists and if 'next' is available
            if data.get("links") and data["links"].get("next"):
                params["cursor"] = data["links"]["next"].split("cursor=")[-1]
            else:
                break
        else:
            print(f"Error: {response.status_code} - {response.text}")
            break

    # Convert to pandas DataFrame
    df = pd.DataFrame(all_flights)
    return df
df1 = get_flights('FLE', '2024-09-27', '2024-09-28', 500)

Ensure you are using the ICAO code for the operator you are interested in.

Try changing the operator to a larger one (like AAL, UAL, FDX, or similar) to ensure that your code is functioning correctly with an operator that does have significant flight volume.

If you are unsure if your operator has active flights that are being tracked by us, try checking the website to see if the flight list is close to what you are expecting. For example: https://www.flightaware.com/live/fleet/UAL