Meraki Dashboard API Python Library

2.2.0 · active · verified Mon Apr 13

The Meraki Dashboard API Python library provides all current Meraki Dashboard API calls to interface with the Cisco Meraki cloud-managed platform. It handles error handling, logging, automatic retries for rate limits, and pagination. Generated from the OpenAPI specification, it aims to stay up-to-date with API releases. The library currently requires Python 3.10+ and is actively maintained with frequent updates.

Warnings

Install

Imports

Quickstart

This quickstart initializes the Meraki Dashboard API client using an API key from an environment variable. It then fetches and prints the names and IDs of all organizations accessible with the provided API key. Ensure `MERAKI_DASHBOARD_API_KEY` is set in your environment.

import os
import meraki

API_KEY = os.environ.get('MERAKI_DASHBOARD_API_KEY', 'YOUR_API_KEY_HERE')

if API_KEY == 'YOUR_API_KEY_HERE':
    print("Warning: MERAKI_DASHBOARD_API_KEY not set. Using placeholder.")

try:
    dashboard = meraki.DashboardAPI(api_key=API_KEY, suppress_logging=True)
    organizations = dashboard.organizations.getOrganizations()
    
    if organizations:
        print("Successfully connected to Meraki Dashboard.")
        print("Organizations found:")
        for org in organizations:
            print(f"  - {org['name']} (ID: {org['id']})")
    else:
        print("No organizations found or API key is invalid.")

except meraki.exceptions.APIError as e:
    print(f"Meraki API Error: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

view raw JSON →