> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Get Community

> Retrieve a community by ID and observe community updates with the SDK.

Call the get-community API with a `communityId` to retrieve a community's profile fields, counts, membership status, and settings. TypeScript and iOS expose Live Object style APIs, Android exposes an Rx stream, and Flutter exposes both a deprecated one-shot future and a live stream.

> [card] Community Details
>
> Access name, description, avatar, and basic community information

> [card] Membership Data
>
> View member counts, join status, and community accessibility

> [card] Live Updates
>
> Real-time synchronization of community changes and member activity

> [card] Preview Mode
>
> Retrieve community data without joining

> [!NOTE]
>
> Use the live/observable form for detail screens so the UI can react when the community changes.

## Parameters

| Operation | Parameter | Required | Description |
| - | - | - | - |
| Get community by ID | `communityId` | Yes | Unique identifier of the community to retrieve. |

## Get Community by ID

The get-community API retrieves a community by ID. Use it for detail screens, join previews, and any workflow that needs the current community record before taking an action.

```swift iOS theme={null}
var token: AmityNotificationToken?

func observeCommunity(communityId: String) {
    token = communityRepository.getCommunity(withId: communityId).observe { liveObject, error in
        if let error = error {
            print("Error retrieving community: \(error)")
            return
        }

        guard let community = liveObject.snapshot else {
            print("Community not found")
            return
        }

        print("Community ID: \(community.communityId)")
        print("Name: \(community.displayName)")
    }
}
```

```kotlin Android theme={null}
fun observeCommunity() {
    AmitySocialClient.newCommunityRepository()
        .getCommunity(communityId = "communityId")
        .doOnNext { community: AmityCommunity ->
            println("Community ID: ${community.getCommunityId()}")
            println("Name: ${community.getDisplayName()}")
        }
        .doOnError { error ->
            println("Error retrieving community: ${error.message}")
        }
        .subscribe()
}
```

```typescript TypeScript theme={null}
import { CommunityRepository } from '@amityco/ts-sdk';

const unsubscriber = CommunityRepository.getCommunity(
  'communityId',
  ({ data: community, loading, error }) => {
    if (error) {
      // Handle any errors that occur during retrieving data
    }
    if (loading) {
      // Handle the loading state, e.g., show a loading spinner
    }
    if (community) {
      // Process the data
    }
  },
);
```

```dart Flutter theme={null}
void observeCommunity(String communityId) {
  AmitySocialClient.newCommunityRepository()
      .live
      .getCommunity(communityId)
      .listen((AmityCommunity community) {
        // Render community.
      }, onError: (error) {
        // Handle error.
      });
}
```

## Related Topics

> [card] [Query Communities](/social-plus-sdk/social/communities-spaces/discovery/query-communities.md)
>
> Discover communities through search and filtering

> [card] [Join Community](../membership/join-leave-community)
>
> Learn how to implement community membership actions

> [card] [Community Categories](/social-plus-sdk/social/communities-spaces/organization/community-categories.md)
>
> Understand community organization and categorization

> [card] [Trending Communities](/social-plus-sdk/social/communities-spaces/discovery/trending-and-recommended-communities.md)
>
> Implement community recommendation features


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.