How can I extract Cloudflares unique visitors through the GraphQL API?

I’ve researched the forum and seems there are a couple of similiar posts but none have any answers.

What we’re trying to do is extract the ‘unique visitors’ from Cloudflare for a zone, which you can see through the UI in Cloudflare by clicking on the zone overview.

We’re attempting to do this using the Cloudflare GraphQL API. This is the query we’ve been able to create so far:

query {
  viewer {
    zones (filter: { zoneTag: "******************" })
    {
       httpRequestsAdaptiveGroups(
           limit: 1000
           filter: { date_gt: "2023-01-04",  }
       ) {
           sum {
             visits
           } 
       }
    }
  }
}

We can use this query to get the number of visits during the last week, but the stat we need is unique visitors.Can anyone provide any information on how we can achieve this?

Hi, I just found out, this is included in the free plan as well (tested).

query {
	viewer {
		zones(filter: { zoneTag: "{Your Zone ID}" }) {
			httpRequests1dGroups(filter: { date: "2023-01-24" }, limit: 1) {
				uniq {
					uniques
				}
			}
		}
	}
}
2 Likes