RapidAPI logo

Sign Up

Log In

Twitch

FREE
By mpoon
Updated 4 months ago
Media
-/10
Popularity Score
-
Latency
-
Success Rate

Twitch API Documentation

Retrieve or update Twitch content via REST API. 50char

View API Details
Games
GETGet top games
GETGet top games

Returns an array of top games on Twitch by current viewers.

Authorization:

description

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
AuthorizationOAUTH2
REQUIREDdescription
Optional Parameters
limitNUMBER
OPTIONALMaximum number of games to return, up to 100.
offsetNUMBER
OPTIONALOffset to begin listing games, defaults to 0.
Request Snippet
unirest.get("https://mpoon-twitch.p.rapidapi.com/games/top?limit=25&offset=0")
.header("X-RapidAPI-Host", "mpoon-twitch.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Authorization", "")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.get("https://mpoon-twitch.p.rapidapi.com/games/top?limit=25&offset=0")
.header("X-RapidAPI-Host", "mpoon-twitch.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Authorization", "")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication