Tags
Tags are flat keywords you can assign to your posts to classify them flexibly. Unlike categories, tags are not hierarchical — they are a plain list. They are perfect for building tag clouds, tag pages and flexible filtering systems that don't fit neatly into a tree structure.
GET /tags — Tag listing
Returns all tags for the website as a flat array. This endpoint has no pagination — it always returns the full list, because tags are lightweight data and there are typically at most a few dozen of them. The response is ordered alphabetically by name.
| Parameter | Type | Required | Description |
|---|---|---|---|
web_id | string | Yes | Website ID |
lang | string | No | Language code |
curl "https://your-panel.com/api/v1/tags?web_id=abc-123&lang=en" \
-H "X-API-Key: your-api-key" Expected response 200 OK
{
"data": [
{ "id": "tag-001", "nombre": "REST API", "slug": "rest-api" },
{ "id": "tag-002", "nombre": "Headless", "slug": "headless" },
{ "id": "tag-003", "nombre": "Astro", "slug": "astro" }
]
} Response fields
| Field | Type | Description |
|---|---|---|
id | UUID | Unique identifier |
nombre | string | Tag name |
slug | string | URL-friendly string |
Tags vs categories: when to use each. Use categories when your content has a clear hierarchical thematic structure — for example, "Technology > Frontend > CSS". Use tags for cross-cutting classifications that don't fit into that hierarchy — for example, "tutorial", "opinion", "resource", "video". A post can belong to a single category but have multiple tags. Tags are also useful for grouping a series of related articles without needing to create a new subcategory.
To render a tag cloud in your frontend, call this endpoint and map over the array. You can sort by name or assign random font sizes if you don't have a popularity count field:
// Example: tag cloud (without popularity count)
const { data: tags } = await fetch('/api/v1/tags?web_id=...').then(r => r.json())
// Render in HTML (vanilla JS)
const cloud = tags.map(tag =>
`<a href="/blog/tag/${tag.slug}" class="tag">${tag.nombre}</a>`
).join(' ')
document.getElementById('tag-cloud').innerHTML = cloud Use cases
Tag cloud in the blog. Fetch all tags and render them as links in the sidebar or at the bottom of the blog. Each tag links to its filtered listing page.
/tag/[slug] pages. Generate a static route for each tag and use the tag parameter from the posts endpoint to filter: /api/v1/posts?web_id=...&tag=headless. Combine both calls to have the tag name and its posts.
Tags as article series. Create a tag per article series — for example, "vue-3-series" — and assign it to all posts in that series. You can then easily display all posts in the series anywhere using the tag filter.
Client-side filtering. Load all posts and all tags at startup and filter on the client with no additional requests. This strategy works well with small collections (fewer than 200 posts) and avoids load times on each filter change.
Tips and best practices
- Don't create too many tags. A cloud of 100 tags is hard to navigate and loses its usefulness. Try to keep tags below 30–40 to make navigation meaningful.
- Use consistent lowercase slugs. Having "rest-api" and "REST API" as separate tags will unnecessarily split your content. Manage tags from the panel with editorial criteria.
- Cache this endpoint with a long TTL — tags change rarely. Invalidating the cache when a new post with new tags is published is sufficient.
- Tags have no description or image. If you need to enrich tag pages with introductory text, store that content in your own frontend or use a category with a description instead.
Common errors
| Code | Likely cause | Fix |
|---|---|---|
401 | API Key not included or incorrect | Check the X-API-Key header and that the key is active |
400 | Missing web_id parameter | Include web_id in the query string |
200 with data: [] | The website has no tags yet | Tags are created when you assign them to posts from the post editor |
See also
- Posts — filter posts by tag using the
tagparameter - Categories — hierarchical organisation of content