API overview
The AffilFinder REST API at a glance — auth modes, base URL, rate limits, and links to each endpoint group.
On this page
Everything AffilFinder does is driven by its public REST API. The widget calls it. Your dashboard calls it. You can too — for server-rendered offers, custom UIs, server-to-server integrations, or automation.
For the full interactive reference with request/response schemas, see /docs/api which is powered by our OpenAPI spec and lets you try requests directly from the browser.
Base URL
https://api.affilfinder.comAll endpoints are versioned under /v1/. We never remove or change a /v1/ response shape; breaking changes ship under /v2/ when they're needed.
Authentication
Two distinct modes depending on what you're calling:
Widget / public endpoints — Public key + Origin
Endpoints called from the browser authenticate with:
- Your public key (
pk_…) passed in the URL as?pub=. - Your website key (
web_…) passed as?website=. - The browser's
Originheader, which must match the domain registered on the website.
No Authorization header needed. The widget handles this automatically when you pass data-pub and data-website.
Server / private endpoints — Integration secret bearer
Server-to-server endpoints (today: POST /v1/widget-decline/trigger) authenticate with:
Authorization: Bearer its_your_integration_secretIntegration secrets (its_…) are generated per website from the website's decline settings in the dashboard. Each secret is scoped to one website; revoke and rotate at will without affecting other sites.
Request format
- Method + path — standard REST. Decision and offers use
GETwith query parameters; events and triggers usePOSTwith JSON bodies. Content-Type—application/jsonworks on every POST. The widget usestext/plainfor/v1/events/*so the browser skips the CORS preflight — the API parses both.- Origin — required on browser calls; must match the website's registered domain.
Response format
- 2xx — success. JSON body shape documented per endpoint.
- 204 No Content — success with no body. Used by
/v1/events/impression,/v1/events/click,/v1/events/snippet-ping. - 4xx — client error. Body:
{ "error": "human-readable message" }(plus occasionally a short machine-readablereason). Status 400 = bad request, 401 = auth missing, 403 = auth invalid or origin not allowed, 404 = resource not found, 429 = rate-limited. - 5xx — our problem. Include a recent response body in your support ticket.
GET /v1/decision and GET /v1/offers set Cache-Control: no-store — decisions and offer lists are per-request.
Rate limits
Rate limits are applied per source IP over a 60-second rolling window:
| Endpoint class | Limit | Notes |
|---|---|---|
GET /v1/decision | 120 / min / IP | One per page view on the happy path. |
GET /v1/offers | 120 / min / IP | One per rendered offer list. |
POST /v1/events/impression | 200 / min / IP | One per offer rendered. |
POST /v1/events/click | 200 / min / IP | One per click. |
POST /v1/events/snippet-ping | 200 / min / IP | One per page load. |
/v1/widget-decline/* | 120 / min / IP | Decline session + poll. |
Rate-limited requests return 429 Too Many Requests with standard rate-limit response headers. If you hit a limit in production, reach out and we'll look at it.
Endpoint groups
Decision & offers
/v1/decision, /v1/offers — the core real-time geo + offer matching.
Events
/v1/events/snippet-ping, /events/impression, /events/click — attribution signals.
Redirects
/v1/r — signed, attributed outbound link.
Decline widget
Session, trigger, and poll — the async decline protocol.
SDK?
Not yet. The API is small enough that a plain fetch or any HTTP client works well. If you'd like an official SDK in a specific language, let us know — we prioritize based on request volume.
Community SDKs (none official) may exist on npm or PyPI; we don't certify those.
Versioning
All endpoints live under /v1/. Breaking changes would ship under a new major (/v2/) with a deprecation window communicated via email. Non-breaking additions (new fields, new endpoints) land continuously — you don't need to do anything for those.
Related
Interactive API reference
Live request/response explorer powered by our OpenAPI spec.
Widget integration reference
Using the API through the widget — data-* attributes, events, and hooks.
Debugging
Common errors, what to check first, and how to share evidence with support.
Contact support
SDK requests, higher rate tiers, enterprise contracts.
Need more help?
Can't find what you're looking for? Our team responds within one business day.