Skip to content

Commit 534a4e2

Browse files
committed
add bruno files for cloudflare graphql analytics api
1 parent 08a7767 commit 534a4e2

9 files changed

Lines changed: 385 additions & 0 deletions

cloudflare-jportal/Get account.bru

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
meta {
2+
name: Get account
3+
type: graphql
4+
seq: 4
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
query GetAccounts {
19+
viewer {
20+
accounts(filter: { accountTag: $accountTag })
21+
{
22+
accountTag
23+
}
24+
}
25+
}
26+
27+
}
28+
29+
body:graphql:vars {
30+
{
31+
"accountTag": "2af5100754a8644e0e2a576365803123"
32+
}
33+
}
34+
35+
settings {
36+
encodeUrl: true
37+
}

cloudflare-jportal/Get zoneTag.bru

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
meta {
2+
name: Get zoneTag
3+
type: graphql
4+
seq: 3
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
query GetZones {
19+
viewer {
20+
zones {
21+
zoneTag
22+
}
23+
}
24+
}
25+
26+
}
27+
28+
settings {
29+
encodeUrl: true
30+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
meta {
2+
name: Introspection
3+
type: graphql
4+
seq: 5
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
{
19+
__schema {
20+
queryType {
21+
name
22+
}
23+
mutationType {
24+
name
25+
}
26+
subscriptionType {
27+
name
28+
}
29+
types {
30+
...FullType
31+
}
32+
directives {
33+
name
34+
description
35+
locations
36+
args {
37+
...InputValue
38+
}
39+
}
40+
}
41+
}
42+
fragment TypeRef on __Type {
43+
kind
44+
name
45+
ofType {
46+
kind
47+
name
48+
ofType {
49+
kind
50+
name
51+
ofType {
52+
kind
53+
name
54+
ofType {
55+
kind
56+
name
57+
ofType {
58+
kind
59+
name
60+
ofType {
61+
kind
62+
name
63+
ofType {
64+
kind
65+
name
66+
}
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}
74+
fragment InputValue on __InputValue {
75+
name
76+
description
77+
type {
78+
...TypeRef
79+
}
80+
defaultValue
81+
}
82+
fragment FullType on __Type {
83+
kind
84+
name
85+
description
86+
fields(includeDeprecated: true) {
87+
name
88+
description
89+
args {
90+
...InputValue
91+
}
92+
type {
93+
...TypeRef
94+
}
95+
isDeprecated
96+
deprecationReason
97+
}
98+
inputFields {
99+
...InputValue
100+
}
101+
interfaces {
102+
...TypeRef
103+
}
104+
enumValues(includeDeprecated: true) {
105+
name
106+
description
107+
isDeprecated
108+
deprecationReason
109+
}
110+
possibleTypes {
111+
...TypeRef
112+
}
113+
}
114+
}
115+
116+
settings {
117+
encodeUrl: true
118+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
meta {
2+
name: Verify Token
3+
type: http
4+
seq: 2
5+
}
6+
7+
get {
8+
url: https://api.cloudflare.com/client/v4/user/tokens/verify
9+
body: none
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
settings {
18+
encodeUrl: false
19+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
meta {
2+
name: Web Analytics - Aggregate
3+
type: graphql
4+
seq: 7
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
query GetRumPageloadEvents(
19+
$accountTag: string!
20+
$siteTag: string!
21+
$from: Time!
22+
$to: Time!
23+
) {
24+
viewer {
25+
accounts(filter: { accountTag: $accountTag }) {
26+
rumPageloadEventsAdaptiveGroups(
27+
limit: 10
28+
filter: { datetime_geq: $from, datetime_leq: $to, siteTag: $siteTag }
29+
orderBy: [sum_visits_DESC]
30+
) {
31+
count
32+
sum {
33+
visits
34+
}
35+
}
36+
}
37+
}
38+
}
39+
40+
}
41+
42+
body:graphql:vars {
43+
{
44+
"accountTag": "2af5100754a8644e0e2a576365803123",
45+
"siteTag": "b34248b80c7a4ca6ba091bdefee60093",
46+
"from": "2025-07-25T00:00:00Z",
47+
"to": "2025-09-26T00:00:00Z"
48+
}
49+
50+
}
51+
52+
settings {
53+
encodeUrl: true
54+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
meta {
2+
name: Web Analytics - Browser
3+
type: graphql
4+
seq: 6
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
query GetRumPageloadEvents(
19+
$accountTag: string!
20+
$siteTag: string!
21+
$from: Time!
22+
$to: Time!
23+
) {
24+
viewer {
25+
accounts(filter: { accountTag: $accountTag }) {
26+
rumPageloadEventsAdaptiveGroups(
27+
limit: 10
28+
filter: { datetime_geq: $from, datetime_leq: $to, siteTag: $siteTag }
29+
orderBy: [sum_visits_DESC]
30+
) {
31+
dimensions {
32+
userAgentBrowser
33+
}
34+
count
35+
sum {
36+
visits
37+
}
38+
}
39+
}
40+
}
41+
}
42+
43+
}
44+
45+
body:graphql:vars {
46+
{
47+
"accountTag": "2af5100754a8644e0e2a576365803123",
48+
"siteTag": "b34248b80c7a4ca6ba091bdefee60093",
49+
"from": "2025-09-25T00:00:00Z",
50+
"to": "2025-09-26T00:00:00Z"
51+
}
52+
53+
}
54+
55+
settings {
56+
encodeUrl: true
57+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
meta {
2+
name: Web Analytics - OS
3+
type: graphql
4+
seq: 8
5+
}
6+
7+
post {
8+
url: https://api.cloudflare.com/client/v4/graphql
9+
body: graphql
10+
auth: inherit
11+
}
12+
13+
headers {
14+
Authorization: Bearer g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1
15+
}
16+
17+
body:graphql {
18+
query GetRumPageloadEvents(
19+
$accountTag: string!
20+
$siteTag: string!
21+
$from: Time!
22+
$to: Time!
23+
) {
24+
viewer {
25+
accounts(filter: { accountTag: $accountTag }) {
26+
rumPageloadEventsAdaptiveGroups(
27+
limit: 10
28+
filter: { datetime_geq: $from, datetime_leq: $to, siteTag: $siteTag }
29+
orderBy: [sum_visits_DESC]
30+
) {
31+
dimensions {
32+
userAgentBrowser
33+
}
34+
count
35+
sum {
36+
visits
37+
}
38+
}
39+
}
40+
}
41+
}
42+
43+
}
44+
45+
body:graphql:vars {
46+
{
47+
"accountTag": "2af5100754a8644e0e2a576365803123",
48+
"siteTag": "b34248b80c7a4ca6ba091bdefee60093",
49+
"from": "2025-09-25T00:00:00Z",
50+
"to": "2025-09-26T00:00:00Z"
51+
}
52+
53+
}
54+
55+
settings {
56+
encodeUrl: true
57+
}

cloudflare-jportal/bruno.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"version": "1",
3+
"name": "cloudflare-jportal",
4+
"type": "collection",
5+
"ignore": [
6+
"node_modules",
7+
".git"
8+
]
9+
}

jportal/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Set to 'true' to use fake data instead of real API calls
2+
VITE_USE_FAKE_DATA=false
3+
4+
CLOUDFLARE_API_TOKEN=g29zrxuDBV3FfsTpC3q4_sFeFgFyz-ztlDO_p-T1

0 commit comments

Comments
 (0)