Analytics API

Your site statistics, in Claude or your own tools

Connect Claude to your site's performance statistics, or pull them into your own dashboards with an API key. Read-only, one site per key.

Overview

Every verified site can read its own performance statistics in two ways:

  • AI assistants (MCP). Connect Claude to your site and ask questions in plain language: “Which posts had the best cook rate in the last two weeks?” or “What are readers asking that my posts don't answer?”
  • Analytics API. Pull the same statistics into your own dashboards, spreadsheets, or scripts with an API key.

Both cover the same data: post performance (visits, how many readers reached the recipe, cooked, or saved), reader journeys between posts, and the questions readers ask the on-site assistant.

Access is read-only and scoped to one site per key or connection. Nothing can change your site or settings through it, and no individual reader data is included.

Not available for ecosystem sites.

Sites that are part of an Allspice ecosystem can't create keys or connections. The Analytics API card says so on those sites.

Where to find it

In the Publisher Portal, go to Integrate, click your domain, and open the Connections tab. Two cards cover this page:

  • Analytics API - create, copy, and revoke API keys for this site.
  • AI Assistants (MCP) - step-by-step instructions for connecting Claude.

Connect Claude

This works in Claude on the web, the Claude desktop app, and Claude Code. The first option doesn't need an API key.

Claude on the web or desktop (recommended)

  1. In Claude, open Settings → Connectors → Add custom connector.
  2. Name it Allspice Analytics and paste this URL. Leave the optional OAuth fields empty.
    Connector URL
    https://analytics-mcp.allspicelabs.com/mcp
  3. Click Connect. You'll land in the Publisher Portal. Sign in if asked, choose the Site to share, and click Approve.
  4. Ask a question, for example “What were my top posts by cook rate in the last two weeks?”, and allow the tool when Claude asks.

Each connection reads one site. To connect another site, add the connector again and pick that site on the approval screen. To disconnect, remove the connector in Claude's settings.

Claude Code, or other tools, with an API key

If you'd rather use a key (for example in Claude Code), create one in the Analytics API card, then run:

Claude Code
claude mcp add --transport http allspice-analytics https://analytics-mcp.allspicelabs.com/mcp --header "Authorization: Bearer YOUR_KEY"

The same URL and Authorization header work in other MCP clients that support remote (Streamable HTTP) servers.

Getting good answers

  • Give a date range: “last 14 days”, “September 1 to 15”. Any window up to 31 days works.
  • Name a post by its URL when you want detail on one post.
  • Ask comparative questions: “Which posts cook better than expected for their traffic?” or “Where do readers go after my lasagna post?”
  • Ask about gaps: “What questions are readers asking that my content doesn't cover?”

API keys

Create a key

  1. In the Analytics API card, optionally enter a Key label (up to 60 characters) describing what will use it.
  2. Click Create API key.
  3. Click Copy key and store it somewhere safe, then click Done.
The key is shown once.

Allspice doesn't store the key itself, so it can't be shown again. If you lose it, revoke it and create a new one.

Manage keys

  • Keys start with asx_live_ and work for this site only.
  • Each site can have up to 5 active keys. Revoke one to create another.
  • The key list shows each key's label, when it was created, and who created it.
  • Revoke a key at any time. Anything using it stops working within a few minutes. Revoking can't be undone; revoked keys stay in the list, marked Revoked.

Using the API

Send the key as a bearer token. All endpoints are GET requests under:

Base URL
https://analytics-mcp.allspicelabs.com/v1
Example
curl -H "Authorization: Bearer YOUR_KEY" \
  "https://analytics-mcp.allspicelabs.com/v1/posts?start=2026-09-01&end=2026-09-14&sort=cook_rate&limit=25"
EndpointWhat it returns
/postsPosts ranked by performance. Options: sort (cook_rate, visits, reached_rate, saved_rate; default cook_rate), limit (1-100, default 25), offset, page_type (recipe or all; default recipe), min_visits.
/posts/detailEverything about one post: outcomes, expected cook rate, rank among your posts, reader journeys in and out, and estimated value. Pass url_key.
/posts/dailyDay-by-day numbers, for the whole site or one post (url_key). Paged with cursor and page_size (1-500, default 200).
/posts/flowsPost-to-post reader journeys within a visit, with outcomes at the destination. limit up to 1000.
/chat/summarySite-wide summary of reader conversations with the on-site assistant.
/chat/questionsQuestions readers asked on one post (url_key), plus topics your content didn't cover.

What the numbers mean

AI assistants read these definitions before explaining any number, so their answers use the same meanings.

MetricMeaning
VisitsPage loads, with bots excluded. A reload counts twice, so visits are not sessions.
Reached recipeShare of visits where the recipe card actually appeared on screen (not scroll depth). Blank for the whole site if your theme's recipe card can't be detected.
CookedVisits that became cooking sessions: roughly 5 minutes with the recipe card on screen, or starting guided cooking.
SavedVisits where the reader saved the recipe for later: save, print, copy, or add to a list.
CommittedCooked plus saved.
ResearchedSpent real time on the post but didn't cook or save.
Left from top / left at recipeLeft quickly without ever seeing the recipe card, or reached the card and then left quickly.
OutcomesCooked, saved, researched, left from top, and left at recipe split a post's visits and add up to about 100%.
Expected cook rateA benchmark adjusted for the post's traffic mix, so you can see which posts over- or under-perform. Blank when there isn't enough data, or on non-recipe pages.
AssistsCooks a post generates on other posts, by sending readers there.
FlowsMoves from one post to another in the same visit, with what happened at the destination.
RhythmWhen readers cook, by day of week and time of day, in the reader's local time.
Questions & gapsA sample of what readers asked the on-site assistant, newest first, and the question themes your content didn't cover. Exact wording is kept only for questions your content didn't answer.
Estimated valueAn estimate calculated from the RPMs you entered in the portal. It is not measured revenue, and is missing if you haven't entered RPMs.
Blank is not zero.

A blank (null) rate means there isn't enough data to report one. It doesn't mean zero, so don't average it as zero.

Dates & data freshness

  • Dates are UTC calendar days, and both start and end are included.
  • A single request can cover up to 31 days.
  • Statistics are rebuilt daily. Every response includes data_through (the last day with data) and data_from (when measurement began for your site). Days outside that window have no data yet; they are not zeros or an outage.

Limits & errors

Each key can make about 60 requests per minute. Past that you'll get a 429 with a Retry-After header.

ResponseWhat it means
401 API key requiredNo Authorization: Bearer header, or the key is malformed.
401 Unknown API keyThe key isn't recognized. Check you copied it in full.
403 This API key has been revokedCreate a new key in the portal.
403 This API key is not active for its siteThe site is no longer verified, or has joined an ecosystem.
400 / 422A parameter problem, such as a date range over 31 days. The message explains what to fix.
429 Rate limit exceededWait for the number of seconds in Retry-After.
502 Analytics is temporarily unavailableTry again shortly.

Security & privacy

  • Treat keys like passwords. Don't put them in public code, browser JavaScript, or shared documents. Anyone with the key can read this site's statistics.
  • Read-only. Keys and connections can't change your site, settings, or content.
  • One site each. A key or Claude connection only ever reads the site it was created for.
  • No reader identities. Statistics are aggregated. Question text is a sample, and no reader-level data is included.
  • Revoke any time. Revoked keys stop working within a few minutes.
Up Next: Troubleshooting