Is there any API to get emails count

Hello Team,
Thanks for providing such a wonderful disposable email, could you help us in answering the below query?

  1. Is there any API available to fetch the number of emails (Inbox) associated with a disposable email?

Because our team is currently using sleep time 1 minute default to read the latest email from mailsac Inbox, To avoid that, we would like to call an API to fetch the email count before and after requesting for new email.

Thanks and much appreciated your help.

If this is feasible with mailsac, we would like to go for Annual premium subscription

Best Regards
Srinivas

Hi Srinivas,

The List Messages For an Inbox Endpoint returns a JSON array of messages and their meta data. It is easy to turn this array into a number of messages using almost any programming language.

For example. I sent two emails to [email protected]

I can fetch the number of messages by using the following curl command.

curl --request GET \
  --url https://mailsac.com/api/addresses/[email protected]/messages \
  --header 'Mailsac-Key: REPLACE_KEY_VALUE' | jq length

2

By piping the curl output to jq length, we are able to get the number of messages in the inbox.

I hope this helps. If you have a specific use case where returning the JSON array counting the length doesn’t work, let me know.