---
title: "Count the emails that arrived | Proxy Mail QA"
description: "Developer docs for Proxy Mail QA: the MCP server for coding agents, the REST API for test suites, and the Chrome extension."
url: https://proxymail.qa/docs/reference/operations/countemails
---

# Count the emails that arrived

GET

/v1/addresses/{address}/count

```js
const url = 'https://api.proxymail.qa/v1/addresses/k7f2x9ab12cd%40mailclub.dev/count?type=code';
const options = {
  method: 'GET',
  headers: {
    'Proxy-Mail-QA-Test': 'sign-up%20%E2%80%BA%20sends%20one%20code',
    Authorization: 'Bearer <token>'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url 'https://api.proxymail.qa/v1/addresses/k7f2x9ab12cd%40mailclub.dev/count?type=code' \
  --header 'Authorization: Bearer <token>' \
  --header 'Proxy-Mail-QA-Test: sign-up%20%E2%80%BA%20sends%20one%20code'
```

How many emails reached the address since `since`, for checks such as “exactly one verification email”. Doesn’t wait. Each email is summarised by when it arrived, its sender and the kind of its main code or link, never its content. Count after the wait for the first email has returned, so a duplicate has time to arrive.

## Authorizations

- **[apiKey](https://proxymail.qa/docs/reference.html#apikey)**

## Parameters

### Path Parameters

**address**

required

string format: email

The test address, URL-encoded. A variant also works: capitals, or a +tag (k7f2x9ab12cd+o’[brien@mailclub.dev](mailto:brien@mailclub.dev)). It acts on the plain address; waiting on a +tag variant, or listing its messages, only finds mail sent to that variant.

#### Example 

```plaintext
k7f2x9ab12cd@mailclub.dev
```

### Query Parameters

**since**

string format: date-time

Only email received at or after this time. Default: every email the address has received.

**service**

string

Only email from this service, by name or domain (e.g. ‘spotify’).

**type**

string

Allowed values: code link

Only emails with a code, or with a link. Codes leave out coupons, and links count verify, magic\_signin, invite and reset, unless subtype says otherwise.

**subtype**

string

With type, comma-separated: otp or coupon for codes; verify, magic\_signin, invite, reset or other for links; or any.

### Header Parameters

**Proxy-Mail-QA-Run**

string format: uuid

A run’s id (POST /v1/runs): adds what this call saw to the run. If it can’t be added (the run finished, or isn’t in this project), the call still works and the Proxy-Mail-QA-Run-Warning response header says why.

**Proxy-Mail-QA-Test**

string

<= 600 characters

With Proxy-Mail-QA-Run: the test this call belongs to, percent-encoded (encodeURIComponent), up to 200 characters once decoded. The run’s report shows it beside what the call saw.

#### Example 

```plaintext
sign-up%20%E2%80%BA%20sends%20one%20code
```

## Responses

### 200

The count

Media typeapplication/json

### object

**address**

string

**since**

string | null format: date-time

**count**

integer

**emails**

The first 50, oldest first.

Array<object>

An email without its content: when it arrived, who sent it and the kind of its main code or link.

### object

**received\_at**

string format: date-time

**service**

Who sent it, e.g. Spotify.

string | null

**service\_domain**

string | null

**type**

string | null

Allowed values: code link

**subtype**

Otp or coupon; verify, magic\_signin, invite, reset or other.

string | null

**email\_id**

string format: uuid

#### Example 

```json
{
  "emails": [
    {
      "type": "code"
    }
  ]
}
```

### 400

An error

Media typeapplication/json

### object

**error**

string

**message**

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

### 404

An error

Media typeapplication/json

### object

**error**

string

**message**

string

#### Example generated

```json
{
  "error": "example",
  "message": "example"
}
```

[Previous Wait for a verification, sign-in, invite or reset link](https://proxymail.qa/docs/reference/operations/waitforlink.html) [Next Check that no email arrives](https://proxymail.qa/docs/reference/operations/expectnoemail.html)
