Available on crate feature helix only.
Expand description

Gets games sorted by number of current viewers on Twitch, most popular first. get-top-games

Accessing the endpoint

Request: GetTopGamesRequest

To use this endpoint, construct a GetTopGamesRequest with the GetTopGamesRequest::builder() method.

use twitch_api2::helix::games::get_top_games;
let request = get_top_games::GetTopGamesRequest::builder()
    .first(100)
    .build();

Response: Game

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

use twitch_api2::helix::{self, games::get_top_games};
let request = get_top_games::GetTopGamesRequest::builder()
    .build();
let response: Vec<get_top_games::Game> = 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 GetTopGamesRequest::parse_response(None, &request.get_uri(), response)

Structs

Query Parameters for Get Top Games

Type Definitions

Return Values for Get Top Games