`https://lumail.io/api/v1/tags/{tag}`

Retrieves a specific tag by its ID or name, including the subscriber count. This endpoint is perfect for displaying waiting list counters or tag-based statistics on your landing pages.

## Path Parameters

| Parameter | Type   | Description                                    |
| --------- | ------ | ---------------------------------------------- |
| `tag`     | string | **Required.** The tag ID or tag name to lookup |

## Response

- **Success (200 OK)** - Returns the tag object with subscriber count.
- **Error (404 Not Found)** - Tag not found

## Response Fields

| Field                  | Type   | Description                                                          |
| ---------------------- | ------ | -------------------------------------------------------------------- |
| `tag`                  | object | The tag object                                                       |
| `tag.id`               | string | Unique identifier for the tag                                        |
| `tag.name`             | string | Name of the tag                                                      |
| `tag.subscribersCount` | number | Number of subscribers with this tag (excluding unsubscribed/bounced) |

## Usage Example

Use this API endpoint to:

- Display waiting list counters on landing pages
- Show tag-based subscriber statistics in your dashboard
- Get subscriber counts for specific audience segments
- Build dynamic counters for marketing campaigns

### Landing Page Counter Example

```javascript
// Fetch subscriber count for waiting list
const response = await fetch("https://lumail.io/api/v1/tags/waiting-list", {
  method: "GET",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
const count = data.tag.subscribersCount;

// Update your landing page counter
document.getElementById("waiting-list-counter").textContent =
  `${count} people on the waiting list`;
```

### SDK Example

```typescript
import { Lumail } from "lumail";
const lumail = new Lumail({ apiKey: "YOUR_API_TOKEN" });

const { tag } = await lumail.tags.get("waiting-list");
console.log(`${tag.subscribersCount} people on the waiting list`);
```


## API Reference
**Method:** GET
**Endpoint:** /api/v1/tags/{tag}

### SDK
```ts
import { Lumail } from "lumail";
const lumail = new Lumail({ apiKey: "YOUR_API_TOKEN" });

const { tag } = await lumail.tags.get("waiting-list");
console.log(tag.subscribersCount);
```

### cURL
```bash
curl -X GET https://lumail.io/api/v1/tags/waiting-list \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

### JavaScript
```javascript
const response = await fetch('https://lumail.io/api/v1/tags/waiting-list', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python
```python
import requests

url = "https://lumail.io/api/v1/tags/waiting-list"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)
```

### Success Response
```json
{
  "tag": {
    "id": "tag_JqaddtEx7z",
    "name": "waiting-list",
    "subscribersCount": 42
  }
}
```

### Error Response
```json
{
  "error": "Tag not found"
}
```
