API Endpoints

HypeAuditor For Twitch

Endpoint

Get the report of a Twitch channel:

GET https://hypeauditor.com/api/method/auditor.twitch/?channel={channel}

Channel is Twitch username (nasa) from the url of Twitch channel (https://www.twitch.tv/nasa).

Returns the report if it’s ready or requests the report if it’s not ready. First check of the username costs 1 credit and the report will be accessible for 1 year. Note: Next check after 365 days will also cost 1 credit.

📘

Note:

  • nasa report is free, use it to test the API.
  • Next check after 365 days will also cost 1 credit. To check the number of remaining credits, please refer to restTokens field in the fetched response.

Error codes

You will receive error if requested channel is not found, has no videos or no views.

  • CHANNEL_NOT_FOUND channel not found on Twitch
  • NO_VIDEOS channel has no videos
  • NO_VIEWS channel has no views
  • REPORT_CALCULATING come back later

Response Object

AttributesType
reportobjectTwitch report data

Report Object

AttributesType
basicobjectgeneral information about the channel
metricsobjectchannel metrics and calculated metrics
featuresobjectrich data about channel

Basic Object

AttributesType
idstringchannel id
usernamestringchannel username
titlestringchannel title
avatar_urlstringchannel avatar url
descriptionstringchannel description

Metrics Object

Each metrics objects may contain value field and performance object. Performance object contains 4 periods of data: (30d for 30 day data, 90d for 90, 180d for 180 and all for all-time data). Each period object contains value computed for current period (30/90/180d) and value_prev computed for the same period before current. For example: on 4th of July value shows data for Jun 5 - Jul 4 and value_prev shows data for May 4 - Jun 4. Note: value and values in performance are not the same. all objects contain last two years data.

subscribers_count

AttributesType
valueintNumber of total subscribers
performance.valueintnumber of new subscribers in a given period

following_count

AttributesType
valueintNumber of total following
performance.valueintnumber of new following in a given period

views_avg

AttributesType
performance.valueintnumber of average views in a given period
performance.maxintnumber of max. average views in a given period
performance.minintnumber of min. average views in a given period
performance.value_previntnumber of average views in the previous period

subscribers_growth_prc

AttributesType
performance.valuefloatvalue in a given period
performance.markstringquality mark
performance.similarfloatvalue for similar accounts in a given period

views_count

AttributesType
valueintViews count value

live_viewers_avg

AttributesType
performance.valueintvalue in a given period
performance.value_previntvalue for similar accounts in a given period

videos_per_week

AttributesType
performance.valueintvalue in a given period
performance.value_previntvalue for similar accounts in a given period

video_views_count

AttributesType
performance.valuefloatvalue in a given period
performance.value_prevfloatvalue for similar accounts in a given period

video_views_avg

AttributesType
performance.valuefloatvalue in a given period
performance.value_prevfloatvalue for similar accounts in a given period

views_rate

AttributesType
performance.valuefloatvalue in a given period
performance.value_prevfloatvalue for similar accounts in a given period

hours_streamed

AttributesType
performance.valuefloatvalue in a given period
performance.value_prevfloatvalue for similar accounts in a given period

active_days_per_week

AttributesType
performance.valueintvalue in a given period
performance.value_previntvalue for similar accounts in a given period

chat_messages_per_hour

AttributesType
performance.valuefloatvalue in a given period
performance.similarfloatvalue for similar accounts in a given period
performance.markstringquality mark
performance.mark_tittlestringquality tittle for mark

Mark

  • poor
  • fair
  • average
  • good
  • excellent

Features Object

audience_age_gender

Audience age gender distribution. If object is null that means no data available for channel.

AttributesType
dataobjectDict of age objects. Each age object contains two genders (male and female).

Age objects are: 13-17, 18-24, 25-34, 35-44, 45-54, 55-64, 65+

audience_geo

Audience geo. If object is null that means no data available for channel.

AttributesType
dataarrayarray of {code: string, prc: float} objects. Code is ISO Alpha-2 two letter country code.

stream_viewers

Stream viewers

AttributesType
dataarrayarray of objects
data.{ }.video_idstringvideo ID
data.{ }.chartarrayarray of {value: int, time_iso: string}.
value is number of stream viewers,
time_iso is date in ISO format

audience_languages

Audience languages. If object is null that means no data available for channel.

AttributesType
dataarrayarray of {title: string, prc: float} objects. Code is ISO Alpha-2 two letter lang code.

audience_sentiments

AttributesType
data.sentiments.POSITIVE.countintcount of positive comments
data.sentiments.POSITIVE.prcfloatprc of positive comments
data.sentiments.NEUTRAL.countintcount of neutral comments
data.sentiments.NEUTRAL.prcfloatprc of neutral comments
data.sentiments.NEGATIVE.countintcount of negative comments
data.sentiments.NEGATIVE.prcfloatprc of negative comments
data.scoreintfinal score
data.comments_countintcount of comments
data.posts_countintcount of posts

most_media

Lists of most (in some parameters) media ids

AttributesType
dataobject{most_hours_streamed: array of media ids for a given period, most_views: array of media ids for a given period}.

blogger_geo

List of influencer auditory geo with percentage of total auditory

AttributesType
data.countriesarrayarray of {"id": "es", "code": "es", "prc": 28.39} objects.

blogger_emails

List of blogger contact emails

AttributesType
dataarrayarray of emails.

blogger_languages

List of blogger languages

AttributesType
dataarrayarray of blogger languages in two-cars code format.

games

Games played

AttributesType
dataarrayarray of {basic: object, metrics: object} objects.
data.basic.idstringGame ID
data.basic.tittlestringTittle of game
data.basic.avatar_urlstringGame avatar URL
data.metrics.subscribers_countintSubscribers count
data.metrics.streams_countobjectStreams count object for given period {performance.{period}.value: int}
data.metrics.views_avgobjectViews average object for given period {performance.{period}.value: int}
data.metrics.hours_streamedobjectHours streamed object for given period {performance.{period}.value: float}

social_networks

AttributesType
dataarrayarray of {type: int, id: string} objects.

Social networks ids map:

IdSocial network
1Instagram
2YouTube
3TikTok
4Twitch
5Twitter
7Snapchat

Requests

Set YOUR_ID and YOUR_TOKEN from HypeAuditor.

curl -X POST \
  https://hypeauditor.com/api/method/auditor.twitch \
  -H 'content-type: application/x-www-form-urlencoded' \
  -H 'x-auth-id: %YOUR_ID%' \
  -H 'x-auth-token: %YOUR_TOKEN%' \
  -d channel=nasa  \
<?php
$curl = curl_init();
curl_setopt_array($curl, [
   CURLOPT_URL => 'https://hypeauditor.com/api/method/auditor.twitch',
   CURLOPT_CUSTOMREQUEST => 'POST',
   CURLOPT_POSTFIELDS => [
       'channel' => 'nasa'
   ],
   CURLOPT_HTTPHEADER => [
       'x-auth-id: YOUR_ID',
       'x-auth-token: YOUR_TOKEN'
   ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
   echo 'cURL Error #:' . $err;
} else {
   echo $response;
}

📘

Note:

You don’t need to pre-request the report from web, you can request it directly from API.

Sample request

GET https://hypeauditor.com/api/method/auditor.twitch/?channel=nasa

Sample response

{
    "result": {
        "report": {
            "basic": {
                "id": "151920918",
                "username": "nasa",
                "title": "NASA",
                "avatar_url": "https://static-cdn.jtvnw.net/jtv_user_pictures/nasa-profile_image-739106d9e1948b76-300x300.png",
                "description": "Explore the universe and discover our home planet with the official NASA channel on Twitch. "
            },
            "metrics": {
                "subscribers_count": {
                    "value": 1172469,
                    "performance": {
                        "30d": {
                            "value": -1100
                        },
                        "90d": {
                            "value": 1309
                        },
                        "180d": {
                            "value": 2147
                        }
                    }
                },
                "following_count": {
                    "value": 0,
                    "performance": null
                },
                "views_avg": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "max": 0,
                            "min": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "max": 0,
                            "min": 0,
                            "value_prev": 13418
                        },
                        "90d": {
                            "value": 18642,
                            "max": 91420,
                            "min": 1454,
                            "value_prev": 58029
                        },
                        "180d": {
                            "value": 42132,
                            "max": 108692,
                            "min": 1454,
                            "value_prev": 83683
                        },
                        "365d": {
                            "value": 67099,
                            "max": 325854,
                            "min": 1454,
                            "value_prev": 48987
                        },
                        "all": {
                            "value": 37078,
                            "max": 1579173,
                            "min": 101
                        }
                    }
                },
                "subscribers_growth_prc": {
                    "performance": {
                        "30d": {
                            "value": -0.09,
                            "mark": "good",
                            "similar": -0.072222
                        },
                        "90d": {
                            "value": 0.11,
                            "mark": "good",
                            "similar": 1.852935
                        },
                        "180d": {
                            "value": 0.18,
                            "mark": "average",
                            "similar": 6.479253
                        }
                    }
                },
                "views_count": {
                    "value": 15403785
                },
                "live_viewers_avg": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": null
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 5688
                        },
                        "90d": {
                            "value": 1734,
                            "value_prev": 5071
                        },
                        "180d": {
                            "value": 4319,
                            "value_prev": 6115
                        },
                        "365d": {
                            "value": 5785,
                            "value_prev": 11126
                        },
                        "all": {
                            "value": 9530,
                            "value_prev": null
                        }
                    }
                },
                "videos_per_week": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 1
                        },
                        "90d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "180d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "365d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "all": {
                            "value": 0,
                            "value_prev": 0
                        }
                    }
                },
                "video_views_count": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 162223
                        },
                        "90d": {
                            "value": 204906,
                            "value_prev": 410842
                        },
                        "180d": {
                            "value": 615748,
                            "value_prev": 2294950
                        },
                        "365d": {
                            "value": 2910698,
                            "value_prev": 11149105
                        },
                        "all": {
                            "value": 15652673,
                            "value_prev": 0
                        }
                    }
                },
                "video_views_avg": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 13418
                        },
                        "90d": {
                            "value": 18642.5,
                            "value_prev": 58029
                        },
                        "180d": {
                            "value": 42131.5,
                            "value_prev": 83683
                        },
                        "365d": {
                            "value": 67099,
                            "value_prev": 48987
                        },
                        "all": {
                            "value": 37078,
                            "value_prev": 0
                        }
                    }
                },
                "views_rate": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 1.14
                        },
                        "90d": {
                            "value": 1.59,
                            "value_prev": 4.95
                        },
                        "180d": {
                            "value": 3.59,
                            "value_prev": 7.14
                        },
                        "365d": {
                            "value": 5.72,
                            "value_prev": 4.18
                        },
                        "all": {
                            "value": 3.16,
                            "value_prev": 0
                        }
                    }
                },
                "hours_streamed": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 1.81
                        },
                        "90d": {
                            "value": 2.88,
                            "value_prev": 10.96
                        },
                        "180d": {
                            "value": 13.84,
                            "value_prev": 49.07
                        },
                        "365d": {
                            "value": 62.91,
                            "value_prev": 86.56
                        },
                        "all": {
                            "value": 230.9,
                            "value_prev": 0
                        }
                    }
                },
                "active_days_per_week": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "30d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "90d": {
                            "value": 0,
                            "value_prev": 0
                        },
                        "180d": {
                            "value": 0,
                            "value_prev": 1
                        },
                        "365d": {
                            "value": 0,
                            "value_prev": 1
                        },
                        "all": {
                            "value": 0,
                            "value_prev": 0
                        }
                    }
                },
                "chat_messages_per_hour": {
                    "performance": {
                        "7d": {
                            "value": 0,
                            "similar": 691.6,
                            "mark": "poor",
                            "mark_title": "poor"
                        },
                        "30d": {
                            "value": 0,
                            "similar": 760.172573,
                            "mark": "poor",
                            "mark_title": "poor"
                        },
                        "90d": {
                            "value": 0,
                            "similar": 770.762756,
                            "mark": "poor",
                            "mark_title": "poor"
                        },
                        "180d": {
                            "value": 0,
                            "similar": 773.16985,
                            "mark": "poor",
                            "mark_title": "poor"
                        },
                        "365d": {
                            "value": 2550,
                            "similar": 773.135512,
                            "mark": "very_good",
                            "mark_title": "very_good"
                        },
                        "all": {
                            "value": 2550,
                            "similar": 772.942,
                            "mark": "very_good",
                            "mark_title": "very_good"
                        }
                    }
                }
            },
            "features": {
                "audience_age_gender": {
                    "data": {
                        "13-17": {
                            "male": 0,
                            "female": 0
                        },
                        "18-24": {
                            "male": 25,
                            "female": 0
                        },
                        "25-34": {
                            "male": 25,
                            "female": 0
                        },
                        "35-44": {
                            "male": 0,
                            "female": 0
                        },
                        "45-54": {
                            "male": 25,
                            "female": 0
                        },
                        "55-64": {
                            "male": 25,
                            "female": 0
                        },
                        "65+": {
                            "male": 0,
                            "female": 0
                        }
                    }
                },
                "audience_geo": {
                    "data": {
                        "countries": [
                            {
                                "id": "us",
                                "code": "us",
                                "prc": 75
                            },
                            {
                                "id": "tn",
                                "code": "tn",
                                "prc": 25
                            },
                            {
                                "id": "gb",
                                "code": "gb",
                                "prc": 0
                            }
                        ],
                        "groups": {
                            "africa": 25,
                            "america": 75,
                            "imea": 25
                        }
                    }
                },
                "stream_viewers": {
                    "data": []
                },
                "audience_languages": {
                    "data": [
                        {
                            "title": "en",
                            "prc": 76.47
                        },
                        {
                            "title": "pt",
                            "prc": 2.94
                        },
                        {
                            "title": "ja",
                            "prc": 2.94
                        }
                    ]
                },
                "audience_sentiments": null,
                "most_media": {
                    "data": {
                        "most_hours_streamed": {
                            "performance": {
                                "7d": {
                                    "media_ids": []
                                },
                                "30d": {
                                    "media_ids": []
                                },
                                "90d": {
                                    "media_ids": [
                                        "1530833235",
                                        "1316037901",
                                        "1316011671",
                                        "1529669395",
                                        "1529693643"
                                    ]
                                },
                                "180d": {
                                    "media_ids": [
                                        "1468115731",
                                        "1468784381",
                                        "1449879853",
                                        "1412359057",
                                        "1428691057"
                                    ]
                                },
                                "365d": {
                                    "media_ids": [
                                        "1146490329",
                                        "1201763641",
                                        "1468115731",
                                        "1256985985",
                                        "1221781700"
                                    ]
                                },
                                "all": {
                                    "media_ids": [
                                        "636407963",
                                        "947658044",
                                        "698106525",
                                        "1146490329",
                                        "496207349"
                                    ]
                                }
                            }
                        },
                        "most_views": {
                            "performance": {
                                "7d": {
                                    "media_ids": []
                                },
                                "30d": {
                                    "media_ids": []
                                },
                                "90d": {
                                    "media_ids": [
                                        "1530833235",
                                        "1529669395",
                                        "1316011671",
                                        "1316037901",
                                        "1529663473"
                                    ]
                                },
                                "180d": {
                                    "media_ids": [
                                        "1468115731",
                                        "1530833235",
                                        "1449879853",
                                        "1468784381",
                                        "1450965945"
                                    ]
                                },
                                "365d": {
                                    "media_ids": [
                                        "1242970534",
                                        "1256985985",
                                        "1146490329",
                                        "1201763641",
                                        "1214401965"
                                    ]
                                },
                                "all": {
                                    "media_ids": [
                                        "919215638",
                                        "937725331",
                                        "924423369",
                                        "1057906957",
                                        "1062015879"
                                    ]
                                }
                            }
                        }
                    }
                },
                "blogger_geo": {
                    "data": null
                },
                "blogger_emails": {
                    "data": []
                },
                "blogger_languages": {
                    "data": [
                        "en"
                    ]
                },
                "games": {
                    "data": [
                        {
                            "basic": {
                                "id": "509670",
                                "title": "Science & Technology",
                                "avatar_url": "https://static-cdn.jtvnw.net/ttv-boxart/509670-300x300.jpg"
                            },
                            "metrics": {
                                "subscribers_count": 693836,
                                "streams_count": {
                                    "performance": {
                                        "7d": {
                                            "value": 0
                                        },
                                        "30d": {
                                            "value": 0
                                        },
                                        "90d": {
                                            "value": 0
                                        },
                                        "180d": {
                                            "value": 0
                                        },
                                        "365d": {
                                            "value": 6
                                        },
                                        "all": {
                                            "value": 13
                                        }
                                    }
                                },
                                "views_avg": {
                                    "performance": {
                                        "7d": {
                                            "value": 0
                                        },
                                        "30d": {
                                            "value": 0
                                        },
                                        "90d": {
                                            "value": 0
                                        },
                                        "180d": {
                                            "value": 0
                                        },
                                        "365d": {
                                            "value": 6846
                                        },
                                        "all": {
                                            "value": 11268
                                        }
                                    }
                                },
                                "hours_streamed": {
                                    "performance": {
                                        "7d": {
                                            "value": 0
                                        },
                                        "30d": {
                                            "value": 0
                                        },
                                        "90d": {
                                            "value": 0
                                        },
                                        "180d": {
                                            "value": 0
                                        },
                                        "365d": {
                                            "value": 16.1
                                        },
                                        "all": {
                                            "value": 40.8
                                        }
                                    }
                                }
                            }
                        }
                    ]
                },
                "social_networks": {
                    "data": [
                        {
                            "type": 4,
                            "id": "nasa"
                        }
                    ]
                }
            }
        },
        "restTokens": 1208
    }
}

highDemand field is “true” when HypeAuditor experiences unexpected high load that effects report generation time negatively. When you receive that field you may want to inform your users that the delay is temporary and we’re fixing it. Everything will go back to normal and all requests are safe.

Errors