Docs
Add Datawyre to a site, then read your numbers from your own server or AI.
Add the script
<script defer src="https://data.postwyre.com/s.js" data-site="YOUR_SITE_ID"></script>Prove the site is yours
- A tag on your home page
<meta name="datawyre-verify" content="your code">in the head ofhttps://example.com/. The check reads the head of that page, following up to 3 redirects on the same site, and finds the tag only as a real tag there, not in a comment, a script or the body. It passes as soon as the page is live. Steps for each website builder.- Or a file
- Your code, and nothing else, at
https://example.com/.well-known/datawyre.txt. The check passes as soon as the file is live. - Or a DNS record
- A TXT record at
_datawyre.example.comwith the valuedatawyre-verify=your code. DNS can take a few minutes to show.
If an ad blocker stops the script
<script defer src="/_dw/s.js" data-site="YOUR_SITE_ID"></script>Sign your signups
import { createHmac } from "node:crypto";
const sig = createHmac("sha256", process.env.DATAWYRE_SIGNUP_SECRET).update("signup." + userId).digest("hex");window.tfa("signup", { uid: "<user id>", sig: "<sig from your server>" })Brand tokens
- Read token
- Reads the brand, its sites, visits, breakdowns, the workspace report and dashboards.
- Admin token
- Also adds, verifies and removes sites, saves and deletes dashboards, and makes tokens with
POST /v1/brand/tokens. - Agent powers
- Off for every token until you turn them on in Agent keys. They let an admin token make proxy keys and the signup secret, revoke tokens, export your data and delete a person's data. Revoking a token waits for you to approve it, unless you turn off Ask me first for that key.
- Another brand
- A token reaches its own brand only. Anything of another brand's gets 404, the same answer as something that does not exist.
Read your numbers
GET /v1/brand- Your brand, your role and its sites.
GET /v1/brand/visits?days=30- Visitors and page views by people per UTC day, today included. days is 1 to 400.
GET /v1/brand/breakdown?by=source- The same traffic grouped by one of source, medium, campaign, referrer, page, country, device, browser, os, goal. Up to 50 rows, most visitors first.
GET /v1/brand/sources- Where visitors came from, what is kept apart as internal and what is filtered, each with its reason.
GET /v1/brand/report?workspace_id=<brand>&period=7d- The last 7 or 30 days against the period before. workspace_id is your own brand id.
Connect your AI
Continue with Postwyre
claude mcp add --transport http datawyre https://data.postwyre.com/mcpWith a brand token
claude mcp add --transport http datawyre https://data.postwyre.com/mcp --header "Authorization: Bearer dwb_your_token"