
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
grafana-api
Advanced tools
Yet another Grafana API library for Python. Support Python 3 only.
You need Python 3 and only the requests library installed.
Install the pip package:
pip install -U grafana_api
And then connect to your Grafana API endpoint:
from grafana_api.grafana_face import GrafanaFace
grafana_api = GrafanaFace(auth='abcde....', host='api.my-grafana-host.com')
# Search dashboards based on tag
grafana_api.search.search_dashboards(tag='applications')
# Find a user by email
user = grafana_api.users.find_user('test@test.com')
# Add user to team 2
grafana_api.teams.add_team_member(2, user["id"])
# Create or update a dashboard
grafana_api.dashboard.update_dashboard(dashboard={'dashboard': {...}, 'folderId': 0, 'overwrite': True})
# Delete a dashboard by UID
grafana_api.dashboard.delete_dashboard(dashboard_uid='abcdefgh')
There are two ways to autheticate to grafana api. Either use api token or basic auth.
To use admin API you need to use basic auth as stated here
# Use basic authentication:
grafana_api = GrafanaFace(
auth=("username","password"),
host='api.my-grafana-host.com'
)
# Use token
grafana_api = GrafanaFace(
auth='abcdetoken...',
host='api.my-grafana-host.com'
)
Work on API implementation still in progress.
| API | Status |
|---|---|
| Admin | + |
| Alerting | - |
| Alerting Notification Channels | + |
| Annotations | + |
| Authentication | +- |
| Dashboard | + |
| Dashboard Versions | - |
| Dashboard Permissions | + |
| Data Source | + |
| Folder | + |
| Folder Permissions | + |
| Folder/Dashboard Search | +- |
| Organisation | + |
| Other | + |
| Preferences | + |
| Snapshot | + |
| Teams | + |
| User | + |
Please report any bugs and enhancement ideas using the grafana_api issue tracker:
https://github.com/m0nhawk/grafana_api/issues
Feel free to also ask questions on the tracker.
grafana_api is licensed under the terms of the MIT License (see the file
LICENSE).
FAQs
Yet another Python library for Grafana API
We found that grafana-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.