Tweet Detail
API for getting detailed Twitter tweet information
Tweet Detail
Get detailed information about a specific Twitter tweet, including content, comments, retweets, quotes, etc.
Request
URL: /api/twitter/tweet-detail
Method: GET or POST
Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| restId | string | Yes | Unique ID identifier of the tweet |
Response
A successful response will return detailed information about the tweet, including tweet content, creation time, author information, like count, retweet count, comments, media content, etc.
Examples
Request Example
# GET request
curl --request GET \
--url 'https://www.aidir.fun/api/twitter/tweet-detail?restId=1234567890' \
--header 'X-API-Key: <api-key>'
# POST request
curl --request POST \
--url 'https://www.aidir.fun/api/twitter/tweet-detail' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"restId": "1234567890"
}'Response Example
{
"data": {
"tweet": {
"id": "1234567890",
"rest_id": "1234567890",
"text": "This is the content of the tweet with some interesting information.",
"created_at": "2023-04-15T14:34:12.000Z",
"author": {
"id": "9876543210",
"rest_id": "9876543210",
"name": "Tweet Author",
"screen_name": "tweetauthor",
"profile_image_url": "https://pbs.twimg.com/profile_images/1234567890/avatar.jpg"
},
"favorite_count": 1234,
"retweet_count": 567,
"reply_count": 89,
"quote_count": 23,
"media": [
{
"type": "photo",
"url": "https://pbs.twimg.com/media/sample.jpg",
"width": 1200,
"height": 800
}
],
"replies": {
"entries": [
{
"content": {
"tweet": {
"id": "9876543210",
"text": "This is a reply to the main tweet",
"created_at": "2023-04-15T15:12:34.000Z",
"author": {
"id": "5432109876",
"name": "Reply Author",
"screen_name": "replyauthor"
}
}
}
}
]
}
}
}
}Error Responses
| Status Code | Description |
|---|---|
| 400 | Request parameter error, e.g., missing required restId parameter |
| 401 | Authentication failed, API key invalid or missing |
| 404 | Tweet does not exist or has been deleted |
| 500 | Internal server error |
Getting Tweet ID
To use this API, you need to know the tweet's restId. You can obtain it through the following methods:
- On the Twitter web version, the tweet's URL usually contains its ID, such as
https://twitter.com/username/status/1234567890, where1234567890is the tweet ID - Use other Twitter API interfaces, such as user tweet lists, search results, etc., which return data containing tweet IDs
Aidir Docs