Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent
with a free APIs.io key —
sign in with
GitHub,
Google or
LinkedIn.
No form to fill in; signing in shares your email address with us (Privacy).
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Zügle Ads API
version: 1.0.0
description: 'Zügle is a Swiss "does it pay off to move?" app. Paste a Flatfox/Homegate listing
link (or enter costs manually) to compare a candidate apartment against a current
home: monthly living costs, the Swiss income-tax delta between municipalities
(federal/cantonal/Gemeinde), commute time and cost, and a quality-of-living score.
The app has **guest mode**: several routes are reachable with no session cookie at
all. A guest supplies their own income/relationship/confession/children/current-home
figures on the request itself (query params or, for ingest, a `profile` body object)
and gets a computed result back — nothing about a guest request is ever persisted
server-side. The same routes behave differently for an authenticated household
member: caller-supplied profile values are ignored and the stored profile
(`p1`/`p2`) is used instead. Guest traffic is additionally throttled by a set of
in-memory, per-IP rate-limit buckets described on each public operation; an
authenticated caller using their own app is never subject to those buckets.'
contact:
name: Zügle
servers:
- url: http://localhost:8090
description: Local dev (npm run dev) or local prod (npm run prod) — both serve on :8090
- url: https://zuegle.com
description: 'Public production deployment. The VPS holds no open ports: a Cloudflare Tunnel (cloudflared) fronts localhost:8090, so TLS terminates at Cloudflare and the app runs with TRUST_PROXY_HOPS=1 / FORCE_HTTPS=1. Auto-deployed from the main branch.'
- url: https://zugle-vps.barbel-char.ts.net
description: The same VPS over the Tailscale tailnet — admin/debug access that does not depend on Cloudflare. Tailscale Funnel is OFF here; a tailnet member reaches this, the public internet does not.
security:
- cookieAuth: []
tags:
- name: Ads
description: First-party ("house") ad slot — impression selection and click-through.
paths:
/api/ads:
get:
operationId: getAd
summary: Get the currently active ad slot (public shape)
description: 'Public. One weighted-random active ad, already stripped of operator-only fields (weight/schedule/enabled/href), or `{ "ad": null }` when nothing is live. Guests are most of the traffic, which is why this route is public at all. Rate limit (guest only): general public-compute bucket, 60 requests / 5 min per IP.'
tags:
- Ads
security: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
required:
- ad
properties:
ad:
oneOf:
- $ref: '#/components/schemas/Ad'
- type: 'null'
example:
ad:
id: ad_1
headline: Umzugsfirma XY
body: Festpreis-Umzüge in der ganzen Schweiz.
image: null
label: Ad
'429':
$ref: '#/components/responses/RateLimited'
/api/ad-click/{id}:
get:
operationId: adClick
summary: Click-through redirect for an ad
description: Public via a path-prefix rule (not the exact-match PUBLIC set). Records a click server-side and issues a 302 redirect to the ad's target URL — this is a redirect response, not a JSON body, deliberately used instead of a client-side beacon so no cross-origin request is needed (connect-src is 'self'). No rate limit is applied to this route.
tags:
- Ads
security: []
parameters:
- $ref: '#/components/parameters/AdId'
responses:
'302':
description: Redirect to the ad's href.
headers:
Location:
schema:
type: string
format: uri
description: The ad's target URL.
'404':
description: Unknown ad id, or the ad has no href configured.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error: Unknown ad
components:
responses:
RateLimited:
description: Guest-mode rate limit exceeded for this route's bucket (or the shared general bucket).
headers:
Retry-After:
schema:
type: integer
description: Seconds until the oldest request in the window ages out.
content:
application/json:
schema:
$ref: '#/components/schemas/RateLimitError'
example:
error: Too many requests
retryAfterSec: 137
parameters:
AdId:
name: id
in: path
required: true
schema:
type: string
example: ad_1
schemas:
Ad:
type: object
description: Public-facing ad shape — GET /api/ads strips everything operator-only.
required:
- id
- headline
- body
- image
- label
properties:
id:
type: string
headline:
type: string
body:
type: string
image:
type:
- string
- 'null'
description: A data:image/... URI
or null.: null
label:
type: string
example: Ad
Error:
type: object
description: 'The base shape of every error response in this API: `{ error: <message>, ...extra }`, produced by throwing `ApiError(status, message, extra)` in server/app.js (caught centrally by handleRouteError) or, for unmatched routes, written directly by the dispatcher.'
required:
- error
properties:
error:
type: string
additionalProperties: true
RateLimitError:
description: A 429 from any of the guest-mode rate-limit buckets, or the login brute-force limiter.
allOf:
- $ref: '#/components/schemas/Error'
- type: object
required:
- retryAfterSec
properties:
retryAfterSec:
type: integer
description: Also sent as the Retry-After response header.
securitySchemes:
cookieAuth:
type: apiKey
in: cookie
name: zugle_session
description: 64-hex-character session token set as an HttpOnly, SameSite=Strict cookie by POST /api/auth/login. Routes NOT in the guest-mode public set return 401 with code SESSION_EXPIRED when it is missing or invalid.