REST API

A clean REST API your stack already speaks.

Create links, fetch click stats, manage Amazon affiliate tags and rotate API keys, all over plain HTTPS with JSON. The same surface that powers our dashboard and our native MCP server.

https://
  • Bearer token auth, JSON in / JSON out
  • Same endpoints power the MCP server
  • Full spec at docs.offerswap.com
  • Works with curl, Node, Python, n8n, Make, Zapier
WHY AN API

Most shortener APIs were designed before agents existed.

They use weird auth, undocumented response shapes, or hide the good endpoints behind a contact-sales page. We took the opposite path: every action you can take in the dashboard is an /api/* endpoint, every endpoint is in the public spec, and the MCP server we ship is just a thin wrapper around those same routes. Whether the caller is a curl loop, a Cloudflare Worker, or Claude on a Tuesday afternoon, the contract is identical.

Where it's used

One link. Every surface.

01

Bulk-import a product catalog

POST a CSV of Amazon URLs through /api/links, get back 8-char codes, push them into your spreadsheet or PIM. Your Amazon Associates tag goes on every Amazon link that does not already carry one.

02

Wire links into n8n / Zapier / Make

HTTP Request node, bearer header, JSON body. Trigger on a new RSS item, new Shopify product, or new row in Airtable, and let the workflow mint a branded short link in the background.

03

Dashboards and reporting

Hit /api/stats/overview for site-wide totals or /api/stats/link/:id for per-link breakdowns by country, device and referrer. Drop the JSON straight into Looker, Metabase or a Notion embed.

04

Server-side click logging

Pair the resolver with your own backend by mirroring click events into your warehouse. Every click record carries country, device, browser, referrer and the originating link code. No third-party pixel required.

What you get

Everything built in.

◆MCP

Same surface as the MCP server

Our npm package @offerswap/mcp wraps these exact endpoints. Anything an agent can do, a curl one-liner can do too, and vice versa. One API, two transports.

◉Dev

Bearer-token auth

Mint an API key from Settings → Account in the dashboard. Send it as Authorization: Bearer sk_live_… on every request. Rotate any time, instantly.

◐Core

Stats endpoints with real dimensions

Pull overview totals, time-series click counts, top countries, top devices, top browsers, top referrers, and a 7×24 hour heatmap, all from documented JSON endpoints.

✦Core

Campaigns, offers and postbacks

The ad tracker is in the API too: campaigns, offers, landing pages, traffic sources, split-test flows, and one postback URL that books sales, upsells and refunds against the click that earned them.

▲Dev

Cloudflare-fast edge resolution

The resolver runs on the Cloudflare edge network, with sub-100ms responses globally. The same network serves the API. No cold starts, no regional waiting room.

How it works

Three steps. That's it.

  1. 01

    Mint an API key

    Sign in, open Settings → Account, click "Create API key". Copy the sk_live_… token (you only see it once). Store it in your secret manager of choice.

  2. 02

    Make your first call

    curl -X POST https://app.offerswap.com/api/links with an Authorization: Bearer header and a JSON body containing destination_url. You get back a link object with an 8-char code field: the slug for your new short link.

  3. 03

    Read the full spec

    docs.offerswap.com hosts the OpenAPI spec, code examples in curl / Node / Python, and the same content as machine-readable llms.txt and llms-full.txt files for any AI agent reading along.

Sign in to the dashboard at app.offerswap.com, open Settings → Account, and click "Create API key". You can mint as many keys as you like and revoke any of them instantly. Every plan including the free tier gets API access.

JSON in, JSON out, over HTTPS. Send Content-Type: application/json on writes. We return standard HTTP status codes: 200/201 for success, 4xx for client errors with a JSON error message, 5xx if something is wrong on our end.

The free tier gets 60 requests per minute. Paid plans scale up from there. Rate-limit headers ship on every response so you can back off cleanly. Resolver traffic (the public /{code} redirects) is not rate-limited. It is what we are here to do.

The MCP server (npm: @offerswap/mcp) is a thin wrapper around this REST API. If you are writing code directly, hit the API. If you are letting Claude, Cursor or Cline drive, install the MCP package and they will hit the API on your behalf. Same auth, same data.

Not yet. Click events are pulled via the stats endpoints today. Webhooks for click events and link lifecycle are on the roadmap. If you need them now, poll /api/stats/link/:id on a cron; the response is cheap.

docs.offerswap.com. You will find the OpenAPI spec, endpoint reference, code samples, and the llms.txt / llms-full.txt files designed for AI agents to read directly.

Read the spec. Ship the integration.

Connect your agent in 30 seconds. One MCP install, no card.