跳到主要内容
X (Twitter / 推特)

x.posts.detail@v1

X 帖子详情

帖子详情

按 Tweet ID 读取一条当前公开帖子的正文、作者、互动指标和媒体。

POST/v1/x/posts/detail

英文名称: X post detail · Post · Detail
Read the text, author, public metrics, and media for one currently public post by Tweet ID.

适合什么任务

  • 已经知道 Tweet ID,需要把单条公开帖子的详情接入 AI 或固定工作流。

不适合什么任务

  • 不用于搜索、读取评论,或恢复已删除、私密内容。

请求参数

字段tweet_id类型string约束与默认值pattern: "^[0-9]{1,20}$"必填性必填
完整请求 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "tweet_id": {
      "type": "string",
      "pattern": "^[0-9]{1,20}$"
    }
  },
  "required": [
    "tweet_id"
  ],
  "additionalProperties": false
}

静态响应样例

application/json
{
  "code": 200,
  "request_id": "req_example_detail_01",
  "message": "success",
  "data": {
    "item": {
      "id": "1808168603721650364",
      "text": "Public fixture detail text",
      "created_at": "Tue Jul 02 15:00:00 +0000 2024",
      "language": "en",
      "conversation_id": "1808168603721650364",
      "sensitive": false,
      "status": "active",
      "author": {
        "id": "1000",
        "username": "example",
        "name": "Example",
        "avatar_url": "https://pbs.twimg.com/profile_images/example.jpg",
        "verified": false,
        "verified_type": null,
        "followers_count": 50
      },
      "metrics": {
        "replies": 3,
        "reposts": 4,
        "quotes": 1,
        "likes": 20,
        "bookmarks": 2,
        "views": "100"
      },
      "media": {
        "photos": [
          {
            "id": "media-photo-1",
            "url": "https://pbs.twimg.com/media/example.jpg"
          }
        ],
        "videos": []
      }
    }
  },
  "page": {
    "next_cursor": null
  },
  "warnings": [],
  "meta": {
    "result_status": "complete",
    "balance_after": "0.99",
    "listing_id": "x.posts.detail",
    "version": "v1",
    "catalog_release_id": "catalog-production-2026-09-17.1",
    "price_book_version": "pricebook-production-2026-09-17.1",
    "charged_amount": "0.02",
    "currency": "CNY"
  }
}

实时运行

完整结果和空结果收费;部分结果和失败不收费。

安全验证

正在加载安全验证…

正在确认实时执行状态…

执行结果

// Result

响应 Contract

字段摘要用于快速浏览;完整 JSON Schema 是稳定输出 Contract。

字段code类型number约束与默认值const: 200必填性必填
字段request_id类型string约束与默认值无额外约束必填性必填
字段message类型string约束与默认值const: "success"必填性必填
字段data类型object约束与默认值无额外约束必填性必填
字段page类型object约束与默认值无额外约束必填性必填
字段warnings类型array约束与默认值无额外约束必填性必填
字段meta类型object约束与默认值无额外约束必填性必填
完整响应 JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "code": {
      "type": "number",
      "const": 200
    },
    "request_id": {
      "type": "string"
    },
    "message": {
      "type": "string",
      "const": "success"
    },
    "data": {
      "type": "object",
      "properties": {
        "item": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "created_at": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "language": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "conversation_id": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "sensitive": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "status": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "author": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "avatar_url": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "verified": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "verified_type": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "followers_count": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "username",
                    "name",
                    "avatar_url",
                    "verified",
                    "verified_type",
                    "followers_count"
                  ],
                  "additionalProperties": false
                },
                "metrics": {
                  "type": "object",
                  "properties": {
                    "replies": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reposts": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "quotes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "likes": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "bookmarks": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "views": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "replies",
                    "reposts",
                    "quotes",
                    "likes",
                    "bookmarks",
                    "views"
                  ],
                  "additionalProperties": false
                },
                "media": {
                  "type": "object",
                  "properties": {
                    "photos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "required": [
                          "id",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "videos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "preview_url": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uri"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "duration_ms": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "aspect_ratio": {
                            "anyOf": [
                              {
                                "type": "array",
                                "prefixItems": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "number"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "variants": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "content_type": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string",
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "content_type",
                                "url"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "preview_url",
                          "duration_ms",
                          "aspect_ratio",
                          "variants"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "photos",
                    "videos"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "text",
                "created_at",
                "language",
                "conversation_id",
                "sensitive",
                "status",
                "author",
                "metrics",
                "media"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "item"
      ],
      "additionalProperties": false
    },
    "page": {
      "type": "object",
      "properties": {
        "next_cursor": {
          "type": "null"
        }
      },
      "required": [
        "next_cursor"
      ],
      "additionalProperties": false
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "listing_id": {
          "type": "string",
          "const": "x.posts.detail"
        },
        "version": {
          "type": "string",
          "const": "v1"
        },
        "catalog_release_id": {
          "type": "string",
          "minLength": 1
        },
        "price_book_version": {
          "type": "string",
          "minLength": 1
        },
        "result_status": {
          "type": "string",
          "enum": [
            "complete",
            "empty"
          ]
        },
        "charged_amount": {
          "type": "string"
        },
        "balance_after": {
          "type": "string"
        },
        "currency": {
          "type": "string",
          "const": "CNY"
        }
      },
      "required": [
        "listing_id",
        "version",
        "catalog_release_id",
        "price_book_version",
        "result_status",
        "charged_amount",
        "balance_after",
        "currency"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "code",
    "request_id",
    "message",
    "data",
    "page",
    "warnings",
    "meta"
  ],
  "additionalProperties": false
}

已知限制

  • 只读取调用时仍公开可访问的帖子。
  • 互动指标和媒体可用性会随 X 当前状态变化。

接入示例

REST(cURL)

curl -X POST https://api.dataxapi.com/v1/x/posts/detail \
  -H "Authorization: Bearer $DATAXAPI_API_KEY" \
  -H "Idempotency-Key: your-stable-intent-key" \
  -H "Content-Type: application/json" \
  -d '{"tweet_id":"1808168603721650364"}'

Exact MCP Preview(Codex 配置)

[mcp_servers.dataxapi]
url = "https://api.dataxapi.com/mcp"
bearer_token_env_var = "DATAXAPI_API_KEY"

同一个 API Key 只会暴露其 Scope 内的精确 Tool。请把 Key 放在环境变量中,不要写入配置文件。需要安全重试时,请显式复用 idempotency_key。

查看客户端兼容状态 →

目录发布物: catalog-production-2026-09-17.1 · PriceBook: pricebook-production-2026-09-17.1