inst/docs/revenue_units_guide.md

Revenue Units Guide for SensorTowerR

Overview

The Sensor Tower API returns revenue values in different units depending on the endpoint. To ensure consistency and prevent confusion, SensorTowerR v0.2.3+ automatically standardizes revenue units across all functions.

Quick Reference

| Function | Original API Unit | SensorTowerR Standard Column | Unit | |----------|------------------|------------------------------|------| | st_top_charts() | cents | revenue | base currency | | st_sales_report() | base currency | total_revenue | base currency | | st_top_publishers() | cents | revenue_usd | base currency |

Detailed Behavior

st_top_charts()

st_sales_report()

st_top_publishers()

Best Practices

  1. Always use the standardized columns for analysis:
  2. revenue from st_top_charts()
  3. total_revenue from st_sales_report()
  4. revenue_usd from st_top_publishers()

  5. Check column attributes if unsure: r data <- st_top_charts(...) attr(data$revenue, "unit") # Returns "base_currency"

  6. For backward compatibility, original columns are preserved with their original units.

Migration Guide

If you have existing code that manually converts cents to dollars:

# Old approach (no longer needed)
top_charts %>%
  mutate(revenue_dollars = revenue_absolute / 100)

# New approach (use standardized column)
top_charts %>%
  select(app_name, revenue)  # revenue is already in base currency

Note on Currency Types

"Base currency" refers to the standard monetary unit (dollars for USD, euros for EUR, etc.) as opposed to cents/pence/centimes. The actual currency type depends on your Sensor Tower account settings and the regions you're querying.



Try the sensortowerR package in your browser

Any scripts or data that you put into this service are public.

sensortowerR documentation built on March 18, 2026, 5:07 p.m.