Community Tweets
API for getting latest tweets from Twitter communities
Community Tweets
Get the latest tweets from a Twitter community.
Request
URL: /api/twitter/community-tweets
Method: GET or POST
Request Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| communityId | string | Yes | Unique ID of the community |
Response
A successful response will return the latest tweets from the community, including tweet content, creation time, author information, etc., sorted in reverse chronological order.
Examples
Request Example
# GET request
curl --request GET \
--url 'https://www.aidir.fun/api/twitter/community-tweets?communityId=1234567890' \
--header 'X-API-Key: <api-key>'
# POST request
curl --request POST \
--url 'https://www.aidir.fun/api/twitter/community-tweets' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"communityId": "1234567890"
}'Response Example
{
"data": {
"community": {
"id": "1234567890",
"name": "Tech Enthusiasts",
"description": "A community for tech enthusiasts"
},
"tweets": {
"instructions": [
{
"entries": [
{
"content": {
"tweet": {
"id": "1512345678901234567",
"text": "This is a tweet in the community",
"created_at": "2023-04-15T14:34:12.000Z",
"author": {
"id": "9876543210",
"name": "Community Member",
"screen_name": "communitymember"
},
"favorite_count": 123,
"retweet_count": 45,
"reply_count": 6,
"quote_count": 2
}
}
}
]
}
]
}
}
}Error Responses
| Status Code | Description |
|---|---|
| 400 | Request parameter error, e.g., missing required communityId parameter |
| 401 | Authentication failed, API key invalid or missing |
| 404 | Community does not exist or no access permission |
| 500 | Internal server error |
Aidir Docs