# Communities

Public chat communities, by name, topic and size.

```text
"sources": ["communities"]
```

The `communities` source finds public chat communities. A result is a community, not a message: its name, what it is about, how many members it has and how many are online. It answers "where do people who care about this gather?".

## Good for

- Finding the community for a tool, a game, a language or a hobby.
- Sizing a community before you join or recommend it: `extra.members` and `extra.online`.
- Giving an agent somewhere to send a person for live help.

## Not the place for

- Reading what was said. A result is a community and its description, not a message.
- Dates, page types or site popularity: a community has none of them.

## What a result carries

Every result has the same fields whatever the source; the [Search reference](https://millionshort.com/docs/search/parameters#a-result) lists them. What differs is which of them are filled in:

| Field | In this source |
|---|---|
| `published_date` | `null`. |
| `page_type`, `topic` | `null`. |
| `popularity` | `unknown`. |
| `signals` (with `explain`) | `null` values. |
| `extra` | `kind` (`chat`), `members` and `online`. |

The `extra` keys are what this source returns today. Treat every one of them as optional: read it if it is there.

## Example queries

- `chess`
- `language learning`
- `indie game development`

Ten communities with their size:

```bash
curl https://api.millionshort.com/v1/search \
  -H "Authorization: Bearer $MILLIONSHORT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "language learning",
    "sources": ["communities"],
    "num_results": 10
  }'
```

```python
import os

from millionshort import MillionShort

client = MillionShort(api_key=os.environ["MILLIONSHORT_API_KEY"])

r = client.search(
    "language learning",
    sources=["communities"],
    num_results=10,
)
for hit in r.results:
    print(hit["extra"].get("members"), hit["extra"].get("online"), hit["title"])
print(r.usage.credits, "credit(s)")
```

```ts
import { MillionShort } from 'millionshort';

const client = new MillionShort({ apiKey: process.env.MILLIONSHORT_API_KEY });

const r = await client.search('language learning', {
  sources: ['communities'],
  numResults: 10,
});
for (const hit of r.results) {
  console.log(hit.extra.members, hit.extra.online, hit.title);
}
console.log(r.usage?.credits, 'credit(s)');
```

The same call as a tool of the MCP server:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "search",
    "arguments": {
      "query": "language learning",
      "sources": [
        "communities"
      ],
      "num_results": 10
    }
  }
}
```

## Combine it with

`discussions` for threads on the same subject. One call can ask up to five sources and returns one merged list; each result says which source it came from in `source`. See [Mixture of Experts](https://millionshort.com/docs/search/mixture-of-experts).

## Cost and limits

A search of this source costs 1 credit, like every source, and covers the first 10 results of the call. It is not one of the heavy sources, so only the plan's ordinary requests-per-minute limit applies. [Credits and limits](https://millionshort.com/docs/credits-and-limits) has the numbers.

With [Monitor](https://millionshort.com/docs/monitor/parameters), query monitors are not offered on this source; watch a page with a URL monitor instead.
