GraphQL Analytics
Last reviewed: about 3 years ago
Use the GraphQL Analytics API to retrieve Magic Network Monitoring flow data.
Before you begin, you must have an API token. For additional help getting started with GraphQL Analytics, refer to GraphQL Analytics API.
To construct a Magic Network Monitoring GraphQL query for an object, you need a Cloudflare Account ID.
- Log in to the Cloudflare dashboard, and select your account.
- The URL in your browser's address bar should show
https://dash.cloudflare.com/followed by a hex string. The hex string is your Cloudflare Account ID.
Run a test query to retrieve a five-minute sum of bits and packets for flows within five-minute intervals. Copy and paste the following code into GraphiQL.
For additional information about the Analytics schema, refer to Explore the Analytics schema with GraphiQL.
query MagicNetworkMonitoring($accountTag: string!, $start: Time, $end: Time) { viewer { accounts(filter: { accountTag: $accountTag }) { mnmFlowDataAdaptiveGroups( filter: { datetime_gt: $start, datetime_leq: $end } limit: 10 orderBy: [datetimeFiveMinutes_DESC] ) { sum { bits packets } dimensions { datetimeFiveMinutes } } } }}Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2026 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-