# Maildrop Statistics

{% hint style="info" %}
This method is provided as a convenience method to show the current totals of blocked and saved messages. Most users should never need to run this query.
{% endhint %}

## Gets the current number of messages that have been blocked and messages that have been delivered to mailboxes.

<mark style="color:green;">`POST`</mark> `https://api.maildrop.cc/graphql`

Returns a JSON object that represents the total number of messages blocked by the Heluna antispam filters, and the total number of messages successfully delivered to mailboxes.&#x20;

Results are cached for up to a minute.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name | Type   | Description                                                   |
| ---- | ------ | ------------------------------------------------------------- |
|      | String | '{ query: "query Example { statistics { blocked saved } }" }' |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "data": {
        "statistics": {
            "blocked": 123456789,
            "saved": 101010101
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### Examples

{% tabs %}
{% tab title="curl" %}

```bash
curl --request POST \
    --header 'content-type: application/json' \
    --url https://api.maildrop.cc/graphql \
    --data '{"query":"query Example {\n  statistics { blocked saved }\n}"}'
```

returns:

```json
{"data":{"statistics":{"blocked":12345,"saved":67890}}}
```

{% endtab %}

{% tab title="React" %}

```tsx
export const GET_STATISTICS = gql`
    query GetStatistics {
        statistics {
            blocked
            saved
        }
    }
}`;

interface Statistics {
    blocked: number;
    saved: number;
}

interface QueryReturn {
    statistics: Statistics;
}

const MyComponent = () => {
    const [{ loading, error, data }] = useQuery<QueryReturn>(GET_STATISTICS);
    return (
        <div>
            {loading && <div>Loading...</div>}
            {!loading && error && <div>There was an error.</div>}
            {!loading && data?.statistics && <div>Statistics: {data.statistics.blocked} blocked / {data.statistics.saved} saved</div>}            
        </div>
    );
};
```

{% endtab %}
{% endtabs %}
