Appfiliate Docs
appfiliate.io

Get Stats

Fetches aggregated analytics for an app over a given time period. Used by the Appfiliate dashboard to display clicks, installs, revenue, and conversion rates.

GET/v1/stats/:appId

Returns aggregated click, install, and purchase statistics for the specified app.


Path Parameters

ParameterTypeRequiredDescription
appIdstringRequiredThe app ID to fetch stats for.

Query Parameters

ParameterTypeRequiredDescription
daysnumberOptionalNumber of days to look back. Defaults to 30.

Example Request

curl
curl "https://us-central1-appfiliate-5a18b.cloudfunctions.net/api/v1/stats/app_myapp?days=30"

Response

200 OK
{
  "clicks": 1243,
  "installs": 187,
  "install_rate": 15.0,
  "revenue": 1672.50,
  "purchases": 42,
  "period_days": 30
}

Response Fields

ParameterTypeRequiredDescription
clicksnumberRequiredTotal tracking link clicks in the period.
installsnumberRequiredTotal attributed installs in the period.
install_ratenumberRequiredClick-to-install conversion rate as a percentage (e.g. 15.0 means 15%).
revenuenumberRequiredTotal purchase revenue in the period, rounded to two decimal places.
purchasesnumberRequiredTotal number of tracked purchases in the period.
period_daysnumberRequiredThe number of days the stats cover (echoes the query parameter).

Install rate calculation

The install_rate is calculated as (installs / clicks) * 100, rounded to one decimal place. If there are zero clicks, the rate is 0.