Maildrop
Return to Maildrop
  • 📚Developer Documentation
  • ⚡Quickstart
  • API Reference
    • 🖥️Overview
    • Rate Limiting
    • GraphQL API Schema
    • 📬Get a Mailbox Listing
    • ✉️Get a Specific Message
    • 🗑️Delete a Message
    • Get a Mailbox Alias
    • Maildrop Statistics
    • Service Status
  • GraphQL Types
    • 📨Message
    • 📶Statistics
Powered by GitBook
On this page
  1. API Reference

Maildrop Statistics

This is the GraphQL query to run when you want to see overall statistics about Maildrop emails.

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.

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

POST 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.

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 } }" }'

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

Examples

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

returns:

{"data":{"statistics":{"blocked":12345,"saved":67890}}}
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>
    );
};

PreviousGet a Mailbox AliasNextService Status

Last updated 2 years ago