Authentication

Every request needs a key. Public keys are for browsers and bound to your domains, secret keys are for servers.

Two kinds of keys

Public pk_…Secret sk_…
UseBrowser, HTML, Web Component, mobile webServers, cron jobs, scripts
Origin checkyes, listed origins onlyno
Safe in HTMLyesnever
Without an Origin header (curl, server)403 origin_not_allowedworks

A public key is not a secret. It sits in your page's source and anyone can read it. That is fine, because the API only accepts it for requests from your domains.

A secret key checks no origin. Whoever has it can use up your quota. Keep it in an environment variable, never in code, a repository or a frontend bundle.

Important: if a secret key leaks, create a new one in the dashboard and delete the old one.

Sending the key

Preferably in the Authorization header:

HTTP
GET /v1/search?q=Zytglogge HTTP/1.1
Host: api.findort.ch
Authorization: Bearer sk_…

Where you cannot set headers, public keys also work as the key parameter:

Shell
curl "https://api.findort.ch/v1/search?q=Zytglogge&key=pk_…"

If you send both, the header wins. Secret keys (sk_) are accepted in the header only: in a URL they end up in logs and browser histories, and the API answers 400 secret_key_in_url. The libraries and the Web Component always use the header.

Allowed origins

For a public key you keep a list of allowed origins. The API compares it with the request's Origin header. If that header is missing, it takes the origin from the Referer.

EntryMatchesDoes not match
https://shop.example.chexactly this origin (scheme, host and port)http://shop.example.ch, https://www.example.ch
*.example.chexample.ch and every subdomain like shop.example.ch or a.b.example.ch, over http and httpsexample.com, shop.example.ch:8443
shop.example.chhost shop.example.ch with any schemewww.shop.example.ch
http://localhost:5173your local dev serverother ports
*every origin

A *. wildcard only covers addresses without a port. For a dev server with a port, add the full origin, for example http://localhost:8080.

Tip: * makes a public key usable on any website. Use it for a quick test at most.

If the origin does not match, the API answers with 403 and tells you which origin it saw:

JSON
{
  "error": {
    "code": "origin_not_allowed",
    "message": "Origin https://staging.example.ch is not allowed for this key"
  }
}

CORS

The API accepts requests from any website (Access-Control-Allow-Origin: *). Only the key decides whether a request gets through. Requests with an Authorization header make the browser send a preflight request (OPTIONS). The API answers it without a key and lets the browser cache it for 24 hours.

Rate limit headers

Every response to a valid request carries these headers:

HeaderMeaning
X-RateLimit-Limitrequests per minute for this key
X-RateLimit-Remaininghow many requests you have left right now
Retry-Afteronly with 429 rate_limited: seconds until the next try

The limit refills continuously, not after a full minute. If you send a burst, you only wait a few seconds afterwards. Browsers can read the headers, the API exposes them via CORS.

HTTP
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 0
Retry-After: 2

The per-minute limit is separate from your plan's monthly quota. Both are covered in limits.