Browse developer documentation
Terminal reports and exports
CLI documentation
Read reports, export JSON or CSV, and approve website setup from your terminal. Find every released command and its options below.
npm install -g https://www.attriboo.com/downloads/attriboo-cli-0.1.5.tgz
attriboo --version
attriboo login
attriboo sites list
attriboo reports overview --site shop.example.com --period 7d --jsonThe package is hosted by Attriboo. No npm account is required. After listing your websites, replace the example domain with a returned website ID or domain.
All commands
Installation and session
| Command | Purpose |
|---|---|
attriboo --help | Print the installed CLI's command list and supported options. |
attriboo --version | Print the installed CLI version. |
attriboo login | Open browser sign-in and save the approved workspace's rotating OAuth credentials. |
attriboo logout | Revoke the saved OAuth session and remove its local credentials file. |
attriboo whoami | Show the workspace and websites associated with the active credential. |
Websites
| Command | Purpose |
|---|---|
attriboo sites list | Discover the real website IDs, domains, currencies and timezones in your workspace. |
attriboo sites add | Create or reuse a website after confirming its details with the account holder. |
attriboo sites script | Retrieve a real website's snippet with its saved tracking and consent choices. |
attriboo sites verify | Inspect tracking activity timestamps and collection pause state. |
Reports
| Command | Purpose |
|---|---|
attriboo reports overview | Read headline revenue, traffic, conversion and advertising metrics with comparison changes. |
attriboo reports timeseries | Read traffic and revenue over daily, weekly, monthly or quarterly buckets. |
attriboo reports sources | Compare recorded marketing sources and their attributed revenue. |
attriboo reports channels | Compare channel groups such as Organic Search, Paid Ads and AI Referral. |
attriboo reports campaigns | Read campaign revenue, recorded costs and return on ad spend. |
attriboo reports pages | Read landing-page visits, AI referrals, crawler activity and revenue credit. |
attriboo reports hostnames | Group visitors by the hostname where they first arrived. |
attriboo reports countries | Read countries audience counts, conversion and revenue. |
attriboo reports cities | Read cities audience counts, conversion and revenue. |
attriboo reports devices | Read devices audience counts, conversion and revenue. |
attriboo reports browsers | Read browsers audience counts, conversion and revenue. |
attriboo reports os | Read operating systems audience counts, conversion and revenue. |
attriboo reports goals | Read goal completion counts and the revenue of visitors who completed each goal. |
attriboo reports realtime | Read visitors active in the last five minutes. |
attriboo reports sales | Read recorded payments and refunds, newest first, with observed attribution details. |
attriboo reports funnels | Read independent standard stages, list saved definitions, or inspect an ordered saved funnel. |
attriboo reports ai-search | Keep crawler activity, referred human visitors and revenue credit separate for each AI engine. |
attriboo reports time-to-purchase | Group purchases by time since a preceding recorded entry visit. |
Login, setup and CI access
attriboo login opens browser sign-in and requests analytics:read. Complete it on the same computer so the temporary loopback callback can return. --no-browser prints the link for you to open on that computer.
For website creation, script retrieval or verification, run attriboo login --setup and complete the separate owner/admin approval for sites:write. It does not buy an upgrade, deploy your website or connect a payment provider.
On a remote server or CI machine, configure ATTRIBOO_API_KEY privately for reports. It takes precedence over saved OAuth tokens and cannot use setup endpoints. Remove that override when you intend to use your approved setup session. There is no device-code login flow.
Report flags
Each command page lists the flags that affect that command. The parser recognizes shared flags globally; an unrelated flag is not evidence a command supports that behavior. Use the documented command-specific options.
| Field | Type | Description |
|---|---|---|
--site | string | Website ID or domain. Required when the workspace has more than one website. |
--period | string | UTC date selection. from and to override period. Values: realtime, today, yesterday, 7d, 30d, 90d, 12m, wtd, mtd, qtd, ytd, all. Default: |
--from | string | Inclusive start date. Supply to as well. |
--to | string | Inclusive end date. Supply from as well. |
--compare | string | Comparison range. Values: previous_period, mom, qoq, yoy, none. Default: |
--model | string | How recorded sources share revenue credit. Values: first_touch, last_touch, linear, time_decay. Default: |
--filters | string | JSON array string of up to twenty visitor filters, for example [{"dim":"country","op":"is","value":"US"}]. Dimensions: source, channel, campaign, entry_page, page, hostname, country, device, browser, os, goal. Operators: is, is_not. Values are exact strings up to 500 characters. All filters must match the visitor across available history; report dates then select activity for that cohort. Unmatched payments are excluded. Crawler counts remain website-wide; spend requires every filter to be source/channel/campaign. Preserve filters when paging. |
--json | boolean | Compact JSON instead of formatted JSON. |
--csv | boolean | CSV for the main row collection; nested values remain JSON cells. Cannot be combined with --json. |
--granularity | string | Requested bucket size. Values: daily, weekly, monthly, quarterly. Default: |
--limit | integer | Maximum rows where supported. Default: |
--cursor | string | A returned next_cursor. Keep the same website, report, dates, model, visitor filters and funnel selection. |
--funnel | string | Omit for standard stages; saved lists definitions; a saved funnel UUID reads its exact ordered results. |
Money stays in integer cents in the website currency. The dedicated realtime command always reads a five-minute window. It does not take a historical date selection.
Output, pagination and shell examples
The CLI prints the API’s data directly, without the REST status/data envelope. sites script prints only the snippet unless you select JSON or CSV. Errors go to stderr with an Attriboo: prefix; check the exit code before consuming stdout.
CSV selects the main returned row collection. Nested values remain JSON cells; text that could be interpreted as spreadsheet formulas is escaped. Empty row collections produce empty CSV. Pagination is manual: CSV contains only the returned page.
attriboo reports sources --site shop.example.com --period 30d --csv > sources.csvattriboo reports sales --site shop.example.com --from 2026-10-01 --to 2026-10-07 --compare none --limit 50 --json
attriboo reports sales --site shop.example.com --from 2026-10-01 --to 2026-10-07 --compare none --limit 50 --cursor NEXT_CURSOR --jsonReplace NEXT_CURSOR with the response’s value. Preserve the report, site, dates, model and funnel selector. Some small-site reports omit a cursor; that does not guarantee every stored record was exported. Detailed and breakdown cursors expire after 24 hours, and live continuation pages preserve the original window.
Examples use ordinary shell syntax. For Bash, check $?; in PowerShell, check $LASTEXITCODE. Follow your shell’s encoding rules when saving CSV.
Environment and saved credentials
| Environment variable | Behavior |
|---|---|
ATTRIBOO_API_KEY | Private workspace key. Takes precedence over saved OAuth credentials; can read reports but cannot authorize website setup. |
ATTRIBOO_URL | Service origin. Defaults to https://www.attriboo.com. Only HTTPS or loopback HTTP is accepted; no path, query, fragment or embedded credentials. |
ATTRIBOO_CONFIG_DIR | Private alternative directory containing credentials.json. |
LOCALAPPDATA | Windows default credentials directory: %LOCALAPPDATA%/Attriboo/credentials.json; falls back to the user home when unavailable. |
XDG_CONFIG_HOME | Non-Windows default credentials directory: $XDG_CONFIG_HOME/attriboo/credentials.json; otherwise ~/.config/attriboo/credentials.json. |
Credentials are kept under your user profile, never in the website project. POSIX files use 0600 permissions and the created folder uses 0700; Windows inherits the user profile’s permissions. Do not commit or share the credentials file.
The CLI refreshes expiring OAuth tokens and stores the replacement. Saved credentials are not sent to a different service origin. Authentication requests do not follow redirects.
attriboo logout revokes the saved refresh-token session and removes the credentials file. If revocation fails, it retains the file so you can retry. It does not remove or rotate a separate environment key.
Exit codes and troubleshooting
| Code | Meaning |
|---|---|
| 0 | Command completed. Read the result to confirm the intended outcome. |
| 1 | Invalid command/input, authentication failure, permission error or request failure. |
| 2 | sites verify returned waiting or paused. Tracking verification is pending. |
For unknown commands, run attriboo --help. For an expired or revoked grant, run login again. For setup permission failures, approve setup with the current workspace owner/admin and check for an environment key overriding OAuth.
Reports share the API’s 120-requests-per-minute-per-credential-per-instance limit. The CLI does not promise automatic retry for rate or capacity errors. Retry reads with bounded backoff or shorten the date range; never replace a failed report with zeros.