> For the complete documentation index, see [llms.txt](https://painor.gitbook.io/gramjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://painor.gitbook.io/gramjs/getting-started/available-methods/getting-participants-of-a-group-channel.md).

# Getting participants of a group/channel

GramJS provides two friendly methods to get a list of participants from a channel a group.&#x20;

The interface looks like this. you can read more about filters here <https://core.telegram.org/type/ChannelParticipantsFilter>

{% tabs %}
{% tab title="TypeScript" %}

```typescript
export interface IterParticipantsParams {
    limit?: number,
    search?: string,
    filter?: Api.TypeChannelParticipantsFilter,
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="TypeScript" %}

```typescript
getParticipants(entity: EntityLike, params: chatMethods.IterParticipantsParams);
```

{% endtab %}

{% tab title="Javascript" %}

```
getParticipants(entity, params);
```

{% endtab %}
{% endtabs %}

which returns an array with a `.total` attribute returning the real number of users in the group.

you can also use an iterator with `iterParticipants`

## Examples:

#### Using `iterParticipants`

```javascript
const participants = client.iterParticipants("your_entity_here", {
    limit: 10,
});
for await (const participant of participants) {
    //console.log("participant is", participant); // this line is very verbose but helpful for debugging
    console.log("username text is : ", participant.username);
}
```

#### Using `getParticipants`

```javascript
const result = await client.getParticipants("gramjs",{
    limit:10
});
console.log(result);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://painor.gitbook.io/gramjs/getting-started/available-methods/getting-participants-of-a-group-channel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
