{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scrapefield-com/json-schema/scrapefield-com-x-post-schema.json",
  "title": "x_post",
  "description": "A post on X: a post, a reply or a quote.",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scrapefield-com-openapi.json#/components/schemas/x_post",
  "type": "object",
  "required": [
    "id",
    "url",
    "text",
    "created_at",
    "lang",
    "author",
    "conversation_id",
    "referenced_tweets",
    "public_metrics",
    "media",
    "hashtags",
    "mentions"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "X's id for the post."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The post on X."
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "The whole text. Links stay as X shortens them."
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When it was posted. `null` when the source does not say."
    },
    "lang": {
      "type": [
        "string",
        "null"
      ],
      "description": "The language X detected, e.g. `en`."
    },
    "author": {
      "type": "object",
      "required": [
        "id",
        "username",
        "name",
        "profile_url",
        "profile_image_url",
        "verified"
      ],
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "X's numeric id for the account."
        },
        "username": {
          "type": "string",
          "description": "Without the @."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The display name."
        },
        "profile_url": {
          "type": "string",
          "format": "uri",
          "description": "The account on X."
        },
        "profile_image_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The profile picture, at full size."
        },
        "verified": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the account has a checkmark."
        }
      },
      "additionalProperties": false,
      "description": "Who posted it."
    },
    "conversation_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The first post of the thread it belongs to."
    },
    "referenced_tweets": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "replied_to",
              "quoted",
              "retweeted"
            ],
            "description": "How this post refers to it: a reply, a quote or a repost."
          },
          "id": {
            "type": "string",
            "description": "X's id for that post."
          }
        },
        "additionalProperties": false
      },
      "description": "The post it replies to, quotes or reposts, as X's API names them."
    },
    "public_metrics": {
      "type": "object",
      "required": [
        "retweet_count",
        "reply_count",
        "like_count",
        "quote_count",
        "bookmark_count",
        "impression_count"
      ],
      "properties": {
        "retweet_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Reposts."
        },
        "reply_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Replies."
        },
        "like_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Likes."
        },
        "quote_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Quotes."
        },
        "bookmark_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Bookmarks."
        },
        "impression_count": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Views."
        }
      },
      "additionalProperties": false,
      "description": "`null` where the source does not give one."
    },
    "media": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "url"
        ],
        "properties": {
          "type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "photo",
              "video",
              "animated_gif",
              null
            ],
            "description": "`null` where the source does not say."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The image, or a video's preview image."
          }
        },
        "additionalProperties": false
      },
      "description": "Photos and videos, in order."
    },
    "hashtags": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One hashtag."
      },
      "description": "Without the #."
    },
    "mentions": {
      "type": "array",
      "items": {
        "type": "string",
        "description": "One username."
      },
      "description": "Usernames, without the @."
    }
  },
  "additionalProperties": false
}