Get Tag by ID or Name
Retrieve a specific tag with subscriber count from your Lumail account
MethodGET
/api/v1/tags/{tag}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
// 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
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`);