TweetJson documentation

TweetJson is a proprietary format that was created to enable rich display of Twitter timeline information in Microsoft Power BI.

A typical Power BI custom visual implementation involves matching individual data fields to control elements. Since a Twitter timeline involves several different types of tweets, each with their own media and individual properties, this approach is not practical.

The TweetJson format acts like a single collection of commonly used properties, making it easier to construct a rich visual display in Power BI.

Even when using TweetJson to build a visual, report authors may still choose to provide individual fields to a custom control. These individual fields enable sorting and filtering scenarios that are not possible with TweetJson alone.

See:

JSON Schema format

The following information is the JSON Schema draft-06 format.

    {
      "$id": "TwitterStatus",
      "definitions": {
        "StatusBase": {
          "$id": "StatusBase",
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "authorId": {
              "type": [
                "string",
                "null"
              ]
            },
            "authorName": {
              "type": [
                "string",
                "null"
              ]
            },
            "authorScreenName": {
              "type": [
                "string",
                "null"
              ]
            },
            "authorProfileImageUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "authorVerified": {
              "type": "boolean"
            },
            "createdDateUTC": {
              "type": "string",
              "format": "date-time"
            },
            "id": {
              "type": [
                "string",
                "null"
              ]
            },
            "quotedTweet": {
              "$ref": "StatusBase"
            },
            "replyToScreenName": {
              "type": [
                "string",
                "null"
              ]
            },
            "text": {
              "type": [
                "string",
                "null"
              ]
            },
            "liked": {
              "type": "integer"
            },
            "retweeted": {
              "type": "integer"
            },
            "media": {
              "$id": "List`1",
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "StatusMedia"
              }
            }
          },
          "required": [
            "authorId",
            "authorName",
            "authorScreenName",
            "authorProfileImageUrl",
            "authorVerified",
            "createdDateUTC",
            "id",
            "quotedTweet",
            "replyToScreenName",
            "text",
            "liked",
            "retweeted",
            "media"
          ]
        },
        "StatusMedia": {
          "$id": "StatusMedia",
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "displayUrl": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": [
                "string",
                "null"
              ]
            },
            "url": {
              "type": [
                "string",
                "null"
              ]
            },
            "videoLength": {
              "type": [
                "string",
                "null"
              ]
            },
            "videoUrl": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "displayUrl",
            "type",
            "url",
            "videoLength",
            "videoUrl"
          ]
        }
      },
      "type": "object",
      "properties": {
        "isRetweet": {
          "type": "boolean"
        },
        "retweetedTweet": {
          "$ref": "StatusBase"
        },
        "authorId": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorName": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorScreenName": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorProfileImageUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "authorVerified": {
          "type": "boolean"
        },
        "createdDateUTC": {
          "type": "string",
          "format": "date-time"
        },
        "id": {
          "type": [
            "string",
            "null"
          ]
        },
        "quotedTweet": {
          "$ref": "StatusBase"
        },
        "replyToScreenName": {
          "type": [
            "string",
            "null"
          ]
        },
        "text": {
          "type": [
            "string",
            "null"
          ]
        },
        "liked": {
          "type": "integer"
        },
        "retweeted": {
          "type": "integer"
        },
        "media": {
          "$id": "List`1",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "StatusMedia"
          }
        }
      },
      "required": [
        "isRetweet",
        "retweetedTweet",
        "authorId",
        "authorName",
        "authorScreenName",
        "authorProfileImageUrl",
        "authorVerified",
        "createdDateUTC",
        "id",
        "quotedTweet",
        "replyToScreenName",
        "text",
        "liked",
        "retweeted",
        "media"
      ]
    }
                

Example implementations

Media

The following example shows a Tweet that uses media.

{
  "isRetweet": false,
  "retweetedTweet": null,
  "authorId": "15635604",
  "authorName": "HBO",
  "authorScreenName": "HBO",
  "authorProfileImageUrl": "https://pbs.twimg.com/profile_images/930793708630560768/u_LJOqEB_normal.jpg",
  "authorVerified": true,
  "createdDateUTC": "2018-01-23T16:30:06+00:00",
  "id": "955840072888213504",
  "quotedTweet": null,
  "replyToScreenName": null,
  "text": "They are demons, and they live among us. \nHalfworlds is now on #HBO.",
  "liked": 60,
  "retweeted": 14,
  "media": [
    {
      "displayUrl": "pic.twitter.com/CUogZM9eFg",
      "type": "video",
      "url": "https://pbs.twimg.com/media/DUPNfxYW4AA1Y2U.jpg",
      "videoLength": "00:20",
      "videoUrl": "https://video.twimg.com/amplify_video/955831338073915392/vid/640x360/6fUiD64A8iCnIuVa.mp4"
    }
  ]
}
            
Retweet

The following example shows a Tweet that is a retweet.

{
  "isRetweet": true,
  "retweetedTweet": {
    "authorId": "316389142",
    "authorName": "John Oliver",
    "authorScreenName": "iamjohnoliver",
    "authorProfileImageUrl": "https://pbs.twimg.com/profile_images/1393958859/main_normal.jpg",
    "authorVerified": true,
    "createdDateUTC": "2018-01-22T22:36:18+00:00",
    "id": "955569841137766400",
    "quotedTweet": null,
    "replyToScreenName": null,
    "text": "We're nearly back! @LastWeekTonight returns Feb 18th at 11pm. Doesn't feel like there's much to catch up on...https://t.co/VFhQRkdHvB",
    "liked": 4487,
    "retweeted": 649,
    "media": null
  },
  "authorId": "15635604",
  "authorName": "HBO",
  "authorScreenName": "HBO",
  "authorProfileImageUrl": "https://pbs.twimg.com/profile_images/930793708630560768/u_LJOqEB_normal.jpg",
  "authorVerified": true,
  "createdDateUTC": "2018-01-22T22:46:19+00:00",
  "id": "955572360752652294",
  "quotedTweet": null,
  "replyToScreenName": null,
  "text": "RT @iamjohnoliver: We're nearly back! @LastWeekTonight returns Feb 18th at 11pm. Doesn't feel like there's much to catch up on...https://t.…",
  "liked": 0,
  "retweeted": 649,
  "media": null
}
            
Quote

The following example shows a Tweet that quotes another tweet.

{
  "isRetweet": false,
  "retweetedTweet": null,
  "authorId": "15635604",
  "authorName": "HBO",
  "authorScreenName": "HBO",
  "authorProfileImageUrl": "https://pbs.twimg.com/profile_images/930793708630560768/u_LJOqEB_normal.jpg",
  "authorVerified": true,
  "createdDateUTC": "2018-01-17T13:20:59+00:00",
  "id": "953618154068021254",
  "quotedTweet": {
    "authorId": "615444681",
    "authorName": "Jay Ellis",
    "authorScreenName": "JayREllis",
    "authorProfileImageUrl": "https://pbs.twimg.com/profile_images/795005296988950528/TTT8DPQs_normal.jpg",
    "authorVerified": true,
    "createdDateUTC": "2018-01-17T04:34:13+00:00",
    "id": "953485587930951680",
    "quotedTweet": null,
    "replyToScreenName": null,
    "text": "Love y’all. Appreciate this",
    "liked": 625,
    "retweeted": 43,
    "media": null
  },
  "replyToScreenName": null,
  "text": "🙌�",
  "liked": 37,
  "retweeted": 2,
  "media": null
}