---
title: "查询帖子"
canonical_url: "https://tweetstream.io/zh-cn/docs/api/lookup-tweet"
last_updated: 2026-11-05
---

# 查询帖子

返回一条帖子及其互动数据。

Canonical URL: https://tweetstream.io/zh-cn/docs/api/lookup-tweet

## `GET /api/tweet/{id}`

`https://api.tweetstream.io/api/tweet/{id}`

## 授权

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `Authorization` | `string`, 必填 | 使用 TweetStream API 密钥进行 Bearer 认证：`Bearer <key>`。 |

## 路径参数

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `id` | `string`, 必填 | 帖子 ID。 |

## 响应字段

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| `metrics` | `object`, 必填 |  |
| `metrics.bookmarks` | `integer`, 必填 |  |
| `metrics.likes` | `integer`, 必填 |  |
| `metrics.quotes` | `integer`, 必填 |  |
| `metrics.replies` | `integer`, 必填 |  |
| `metrics.reposts` | `integer`, 必填 |  |
| `metrics.views` | `integer \| null`, 必填 |  |
| `tweet` | `object`, 必填 | The same fields as content in a TWEET History row. A reply that also quotes a post has kind reply, its parent in ref, and the post it quotes in quoted. |
| `tweet.kind` | `enum<string>` |  |
| `tweet.quoted` | `object` | The post a reply also quotes. A quote keeps the post it quotes in ref and has no quoted. |
| `tweet.quoted.type` | `string`, 必填 |  |
| `tweet.ref` | `object` |  |
| `tweet.ref.type` | `enum<string>`, 必填 |  |

## 响应

| 状态 | 说明 | 请求头 |
| --- | --- | --- |
| `200` | 成功 |  |
| `400` | 帖子 ID 无效 |  |
| `401` | API key 缺失或无效 |  |
| `403` | 该 API key 所属账号没有付费或试用中的订阅。 |  |
| `404` | 找不到帖子 |  |
| `429` | 已达到速率限制（每个账号每分钟 60 次查询，突发最多 10 次），或该账号已有 4 个查询正在进行 | `Retry-After` |
| `503` | 查询或认证暂时不可用 | `Retry-After` |

### 200

```json
{
  "tweet": {
    "tweetId": "1234567890",
    "text": "Rate decision at 2pm ET.",
    "createdAt": 1744156800000,
    "kind": "post",
    "link": "https://x.com/marketdesk/status/1234567890",
    "author": {
      "id": "1189745302",
      "handle": "@marketdesk",
      "name": "Market Desk",
      "platform": "twitter",
      "verifiedType": "blue",
      "followersCount": 48210,
      "followingCount": 312,
      "joinedAt": 1358208000000,
      "profileImage": "https://pbs.twimg.com/profile_images/marketdesk_400x400.jpg"
    }
  },
  "metrics": {
    "likes": 1204,
    "replies": 87,
    "reposts": 230,
    "quotes": 19,
    "bookmarks": 41,
    "views": 98213
  }
}
```

### 400

```json
{
  "error": "<string>"
}
```

### 401

```json
{
  "error": "<string>"
}
```

### 403

```json
{
  "error": "<string>"
}
```

### 404

```json
{
  "error": "<string>"
}
```

### 429

```json
{
  "error": "<string>",
  "retryAfterSeconds": 0
}
```

### 503

```json
{
  "error": "<string>"
}
```

## 代码示例

### cURL

```bash
curl --request GET \
  --url https://api.tweetstream.io/api/tweet/1585841080431321088 \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY"
```

### JavaScript

```javascript
const response = await fetch("https://api.tweetstream.io/api/tweet/1585841080431321088", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
  },
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.get(
    "https://api.tweetstream.io/api/tweet/1585841080431321088",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
)

print(response.status_code, response.json())
```
