Terminal clients pull ads from the same pool as websites: one GET request per run, the response is ready-to-print text for stdout. The impression counts immediately, no session needed.
Add a TUI / CLI sitePick the “TUI / CLI” type in the cabinet. Instead of a domain, enter a program identifier, e.g. myapp-cli.
Request an adOne curl or one HTTP request from your program. One request is one impression, no dedupe.
Clicks via the short linkThe response carries a url like /v1/click/… Open it in the visitor's browser: it redirects to the advertiser and the click counts.
When no ad fits: json returns ad: null, text and ansi return an empty 204. Your script should just exit.
Attributes
The script fills hooks inside the slot. With no hooks it builds a simple link. Ad title and text are required; image is optional.
data-hads-slot
Slot container. The value is the slot name (for your analytics and layout).
data-hads-topic
Free-form topical hint for the page/context. The engine maps it to the topic catalog in the background and prefers matching ads; blank, not-yet-mapped, or unmatched hints are ignored.
data-hads-allow-self
Allow ads from your other sites in the same account (the current site is still excluded). Presence of the attribute, or true / 1 / yes, enables it.
data-hads-title
Filled with the ad title.
data-hads-text
Filled with the ad body text.
data-hads-url
Ad link (href). Empty <a> gets the advertiser domain; your own text or nested title/text/image hooks are kept. Prefer <a data-hads-url></a> (not <a …/>): <a> is not void; the script drops spare empty anchors from self-closing markup.
data-hads-source
Domain name of the site that owns the ad. Hook inside the link: <a data-hads-url><svg…></svg><span data-hads-source></span></a>. If the link only has element children (no text, no source hook), the script appends <span class="hads-source">.
data-hads-attribution
Optional credit link to HADS. An empty <a data-hads-attribution></a> becomes a hads.dev link labelled hads.dev; custom text inside the link is preserved.
data-hads-image
Image URL (src on <img>). JPEG/PNG/WebP, max 100 KB. Prefer 16:9; use object-fit: cover in the slot.
Images
An image on the ad is optional. When set, the engine validates the file, uploads it to storage, and replaces the URL with a public CDN link.
Formats: JPEG, PNG, WebP.
File size must be 100 KB or less.
Prefer 16:9 (e.g. 1200×675). Example slots: card 16:9, row thumb 1:1 — cover crops the edges, keep the subject centered.
Source URL must be http(s); after upload the ad stores the CDN URL.
In slot CSS set a frame (16:9 or 1:1) and object-fit: cover so one image fits different slots without stretching.
/* Fit any source size into the slot frame */[data-hads-image]{display: block;width: 100%;height: 100%;object-fit: cover;object-position: center;}
Slot layout
Ad content is injected asynchronously. Lock the slot geometry up front so the page does not jump when the creative arrives.
Give the slot a target size: min-height and max-width if needed, so space for the ad is reserved immediately.
Always size the image frame (aspect-ratio or width/height) with object-fit: cover — the box stays stable when src appears.
Clamp title and body lines and set min-height so units with different copy length stay even.
Style an empty slot like a filled one: same padding and height until the script fills the hooks.
Put a skeleton — gray placeholder bars — inside the title/text hooks: the script replaces their content entirely, so the bars go away when the ad arrives.
<asidedata-hads-slot="inline"class="hads-unit hads-unit--inline"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p><adata-hads-url></a></aside>
Ready-made slots
Pick a format, check the preview, then copy HTML, Tailwind, or CSS. The markup already includes skeletons inside title/text — the script replaces them with the ad.
Text block
Classic in-article unit: label, title, body, and link.
<asidedata-hads-slot="inline"class="hads-unit hads-unit--inline"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p><adata-hads-url></a></aside>
Image card
Vertical card when the ad includes an image.
<asidedata-hads-slot="card"class="hads-unit hads-unit--card"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><imgdata-hads-imagealt=""/><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p><adata-hads-url></a></aside>
Row with thumb
Compact horizontal block for lists and sidebars.
<asidedata-hads-slot="row"class="hads-unit hads-unit--row"><imgdata-hads-imagealt=""/><divclass="hads-unit-body"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p><adata-hads-url></a></div></aside>
Teaser link
The title is the link — minimal chrome.
<asidedata-hads-slot="teaser"class="hads-unit hads-unit--teaser"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><adata-hads-url><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong></a><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p></aside>
Narrow rail
For a side column: short copy and a clear CTA.
<asidedata-hads-slot="rail"class="hads-unit hads-unit--rail"><adata-hads-attributionclass="hads-unit-attribution">Ads by HADS</a><strongdata-hads-title><spanclass="hads-unit-skeleton hads-unit-skeleton--title"aria-hidden="true"></span></strong><pdata-hads-text><spanclass="hads-unit-skeleton hads-unit-skeleton--text"aria-hidden="true"></span><spanclass="hads-unit-skeleton hads-unit-skeleton--text hads-unit-skeleton--text-short"aria-hidden="true"></span></p><adata-hads-url></a></aside>