01-21-2025 05:25 AM
Hello,
I'm having a bit of a weird issue. I am trying to get network connection stats from the API but the return data does not match what's in the dashboard, or the data I get if i use developer.cisco.com.
https://api.meraki.com/api/v1/networks/L_0000000000000000/wireless/connectionStats
From my python script;
timespan 86400
ssids 0
response - {"assoc":2550,"auth":4165,"dhcp":55,"dns":150,"success":37306}
Using exactly the same parameters on developer.com I get;
{ "assoc": 73, "auth": 483, "dhcp": 2, "dns": 2, "success": 6779 }
The dashboard matches developer.com
So what's going on with my script? I broke it down to the most basic call to avoid any kind of data handling error when doing multiple calls.
It makes a single call, with hard coded network ID and parameters.
I am printing the return data directly with
print(f"Response: {response.text}")
I cant figure out whats happening 😕
Solved! Go to Solution.
01-21-2025 05:30 AM
Nov 07 2024 03:53
Hello, This API is outdated and is not planned to be fixed. There shall be new APIs available with Assurance Overview in the future. We can leave this case open until it is resolved.
###
There is a couple of operations related to wireless stats , and I was never able to get a 1:1 match with the dashboard so I couldn't trust either one. I ended up giving up on the possibility to report wireless stats.
01-21-2025 05:26 AM
Hi there ,
Case opened in 2022. Won't be fixed. API operation will be replaced by another "Assurance" operation in the near future.
01-21-2025 05:30 AM
Nov 07 2024 03:53
Hello, This API is outdated and is not planned to be fixed. There shall be new APIs available with Assurance Overview in the future. We can leave this case open until it is resolved.
###
There is a couple of operations related to wireless stats , and I was never able to get a 1:1 match with the dashboard so I couldn't trust either one. I ended up giving up on the possibility to report wireless stats.
01-21-2025 05:37 AM
oh wow, cheers.
I wonder why the hell they leave it in then? should remove it from the guide or at least leave a note warning that its inaccurate!
When they say a new API - do they mean the whole thing is unreliable or just specifically the wifi stats endpoints?
01-21-2025 05:48 AM
In my case , those endpoints were targeted : ( getDeviceWirelessConnectionStats or getNetworkWirelessClientsConnectionStats )
But my feeling is that any "Wireless" stats endpoint will behave like that
01-21-2025 01:42 PM
A "Rock Star" response. +2 to @Raphletourn .
01-21-2025 05:34 AM
API_KEY = security.MERAKI_API_KEY_LIVE
BASE_URL = "https://api.meraki.com/api/v1"
HEADERS = {
"X-Cisco-Meraki-API-Key": API_KEY,
"Content-Type": "application/json"
}
def main():
url = f"{BASE_URL}/networks/L_00000000000000/wireless/connectionStats"
params = {
"ssids": 0,
"timespan": 86400
}
response = requests.get(url, headers=HEADERS, params=params)
print(url)
print(f"Response: {response.status_code}")
print(f"Response: {response.text}")
if __name__ == "__main__":
main()
Response: 200
Response: {"assoc":2562,"auth":4161,"dhcp":55,"dns":150,"success":37457}
Process finished with exit code 0
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide