Class: Onlyfans::Resources::Subscribers

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyfans/resources/subscribers.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Subscribers

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 Subscribers.

Parameters:



39
40
41
# File 'lib/onlyfans/resources/subscribers.rb', line 39

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve_statistics(account, end_date: nil, start_date: nil, type: nil, request_options: {}) ⇒ Onlyfans::Models::SubscriberRetrieveStatisticsResponse

Get subscriber and earning statistics for an account for a specified timeframe. Optionally, filter by all, renews, or new subscribers.

Parameters:

  • account (String)

    The Account ID

  • end_date (String, nil)

    The end date for the period. Keep empty to calculate everything.

  • start_date (String, nil)

    The start date for the period. Keep empty to calculate everything.

  • type (Symbol, Onlyfans::Models::SubscriberRetrieveStatisticsParams::Type, nil)

    Filter the subscriber statistics (default = total)

  • request_options (Onlyfans::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/onlyfans/resources/subscribers.rb', line 24

def retrieve_statistics(, params = {})
  parsed, options = Onlyfans::SubscriberRetrieveStatisticsParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["api/%1$s/subscribers/statistics", ],
    query: query,
    model: Onlyfans::Models::SubscriberRetrieveStatisticsResponse,
    options: options
  )
end