API Endpoints

HypeAuditor For Twitter

Endpoint

Get metrics history of Twitter channel

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

Channel is Twitter username (nasa) from the url of Twitter channel (https://www.twitter.com/nasa). Returns the metrics history if it’s ready.

📘

Note:

  • By requesting Metrics History, user UNLOCKS report (auditor.twitter method).
  • nasa report is free, use it to test the API.
  • Disclaimer: HypeAuditor only provides historical data from the moment when the account to be searched was added to our database.

Response Object

AttributesType
metrics_historyobjectMetrics history data

Metrics History Object

Contains er , retweet_count, reply_count, favorite_count, media_per_week, subscribers_count, and following_count metrics history objects. Each object contains history array:

AttributesType
er.history.valuefloatLast observed value of ER metric
er.history.time_isostringTime in ISO format
retweet_count.history.valueintLast observed value of retweet count metric
retweet_count.history.time_isostringTime in ISO format
reply_count.history.valueintLast observed value of reply count metric
reply_count.history.time_isostringTime in ISO format
favorite_count.history.valueintLast observed value of favorite count metric
favorite_count.history.time_isostringTime in ISO format
media_per_week.history.valueintLast observed value of media per week metric
media_per_week.history.time_isostringTime in ISO format
subscribers_count.history.valueintLast observed value of subscribers count metric
subscribers_count.history.time_isostringTime in ISO format
following_count.history.valueintLast observed value of following count metric
following_count.history.time_isostringTime in ISO format

Requests

Set YOUR_ID and YOUR_TOKEN from HypeAuditor.

curl -X POST \
  https://hypeauditor.com/api/method/auditor.twitterHistory \
  -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.twitterHistory',
   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;
}

Sample request

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

Sample response

{
    "result": {
        "metrics_history": {
            "er": {
                "history": [
                    {
                        "value": 0.004,
                        "time_iso": "2020-09-14T23:06:07"
                    },

                    ...
                ]
            },
            "retweet_count": {
                "history": [
                    {
                        "value": 341,
                        "time_iso": "2020-09-14T23:06:07"
                    },

                    ...
                ]
            },
            "reply_count": {
                "history": [
                    {
                        "value": 31,
                        "time_iso": "2020-09-14T23:06:07"
                    },

                    ...
                ]
            },
            "favorite_count": {
                "history": [
                    {
                        "value": 2129,
                        "time_iso": "2020-09-14T23:06:07"
                    },

                    ...
                ]
            },
            "media_per_week": {
                "history": [
                    {
                        "value": 3,
                        "time_iso": "2020-09-18T01:26:01"
                    },

                    ...
                ]
            },
            "subscribers_count": {
                "history": [
                    {
                        "value": 44406226,
                        "time_iso": "2021-02-24T00:00:00"
                    },

                    ...
                ]
            },
            "following_count": {
                "history": [
                    {
                        "value": 204,
                        "time_iso": "2021-02-24T00:00:00"
                    },

                    ...
                ]
            },
        },
        "restTokens": 6
    }
}