> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflare

> Zone traffic, firewall and security analytics through Cloudflare's GraphQL Analytics API, plus zones and DNS records from the v4 REST API.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/cloudflare.webp?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=3a4aeb728d7e461c8d77f1c7a9aea9f1)

[Web Catalog · Analytics](https://docs.webrouter.net/data-apis.md?category=analytics)

Needs&#x20;

`CLOUDFLARE_API_TOKEN`

Endpoints

5

Auth

Key in header

[Vendor docs](https://developers.cloudflare.com/api/)

&#x20;·&#x20;

[Pricing](https://www.cloudflare.com/plans/)

## Setup

| Variable | | What it is |
| - | - | - |
| `CLOUDFLARE_API_TOKEN` | required | a Cloudflare API token (My Profile > API Tokens) with Zone Read, Analytics Read and DNS Read as needed |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* REST answers are wrapped as \{success, errors, messages, result, result\_info}; page with page and per\_page and read result\_info.total\_pages.
* Analytics are GraphQL only: POST a query against viewer.zones(filter: \{zoneTag}) or viewer.accounts(filter: \{accountTag}) and a dataset node such as httpRequestsAdaptiveGroups or firewallEventsAdaptive. Zone ids come from cloudflare.zones.list.
* GraphQL quota: 300 queries per 5 minutes per user by default; up to 10 zones or 1 account per query. Adaptive datasets keep at least 31 days on every plan; aggregated ones (httpRequests1hGroups, 1dGroups) have per-plan lookback limits.
* Cloudflare also accepts the legacy global API key (X-Auth-Email + X-Auth-Key); this entry uses an API token.

## Endpoints

GET

Verify the API token

Whether the token is active, disabled or expired, and its validity window.

[Open](#cloudflare-token-verify)

GET

List zones

Domains (zones) the token can see, with id, status, plan and name servers.

[Open](#cloudflare-zones-list)

GET

Get a zone

One zone's details: name, status, plan, account, name servers, settings summary.

[Open](#cloudflare-zones-get)

GET

List DNS records

DNS records in a zone, filterable by type and proxy status.

[Open](#cloudflare-dns-list)

POST

Query analytics (GraphQL)

Traffic, cache, firewall and security analytics for zones or an account through the GraphQL Analytics API.

[Open](#cloudflare-analytics-graphql)

### Verify the API token

GET

`/user/tokens/verify`

`cloudflare.token.verify`

Whether the token is active, disabled or expired, and its validity window.

Input

No inputs.

[Vendor docs](https://developers.cloudflare.com/api/resources/user/subresources/tokens/methods/verify/)

```python Python theme={null}
router.call_data_api("cloudflare.token.verify")
```

```text MCP theme={null}
call_data_api(endpoint="cloudflare.token.verify")
```

### List zones

GET

`/zones`

`cloudflare.zones.list`

Domains (zones) the token can see, with id, status, plan and name servers.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`name`</td><td>string</td><td>query</td><td>Domain name filter. Example `example.com`</td></tr>

    <tr>
      <td>
        `status`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `initializing`

        ,&#x20;

        `pending`

        ,&#x20;

        `active`

        ,&#x20;

        `moved`
      </td>
    </tr>

    <tr>
      <td>
        `account_id`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Only zones in this account.
      </td>
    </tr>

    <tr>
      <td>
        `order`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `name`

        ,&#x20;

        `status`

        ,&#x20;

        `account.id`

        ,&#x20;

        `account.name`

        ,&#x20;

        `plan.id`
      </td>
    </tr>

    <tr>
      <td>
        `direction`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `asc`

        ,&#x20;

        `desc`
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        From 1.
      </td>
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        5-50.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.cloudflare.com/api/resources/zones/methods/list/) · Same job: [Google Tag Manager](https://docs.webrouter.net/data-apis/google-tag-manager.md#google-tag-manager-accounts-list), [Snitcher](https://docs.webrouter.net/data-apis/snitcher.md#snitcher-workspaces-list), [Sprout Social](https://docs.webrouter.net/data-apis/sprout-social.md#sprout-social-metadata-client)

```python Python theme={null}
router.call_data_api("cloudflare.zones.list", {'name': 'example.com'})
```

```text MCP theme={null}
call_data_api(endpoint="cloudflare.zones.list", params={"name": "example.com"})
```

> [!NOTE]
>
> * Needs Zone Read. internal zones are left out unless type includes them.

### Get a zone

GET

`/zones/{zone_id}`

`cloudflare.zones.get`

One zone's details: name, status, plan, account, name servers, settings summary.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `zone_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The 32-character zone id.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.cloudflare.com/api/resources/zones/methods/get/)

### List DNS records

GET

`/zones/{zone_id}/dns_records`

`cloudflare.dns.list`

DNS records in a zone, filterable by type and proxy status.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `zone_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td />
    </tr>

    <tr><td>`type`</td><td>string</td><td>query</td><td>Record type. One of `A`, `AAAA`, `CAA`, `CERT`, `CNAME`, `DNSKEY`, `DS`, `HTTPS`, `LOC`, `MX`, `NAPTR`, `NS`, `OPENPGPKEY`, `PTR`, `SMIMEA`, `SRV`, `SSHFP`, `SVCB`, `TLSA`, `TXT`, `URI`</td></tr>

    <tr>
      <td>
        `proxied`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td />
    </tr>

    <tr><td>`match`</td><td>string</td><td>query</td><td>any (OR) or all (AND) across filters. One of `any`, `all`</td></tr>

    <tr>
      <td>
        `order`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `type`

        ,&#x20;

        `name`

        ,&#x20;

        `content`

        ,&#x20;

        `ttl`

        ,&#x20;

        `proxied`
      </td>
    </tr>

    <tr>
      <td>
        `direction`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        &#x20;One of&#x20;

        `asc`

        ,&#x20;

        `desc`
      </td>
    </tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td />
    </tr>

    <tr>
      <td>
        `per_page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td />
    </tr>
  </tbody>
</table>

[Vendor docs](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/list/)

> [!NOTE]
>
> * Needs DNS Read.

### Query analytics (GraphQL)

POST

`/graphql`

`cloudflare.analytics.graphql`

Traffic, cache, firewall and security analytics for zones or an account through the GraphQL Analytics API.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`query` required</td><td>string</td><td>body</td><td>A GraphQL query, newlines removed. Example `{viewer { zones(filter: { zoneTag: $zoneTag }) { firewallEventsAdaptive(filter: $filter limit: 10 orderBy: [datetime_DESC]) { action clientCountryName clientIP clientRequestPath datetime source userAgent } } }}`</td></tr>
    <tr><td>`variables`</td><td>object</td><td>body</td><td>A value for every variable the query declares. Example `{"zoneTag": "<zone id>", "filter": {"datetime_geq": "2026-11-01T00:00:00Z", "datetime_leq": "2026-11-02T00:00:00Z"}}`</td></tr>
  </tbody>
</table>

[Vendor docs](https://developers.cloudflare.com/analytics/graphql-api/getting-started/execute-graphql-query/) · Same job: [Amplitude](https://docs.webrouter.net/data-apis/amplitude.md#amplitude-charts-query), [Close](https://docs.webrouter.net/data-apis/close-crm.md#close-crm-reports-activity), [Google Analytics 4 (Data API)](https://docs.webrouter.net/data-apis/google-analytics.md#google-analytics-report-run), [Instagram Graph API](https://docs.webrouter.net/data-apis/instagram.md#instagram-user-insights), [Klaviyo](https://docs.webrouter.net/data-apis/klaviyo.md#klaviyo-campaigns-report), [Microsoft Graph (Microsoft 365)](https://docs.webrouter.net/data-apis/microsoft-graph.md#microsoft-graph-reports-active-users)

```python Python theme={null}
router.call_data_api("cloudflare.analytics.graphql", {'query': '{viewer { zones(filter: { zoneTag: $zoneTag }) { firewallEventsAdaptive(filter: $filter limit: 10 orderBy: [datetime_DESC]) { action clientCountryName clientIP clientRequestPath datetime source userAgent } } }}', 'variables': {'zoneTag': '<zone id>', 'filter': {'datetime_geq': '2026-11-01T00:00:00Z', 'datetime_leq': '2026-11-02T00:00:00Z'}}})
```

```text MCP theme={null}
call_data_api(endpoint="cloudflare.analytics.graphql", params={"query": "{viewer { zones(filter: { zoneTag: $zoneTag }) { firewallEventsAdaptive(filter: $filter limit: 10 orderBy: [datetime_DESC]) { action clientCountryName clientIP clientRequestPath datetime source userAgent } } }}", "variables": {"zoneTag": "<zone id>", "filter": {"datetime_geq": "2026-11-01T00:00:00Z", "datetime_leq": "2026-11-02T00:00:00Z"}}})
```

> [!NOTE]
>
> * A read over POST. Needs Analytics Read on the zone or account.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.