Skip to main content
GET
/
2
/
insights
/
28hr
Obtenir les statistiques de la Publication sur 28 heures
curl --request GET \
  --url https://api.x.com/2/insights/28hr \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "errors": [
        {
          "error": "<string>",
          "tweets": [
            "<string>"
          ]
        }
      ],
      "measurement": {
        "metrics_time_series": [
          {
            "tweet_id": "1346889436626259968",
            "value": {
              "metric_values": [
                {
                  "metric_type": "<string>",
                  "metric_value": 123
                }
              ],
              "timestamp": {
                "iso8601_time": "<string>"
              }
            }
          }
        ],
        "metrics_total": [
          {
            "tweet_id": "1346889436626259968",
            "value": [
              {
                "metric_type": "<string>",
                "metric_value": 123
              }
            ]
          }
        ]
      }
    }
  ],
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

tweet_ids
string[]
required

Liste de PostIds pour les métriques sur 28 heures.

Required array length: 1 - 25 elements

Identifiant unique de ce Tweet. Il est renvoyé sous forme de chaîne de caractères afin d’éviter les complications avec les langages et outils qui ne gèrent pas les entiers de très grande taille.

Pattern: ^[0-9]{1,19}$
Example:
["20"]
granularity
enum<string>
required

Granularité des métriques dans la réponse.

Available options:
Daily,
Hourly,
Weekly,
Total
Example:

"Total"

requested_metrics
enum<string>[]
required

Demander les métriques pour une requête historique.

Minimum array length: 1
Available options:
AppInstallAttempts,
AppOpens,
DetailExpands,
EmailTweet,
Engagements,
Follows,
HashtagClicks,
Impressions,
Likes,
LinkClicks,
MediaEngagements,
MediaViews,
PermalinkClicks,
ProfileVisits,
QuoteTweets,
Replies,
Retweets,
UniqueVideoViews,
UrlClicks,
UserProfileClicks,
VideoCompletions,
VideoPlayed25Percent,
VideoPlayed50Percent,
VideoPlayed75Percent,
VideoStarts,
VideoViews
engagement.fields
enum<string>[]

Liste de champs Engagement, séparée par des virgules, à inclure dans la réponse. Champs disponibles pour un objet Engagement.

Minimum array length: 1
Available options:
errors,
measurement
Example:
["errors", "measurement"]

Response

La requête a réussi.

data
object[]
Minimum array length: 1
errors
object[]
Minimum array length: 1

Un objet HTTP Problem Details, tel que défini dans la RFC IETF 7807 (https://tools.ietf.org/html/rfc7807).