← Features
Product

Built to Be Queried, by You and Your Agents

A real REST API with scoped keys, one-line custom events, a universal payments endpoint, raw CSV/JSON export, a first-party proxy, and an MCP server so your coding agent can query your analytics.

4 min read

Most analytics treats developers as an afterthought: a script tag and a closed dashboard. Datalenk is built the other way around. A real REST API with scoped keys, events you fire in one line, a payments endpoint that accepts money from anywhere, your raw events on the way out, and an MCP server so you can ask your analytics questions straight from your coding agent.

What it does

  • A real REST API, with scoped keys: keys look like dlk_live_… and carry explicit scopes (read, write, export). Give your dashboard a read key, your backend a write key, your ETL an export key, and revoke any of them without breaking the others.
  • One-line custom events: datalenk.track('plan_upgraded', { plan: 'pro', mrr: 49 }). Every event inherits the visitor's channel, campaign and link attribution automatically.
  • A universal payments endpoint: POST /api/v1/payment. Twelve payment providers are native (Stripe, Paddle, LemonSqueezy, Polar, PayPal, RevenueCat, WooCommerce and more), and everything else, your homegrown billing, an affiliate network, an invoice you sent by hand, comes in through one call and is attributed like any other payment.
  • POST /api/v1/identify: weld a customer to their acquisition channel, for life and across devices. The email is HMAC-hashed server-side with a secret pepper and never stored in clear text. This is the single line that turns "Unattributed" revenue into revenue with a channel on it.
  • Server-side events: fire conversions and revenue from your backend, immune to ad blockers, which is where client-side tracking loses 40%+ of a technical audience. Same endpoint family, same event model.
  • Raw export: your events out as CSV or JSON. No lock-in, no "contact sales for data access". You brought the data, you can take it back.
  • Real-time payment alerts: a webhook into Slack or Discord that pings the channel the moment a payment lands, with the marketing channel that produced it attached. Cash register in your team chat.
  • First-party proxy: serve the script and collect events through your own subdomain (a CNAME, ten minutes), so ad blockers stop eating your data.
  • MCP server: connect Datalenk to Claude Code, Cursor or Codex and ask "which channel drove the most revenue last week" from your prompt. It is live, not a roadmap item.

How it works

Drop the script for browser events, or hit the API for anything server-side. Point your agent at the MCP server and query in natural language. The event model is identical whether the event comes from a browser, your backend or an agent, so nothing has to be reconciled later. Full reference on /docs/api.

Why this matters

Analytics that a machine can read is analytics your stack can act on: alert on it, gate a feature on it, feed it to an agent, pull it into a weekly report nobody has to build by hand. Most tools in this category still assume a human squinting at a chart. And for developer-heavy products, the server-side endpoint and the first-party proxy also recover the large slice of data that blockers strip out of client-only setups, which for a dev audience is not a rounding error.

Honest scope

Live today: the REST API with scoped keys, custom events, server-side events, the universal payments endpoint, identify, CSV/JSON export, the first-party proxy, Slack and Discord payment alerts, and the MCP server.

Not built, and we will not pretend otherwise: there is no CLI, and no official client libraries yet. It is a plain REST API over HTTPS with a bearer token, so curl and your language's HTTP client are all you need, but we are not going to describe that as an SDK.

Go deeper

How this powers AI traffic measurement: . How events power link attribution: .

Query your analytics from code, your server, or your agent. 14-day trial, card required, cancel in two clicks. Start your trial or read the API docs.

FAQ

Does Datalenk have an API? Yes. A REST API with scoped keys (read, write, export): query traffic, channels and revenue, send events and payments from your backend, and export your raw events as CSV or JSON. Documented on /docs/api.

Can my AI agent query my analytics? Yes. The MCP server is live. Connect it to Claude Code, Cursor or Codex and ask questions like "which channel drove the most revenue last week" in plain language, no dashboard required.

My billing is homegrown. Can I still get revenue attribution? Yes. POST /api/v1/payment with your workspace key takes any payment from any source and runs it through the same attribution engine as a native Stripe charge. A CSV import does the same for history.

Why server-side events? They are immune to ad blockers and ideal for payment and signup events, recovering the conversions client-side pixels lose, especially with a developer audience.

Is the API on every plan? Yes. Every feature is in every plan, including the $9 one. Plans differ on volume, number of sites, seats and retention, never on features.

Measure the money,
not the pageviews

Cookieless, EU-hosted analytics that ties every visit to the revenue it actually brought in. 14-day free trial.