# Community posts API

> 2 endpoints on 2 platforms return community posts as the same Post object. The posts inside one community, group or forum, hot, newest or top first, each with its title, text, author, score and com…

Canonical page: https://okdata.online/roles/communities-posts-list/

2 endpoints on 2 platforms return community posts as the same Post object. The posts inside one community, group or forum, hot, newest or top first, each with its title, text, author, score and comment count. A call costs from $0.0003 to $0.004, each endpoint at its own price; a failed call is free.

## on each platform

| Platform | Endpoint | Path | A page | Price |
|---|---|---|---|---|
| Reddit | [Reddit community posts](https://okdata.online/apis/reddit/subreddits/posts/list/) | `GET /v1/reddit/subreddits/posts/list` | 25 | $0.004 per call · about 25 posts per page |
| X (Twitter) | [X community posts](https://okdata.online/apis/x/communities/posts/list/) | `GET /v1/x/communities/posts/list` | 20 | $0.0003 per post · at most $0.006 per call |

## The object it returns: [Post](https://okdata.online/docs/objects/post/)

Every endpoint above returns these fields with the same names and types. A field a platform does not show comes back null and is named in meta.unavailable.

| Field | Type | Meaning |
|---|---|---|
| `id` | `string` | Post ID on the platform. |
| `url` | `string` | Link to the post. |
| `type` | `string` | What kind of post it is. |
| `title` | `string \| null` | Title, where the platform has one (videos, notes, articles). |
| `text` | `string` | Caption, body or description as plain text; articles come as Markdown. |
| `lang` | `string \| null` | Language code, as reported or detected. |
| `published_at` | `string \| null` | When it was published, ISO 8601 in UTC; null only where the source gives no time (wechat_mp.articles.metrics, wechat_channels.videos.metrics, youtube.channels.videos.list with type=short), then listed in meta.unavailable. |
| `author` | `AccountRef` | Who posted it. |
| `metrics` | `Metrics` | Counts at fetch time; a count the platform hides is null. |
| `images` | `string[] \| null` | Image URLs for image posts and notes. |
| `hashtags` | `string[] \| null` | Hashtags or topics, without the # sign. |
| `ext` | `object` | Platform-specific extras. Only returned with view=full. |

## The same call on two platforms

Same parameters, same paging, same response shape. Only the path changes.

```bash
# Reddit
curl -G "https://api.okdata.online/v1/reddit/subreddits/posts/list" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=nasa'

# X (Twitter)
curl -G "https://api.okdata.online/v1/x/communities/posts/list" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode 'id=1539231166569410560'
```

## What people use it for

- Read what a product’s own community complains about this week.
- Collect the top posts of a niche community as research material.
- Watch a community for posts that mention your brand.

## Questions

### Which order should I use?

Hot for what members discuss now, newest for monitoring, top for the best posts over a period. Where a top order takes a time window, the endpoint page says which windows it accepts.

### How is this different from search?

Search looks across the whole platform for your words. A community list stays inside one community and returns its posts whether or not they contain your keyword.

### Which platforms have it?

Platforms built around named communities, such as forums with sub-groups. Endpoints are added one platform at a time; the table above lists the ones you can call now.

## Other data types

- [Comments API](https://okdata.online/roles/posts-comments-list/)
- [Trending topics API](https://okdata.online/roles/trends-list/)
- [Comment replies API](https://okdata.online/roles/comments-replies-list/)
- [Hashtag posts API](https://okdata.online/roles/topics-posts-list/)
- [Profile API](https://okdata.online/roles/accounts-get/)
- [Account posts API](https://okdata.online/roles/accounts-posts-list/)
- [Post detail API](https://okdata.online/roles/posts-get/)
- [Post search API](https://okdata.online/roles/posts-search/)
- [Trending posts API](https://okdata.online/roles/posts-trending/)
- [Account search API](https://okdata.online/roles/accounts-search/)
- [Post metrics API](https://okdata.online/roles/posts-metrics/)
- [Ad detail API](https://okdata.online/roles/ads-get/)
- [Advertiser ads API](https://okdata.online/roles/advertisers-ads-list/)
- [Ad search API](https://okdata.online/roles/ads-search/)
- [Transcript API](https://okdata.online/roles/transcripts-get/)
- [Followers list API](https://okdata.online/roles/accounts-followers-list/)
- [Product detail API](https://okdata.online/roles/products-get/)
- [Product reviews API](https://okdata.online/roles/products-reviews-list/)
- [Product search API](https://okdata.online/roles/products-search/)
- [Creator search API](https://okdata.online/roles/creators-search/)
- [Creator profile API](https://okdata.online/roles/creators-get/)
- [Creator audience API](https://okdata.online/roles/creators-audience-get/)
