Class: Onlyfans::Resources::Analytics::Summary
- Inherits:
-
Object
- Object
- Onlyfans::Resources::Analytics::Summary
- Defined in:
- lib/onlyfans/resources/analytics/summary.rb
Overview
APIs for retrieving summary analytics data
Instance Method Summary collapse
-
#get_earnings_overview(account_ids:, end_date:, start_date:, request_options: {}) ⇒ Onlyfans::Models::Analytics::SummaryGetEarningsOverviewResponse
Get earnings overview by category for selected accounts within a date range.
-
#get_historical_performance(time_range: nil, request_options: {}) ⇒ Array<Onlyfans::Models::Analytics::SummaryGetHistoricalPerformanceResponseItem>
Get historical earnings chart data for the team.
-
#get_period_comparison(account_ids:, period_a:, period_b:, granularity: nil, stat_type: nil, request_options: {}) ⇒ Onlyfans::Models::Analytics::SummaryGetPeriodComparisonResponse
Compare two time periods to analyze performance changes.
-
#initialize(client:) ⇒ Summary
constructor
private
A new instance of Summary.
Constructor Details
#initialize(client:) ⇒ Summary
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Summary.
93 94 95 |
# File 'lib/onlyfans/resources/analytics/summary.rb', line 93 def initialize(client:) @client = client end |
Instance Method Details
#get_earnings_overview(account_ids:, end_date:, start_date:, request_options: {}) ⇒ Onlyfans::Models::Analytics::SummaryGetEarningsOverviewResponse
Get earnings overview by category for selected accounts within a date range. Returns total earnings, subscriptions, posts, messages, tips, streams, and content stats.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/onlyfans/resources/analytics/summary.rb', line 25 def get_earnings_overview(params) parsed, = Onlyfans::Analytics::SummaryGetEarningsOverviewParams.dump_request(params) @client.request( method: :post, path: "api/analytics/summary/earnings", body: parsed, model: Onlyfans::Models::Analytics::SummaryGetEarningsOverviewResponse, options: ) end |
#get_historical_performance(time_range: nil, request_options: {}) ⇒ Array<Onlyfans::Models::Analytics::SummaryGetHistoricalPerformanceResponseItem>
Get historical earnings chart data for the team. Returns monthly aggregated revenue data for the specified time range.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/onlyfans/resources/analytics/summary.rb', line 48 def get_historical_performance(params = {}) parsed, = Onlyfans::Analytics::SummaryGetHistoricalPerformanceParams.dump_request(params) @client.request( method: :post, path: "api/analytics/summary/historical", body: parsed, model: Onlyfans::Internal::Type::ArrayOf[Onlyfans::Models::Analytics::SummaryGetHistoricalPerformanceResponseItem], options: ) end |
#get_period_comparison(account_ids:, period_a:, period_b:, granularity: nil, stat_type: nil, request_options: {}) ⇒ Onlyfans::Models::Analytics::SummaryGetPeriodComparisonResponse
Compare two time periods to analyze performance changes. Returns summary, breakdown, and chart data for the comparison.
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/onlyfans/resources/analytics/summary.rb', line 79 def get_period_comparison(params) parsed, = Onlyfans::Analytics::SummaryGetPeriodComparisonParams.dump_request(params) @client.request( method: :post, path: "api/analytics/summary/comparison", body: parsed, model: Onlyfans::Models::Analytics::SummaryGetPeriodComparisonResponse, options: ) end |