Limiting for loop

Limiting for loop

Hi,

I have below script with JSON functions what I am facing the problem is exceeding maximum number of deluge statements.
So to avoid the situation I would like to limit the for loop to a specific number like: range from  1 to 200 etc.

But Here How do I do that since it is a JSON list, please help me 


url = (" http://api.tvmedia.ca/tv/v4/lineups?api_key=123" + input.Zip_Code + "&lineupType=" + input.lineupType + "&detail=full").toString();
response = getUrl(url);
lines = response.toJSONList();
for each line in lines
{
    providerName = line.getJSON("providerName");
    stations = line.getJSON("stations").toJSONList();

    for each station in stations  << something I should put here to limit the for loop>>
    {
        channelNumber = station.getJSON("channelNumber");
       
   
        insert into ZipCode_lineup
        [
            Added_User = zoho.loginuser
            zcl_postalCode = input.Zip_Code
            zcl_lineupType = input.lineupType
           zcl_channelNumber = channelNumber
           zcl_providerName = providerName 
        ]
    }
}
 


Thanks

Arfater