Skip to main content
The analytics endpoint provides a comprehensive overview of your payment performance, including revenue totals, customer counts, conversion rates, and breakdowns by day, payment link, token, and chain.
The analytics endpoint requires read permission.

Authentication

Authorization: Bearer asp_xxx
Base URL: https://platform-api.anyspend.com/api/v1

Endpoints

Get Analytics Overview

GET /analytics/overview
read
Returns an aggregated analytics overview for the specified time period.
string
Time period for metrics. One of: 7d, 30d, 90d, all. Defaults to 30d.
curl -X GET "https://platform-api.anyspend.com/api/v1/analytics/overview?period=30d" \
  -H "Authorization: Bearer asp_xxx"
Response
{
  "success": true,
  "data": {
    "revenue": {
      "period_usd": 45230.50,
      "period_transactions": 312,
      "all_time_usd": 182450.75,
      "all_time_transactions": 1847
    },
    "customers": {
      "total": 892,
      "new_in_period": 156
    },
    "payment_links": {
      "total": 24,
      "active": 18
    },
    "conversion_rate": 0.68,
    "daily": [
      {
        "date": "2026-02-27",
        "transactions": 14,
        "revenue_usd": 1820.00
      },
      {
        "date": "2026-02-26",
        "transactions": 18,
        "revenue_usd": 2340.50
      },
      {
        "date": "2026-02-25",
        "transactions": 11,
        "revenue_usd": 1450.25
      }
    ],
    "top_payment_links": [
      {
        "id": "pl_abc123",
        "name": "Pro Plan Monthly",
        "revenue_usd": 12500.00,
        "transactions": 125
      },
      {
        "id": "pl_def456",
        "name": "Enterprise Annual",
        "revenue_usd": 9800.00,
        "transactions": 14
      },
      {
        "id": "pl_ghi789",
        "name": "Starter Pack",
        "revenue_usd": 7200.00,
        "transactions": 96
      }
    ],
    "top_tokens": [
      {
        "symbol": "USDC",
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "chain_id": 8453,
        "revenue_usd": 32100.00,
        "transactions": 245
      },
      {
        "symbol": "ETH",
        "address": "0x0000000000000000000000000000000000000000",
        "chain_id": 8453,
        "revenue_usd": 8400.00,
        "transactions": 42
      }
    ],
    "top_chains": [
      {
        "chain_id": 8453,
        "name": "Base",
        "revenue_usd": 38200.00,
        "transactions": 278
      },
      {
        "chain_id": 1,
        "name": "Ethereum",
        "revenue_usd": 7030.50,
        "transactions": 34
      }
    ]
  }
}

Response Fields

Revenue

FieldTypeDescription
period_usdnumberTotal revenue in USD for the selected period
period_transactionsnumberNumber of completed transactions in the period
all_time_usdnumberTotal lifetime revenue in USD
all_time_transactionsnumberTotal lifetime transaction count

Customers

FieldTypeDescription
totalnumberTotal unique customers (by wallet address)
new_in_periodnumberNew customers acquired in the selected period
FieldTypeDescription
totalnumberTotal payment links created
activenumberCurrently active payment links

Conversion Rate

FieldTypeDescription
conversion_ratenumberRatio of completed checkouts to initiated sessions (0.0 to 1.0)

Daily Breakdown

Each entry in the daily array contains:
FieldTypeDescription
datestringDate in YYYY-MM-DD format
transactionsnumberCompleted transactions on that date
revenue_usdnumberRevenue in USD on that date
Ranked by revenue within the selected period:
FieldTypeDescription
idstringPayment link ID
namestringPayment link name
revenue_usdnumberRevenue in USD
transactionsnumberNumber of transactions

Top Tokens

Ranked by revenue within the selected period:
FieldTypeDescription
symbolstringToken symbol (e.g., USDC)
addressstringToken contract address
chain_idnumberChain ID where token was received
revenue_usdnumberRevenue in USD
transactionsnumberNumber of transactions

Top Chains

Ranked by revenue within the selected period:
FieldTypeDescription
chain_idnumberChain ID
namestringChain name
revenue_usdnumberRevenue in USD
transactionsnumberNumber of transactions

Period Options

ValueDescription
7dLast 7 days
30dLast 30 days (default)
90dLast 90 days
allAll time
The daily array returns one entry per day for the selected period. For all, the daily array is capped at the most recent 90 days.

Example: Dashboard Chart

const analytics = await client.analytics.overview({ period: "30d" });

// Plot daily revenue
analytics.daily.forEach(({ date, revenue_usd, transactions }) => {
  console.log(`${date}: $${revenue_usd.toFixed(2)} (${transactions} txns)`);
});

// Display conversion rate as percentage
console.log(`Conversion: ${(analytics.conversion_rate * 100).toFixed(1)}%`);

// Show top performing payment link
const top = analytics.top_payment_links[0];
if (top) {
  console.log(`Best link: ${top.name} - $${top.revenue_usd.toFixed(2)}`);
}