# How to check if there is a user in the group or not?

**URL:** https://meta.discourse.org/t/how-to-check-if-there-is-a-user-in-the-group-or-not/74869
**Category:** Development
**Created:** [November 27, 2017, 9:56am UTC](https://meta.discourse.org/t/how-to-check-if-there-is-a-user-in-the-group-or-not/74869 "2017-11-27T09:56:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [November 27, 2017, 9:56am UTC](https://meta.discourse.org/t/how-to-check-if-there-is-a-user-in-the-group-or-not/74869/1 "2017-11-27T09:56:51Z")

</div>

At the moment I’m using the API (180ms time).

```
 $.ajax({
  url: "/u/"+ username +".json" ,
  dataType: 'json',
  async: false,
  success: function(data) {
...
 for (var t = 0; t < groups.length; t++) { 
 g_id = groups[t].id;
 if (g_id === 57) { ...

```

Maybe there is some other way to get this data? Through the API, other data unnecessary for the plugin is requested. I would like to get only one value. The user belongs to a particular group or not.
