How to get Requests today through API

Which interface here https://developers.cloudflare.com/api/ do I need to use?
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
No description
1 Reply
dsajlk
dsajlkOP5mo ago
Self-questioning and self-answering. I got the graphql by grabbing the dash request, adjusted it and put it into the api interface for request and found it was available.
curl -X POST "https://api.cloudflare.com/client/v4/graphql" \
-H "Authorization: Bearer {apiToken}" \
-H "Content-Type: application/json" \
--data '{"query":"query getServiceRequestsQuery($accountTag: String, $filter: ZoneWorkersRequestsFilter_InputObject) { viewer { accounts(filter: { accountTag: $accountTag }) { workersInvocationsAdaptive(limit: 10000, filter: $filter) { sum { requests } } } } }","variables":{"accountTag":"{accountId}}","filter":{"AND":[{"datetimeHour_leq":"2024-06-26T15:25:19Z","datetimeHour_geq":"2024-06-26T00:00:00Z"}]}}}'
curl -X POST "https://api.cloudflare.com/client/v4/graphql" \
-H "Authorization: Bearer {apiToken}" \
-H "Content-Type: application/json" \
--data '{"query":"query getServiceRequestsQuery($accountTag: String, $filter: ZoneWorkersRequestsFilter_InputObject) { viewer { accounts(filter: { accountTag: $accountTag }) { workersInvocationsAdaptive(limit: 10000, filter: $filter) { sum { requests } } } } }","variables":{"accountTag":"{accountId}}","filter":{"AND":[{"datetimeHour_leq":"2024-06-26T15:25:19Z","datetimeHour_geq":"2024-06-26T00:00:00Z"}]}}}'
The https://api.cloudflare.com/client/v4/graphql interface is a general interface that can obtain data by passing in different parameters.
Want results from more Discord servers?
Add your server