Docs
Community details
Community details
Name, description, rules, member count and admins of a community.
GET
/communities/{communityId}Parameters
communityIdpath · string · requiredNumeric community ID, the number in the community URL.
Example request
curl 'https://api.twittrapi.com/communities/1500000000000000000' \
--header 'X-API-KEY: YOUR_API_KEY'from twittrapi import TwittrAPI
client = TwittrAPI(api_key="YOUR_API_KEY")
data = client.communities.get("1500000000000000000")import { TwittrAPI } from "twittrapi";
const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
const data = await client.communities.get("1500000000000000000");curl 'https://twitter-aio.p.rapidapi.com/communities/1500000000000000000' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
--header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'Base URL https://api.twittrapi.com, key in the X-API-KEY header. Python and Node.js use the official SDKs.
Response
Raw JSON of X's CommunityQuery.
Simple format (?format=simple or X-Response-Format: simple): {data: Community}. Schema.
{
"data": {
"communityResults": {
"id": "Q29tbXVuaXR5UmVzdWx0czoxNzYyNDk0Mjc2NTY1NDI2NTky",
"result": {
"__typename": "Community",
"actions": {
"id": "Q29tbXVuaXR5QWN0aW9uczoxNzYyNDk0Mjc2NTY1NDI2NTky",
"join_action_result": {
"__typename": "CommunityJoinAction"
},
"list_members_action_result": {
"__typename": "CommunityListMembersAction"
}
},
"created_at": 1709046355754,
"creator_results": {
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMQ==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
"is_blue_verified": true,
"legacy": {
"screen_name": "example_user_1",
"verified": false
}
}
},
"custom_banner_media": {
"id": "QXBpTWVkaWE6DAATCgABG9hLw10WsAAAAA==",
"media_info": {
"__typename": "ApiImage",
"color_info": {
"palette": [
{
"percentage": 71.75,
"rgb": {
"blue": 74,
"green": 45,
"red": 21
}
},
{
"percentage": 14.72,
"rgb": {
"blue": 119,
"green": 61,
"red": 28
}
},
{
"percentage": 8.78,
"rgb": {
"blue": 19,
"green": 8,
"red": 4
}
},
{
"percentage": 3.89,
"rgb": {
"blue": 190,
"green": 141,
"red": 75
}
},
{
"percentage": 0.17,
"rgb": {
"blue": 189,
"green": 120,
"red": 56
}
}
]
},
"original_img_height": 720,
"original_img_url": "https://pbs.twimg.com/community_banner_img/2006436936446029824/n1OK-QV1?format=jpg&name=orig",
"original_img_width": 1800
}
},
"default_banner_media": {
"id": "QXBpTWVkaWE6DAABCgABFECTH+kUUAQKAAITiFWq8lUQBAAA",
"media_info": {
"__typename": "ApiImage",
"color_info": {
"palette": [
{
"percentage": 57.34,
"rgb": {
"blue": 178,
"green": 171,
"red": 3
}
},
{
"percentage": 23.51,
"rgb": {
"blue": 129,
"green": 117,
"red": 247
}
},
{
"percentage": 6.99,
"rgb": {
"blue": 159,
"green": 149,
"red": 224
}
},
{
"percentage": 4.78,
"rgb": {
"blue": 194,
"green": 188,
"red": 159
}
},
{
"percentage": 1.32,
"rgb": {
"blue": 103,
"green": 90,
"red": 246
}
}
]
},
"original_img_height": 480,
"original_img_url": "https://pbs.twimg.com/media/FECTH-kUUAQMe8W.jpg",
"original_img_width": 1200
}
},
"description": "Discuss the state of AI from industry insiders and anons 🕵️♂️",
"id": "Q29tbXVuaXR5OjE3NjI0OTQyNzY1NjU0MjY1OTI=",
"invites_result": {
"__typename": "CommunityInvitesUnavailable"
},
"is_member": false,
"is_nsfw": false,
"join_policy": "Open",
"join_requests_result": {
"__typename": "CommunityJoinRequestsUnavailable"
},
"member_count": 30718,
"members_facepile_results": [
{
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMQ==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAx",
"legacy": {
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg"
}
}
},
{
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMg==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAy",
"legacy": {
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg"
}
}
},
{
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwMw==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDAz",
"legacy": {
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg"
}
}
},
{
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwNA==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDA0",
"legacy": {
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg"
}
}
},
{
"id": "VXNlclJlc3VsdHM6MTAwMDAwMDAwMDAwMDAwMDAwNQ==",
"result": {
"__typename": "User",
"id": "VXNlcjoxMDAwMDAwMDAwMDAwMDAwMDA1",
"legacy": {
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1000000000000000000/example_normal.jpg"
}
}
}
],
"name": "AI — Rumors & Insights",
"primary_community_topic": {
"topic_name": "Artificial Intelligence"
},
"rest_id": "1762494276565426592",
"role": "NonMember",
"rules": [
{
"description": "Post useful, relevant, informative AI insights",
"id": "Q29tbXVuaXR5UnVsZToxOTg1NzY2MzU5MzUyMTY0Nzg2",
"name": "Make relevant and useful posts 🙂",
"rest_id": "1985766359352164786"
},
{
"description": "Post high quality, original content",
"id": "Q29tbXVuaXR5UnVsZToxOTg0NDQxNzQzNTIyMDc5MDYx",
"name": "Make sure content is High Quality 📈",
"rest_id": "1984441743522079061"
},
{
"description": "Do not self-quote. Quote posts must add useful info.",
"id": "Q29tbXVuaXR5UnVsZToxOTg0NDQyNDI0NDM4MDEwMDY2",
"name": "Quote Posts must add useful info ⚠️",
"rest_id": "1984442424438010066"
},
{
"description": "No spam, promo / ads, off-topic, hashtags",
"id": "Q29tbXVuaXR5UnVsZToyMDMyMzg0MzkxNTgyODE0NTM0",
"name": "Do not post Spam 🗑️",
"rest_id": "2032384391582814534"
},
{
"description": "Don't post about same thing if others posts first.",
"id": "Q29tbXVuaXR5UnVsZToxOTI3ODEzMzE0NjgxMTU5ODY4",
"name": "Check earlier posts 💬",
"rest_id": "1927813314681159868"
},
{
"description": "Provide source directly in the main post!",
"id": "Q29tbXVuaXR5UnVsZToxOTI1MDkyMDA2Nzc2MTgwOTg3",
"name": "Source the insights 🔎",
"rest_id": "1925092006776180987"
},
{
"description": "Do not vague post and verify your information before you post!",
"id": "Q29tbXVuaXR5UnVsZToxOTU0NTAyMzk5MzE5NTYwMzQ0",
"name": "Verify your information 🕵♂",
"rest_id": "1954502399319560344"
},
{
"description": "Do not share working methods to access info on unreleased products / services in the scope of AI.",
"id": "Q29tbXVuaXR5UnVsZToyMDQ1NTg2NDkyODMyMDMwODY1",
"name": "Don't share access methods 🤫",
"rest_id": "2045586492832030865"
}
],
"trending_hashtags_slice": {
"__typename": "CommunityHashtagSlice",
"items": []
}
}
}
}
}{
"data": {
"id": "1762494276565426592",
"name": "AI — Rumors & Insights",
"description": "Discuss the state of AI from industry insiders and anons 🕵️♂️",
"createdAt": "2024-02-27T15:05:55Z",
"memberCount": 30718,
"moderatorCount": 0,
"joinPolicy": "Open",
"nsfw": false,
"topic": "Artificial Intelligence",
"bannerUrl": "https://pbs.twimg.com/community_banner_img/2006436936446029824/n1OK-QV1?format=jpg&name=orig",
"creator": null,
"rules": [
{
"id": "1985766359352164786",
"name": "Make relevant and useful posts 🙂",
"description": "Post useful, relevant, informative AI insights"
},
{
"id": "1984441743522079061",
"name": "Make sure content is High Quality 📈",
"description": "Post high quality, original content"
},
{
"id": "1984442424438010066",
"name": "Quote Posts must add useful info ⚠️",
"description": "Do not self-quote. Quote posts must add useful info."
},
{
"id": "2032384391582814534",
"name": "Do not post Spam 🗑️",
"description": "No spam, promo / ads, off-topic, hashtags"
},
{
"id": "1927813314681159868",
"name": "Check earlier posts 💬",
"description": "Don't post about same thing if others posts first."
},
{
"id": "1925092006776180987",
"name": "Source the insights 🔎",
"description": "Provide source directly in the main post!"
},
{
"id": "1954502399319560344",
"name": "Verify your information 🕵♂",
"description": "Do not vague post and verify your information before you post!"
},
{
"id": "2045586492832030865",
"name": "Don't share access methods 🤫",
"description": "Do not share working methods to access info on unreleased products / services in the scope of AI."
}
]
}
}In the raw format, field names and nesting come from X and can change without notice. See Response format; the simple format keeps a fixed schema.
Errors
- 422communityId is not numeric.
Errors every endpoint can return (401, 402, 403, 404, 408, 409, 429, 5xx), and which of them are charged, are on the Errors page. Calls that fail with 400, 408, 409 or a 5xx error are refunded.