Class: Onlyfans::Resources::Search

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Search

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

Parameters:



58
59
60
# File 'lib/onlyfans/resources/search.rb', line 58

def initialize(client:)
  @client = client
end

Instance Method Details

#profiles(cursor: nil, filter: nil, instagram: nil, limit: nil, location: nil, max_subscribe_price: nil, min_subscribe_price: nil, query: nil, sort: nil, sort_direction: nil, tiktok: nil, website: nil, request_options: {}) ⇒ Onlyfans::Models::SearchProfilesResponse

Some parameter documentations has been truncated, see Models::SearchProfilesParams for more details.

Full-text search for profiles with filters for pricing, free trials, location, media count and more.

Parameters:

  • cursor (String, nil)

    Cursor for pagination. Use the ‘next_cursor` from the previous response to get t

  • filter (Onlyfans::Models::SearchProfilesParams::Filter)
  • instagram (String)

    Filter by Instagram username.

  • limit (Integer)

    The number of profiles to return. For each returned profile we charge your accou

  • location (String)

    Filter by location.

  • max_subscribe_price (Float)

    Filter by maximum subscribe price. Must be at least 0.00.

  • min_subscribe_price (Float)

    Filter by minimum subscribe price. Must be at least 0.00.

  • query (String)

    Query for full text search in username, display name, bio. Must be at least 3 ch

  • sort (Symbol, Onlyfans::Models::SearchProfilesParams::Sort)

    Field to sort by. ⭐️ Only available on the Pro and Enterprise plan.

  • sort_direction (Symbol, Onlyfans::Models::SearchProfilesParams::SortDirection)

    Direction for sorting. ‘desc` - highest value first. `asc` - lowest value first.

  • tiktok (String)

    Filter by TikTok username.

  • website (String)

    Filter by website.

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

Returns:

See Also:



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/onlyfans/resources/search.rb', line 43

def profiles(params = {})
  parsed, options = Onlyfans::SearchProfilesParams.dump_request(params)
  query = Onlyfans::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/search",
    query: query.transform_keys(sort_direction: "sortDirection"),
    model: Onlyfans::Models::SearchProfilesResponse,
    options: options
  )
end