Hello, I'm not sure If anyone will see this but, I'm currently in a similar issue where I'm attempting to send a GET request that gathers all of my devices (I have over 2000) and I'm only getting 1000 max. I was wondering if you could post an example of the script you used. I'm new to python and I'm attempting to write a program that gathers all of my Meraki devices in my inventory and then have that saved to an excel sheet to document said data. Heres what I have so far: import requests import panda as a pd api_key = "API_KEY" headers = { "X-Cisco-Meraki-API-Key": api_key } url = "https://api.meraki.com/api/v1/devices" params = { "perPage": 1000, # Number of devices per page (maximum) "startingAfter": None # Pagination marker, initially set to None } all_inventory_data = [] while True: response = requests.get(url, headers=headers, params=params) if response.status_code == 200: data = response.json() all_inventory_data.extend(data) if "nextPage" in response.headers: # Retrieve the "startingAfter" value from the "nextPage" URL params["startingAfter"] = response.headers["nextPage"].split("=")[-1] else: break else: print("Request failed with status code:", response.status_code) break print("Total devices retrieved:", len(all_inventory_data)) df = pd.DataFrame(data) excel_filename = "meraki_Inventory(Used).xlsx" df.to_excel(excel_filename, index=False, engine="openpyxl") # Saves the file to an excel sheet. print("Data saved to", excel_filename)
... View more