Available on crate feature helix only.
Expand description

Gets a ranked list of Bits leaderboard information for an authorized broadcaster. get-bits-leaderboard

Accessing the endpoint

Request: GetBitsLeaderboardRequest

To use this endpoint, construct a GetBitsLeaderboardRequest with the GetBitsLeaderboardRequest::builder() method. Provide started_at and period to get a different leaderboard than default

use twitch_api2::helix::bits::get_bits_leaderboard;
let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder()
    .period("day".to_string())
    .build();
// Get leaderbord for the lifetime of the channel
let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder().build();

Response: BitsLeaderboard

Send the request to receive the response with HelixClient::req_get().

use twitch_api2::helix::{self, bits::get_bits_leaderboard};
let request = get_bits_leaderboard::GetBitsLeaderboardRequest::builder().build();
let response: get_bits_leaderboard::BitsLeaderboard = client.req_get(request, &token).await?.data;

You can also get the http::Request with request.create_request(&token, &client_id) and parse the http::Response with GetBitsLeaderboardRequest::parse_response(None, &request.get_uri(), response)

Structs

Period over which the returned data is aggregated.

Information about user in leaderboard