Endpoints by data type
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 comment count. A call costs from $0.0003 to $0.004, each endpoint at its own price; a failed call is free.
Community posts · on each platform
| Platform | Endpoint | Path | A page | Price |
|---|---|---|---|---|
| Reddit community posts | GET /v1/reddit/subreddits/posts/list | 25 | $0.004 per call · about 25 posts per page | |
| X (Twitter) | X community posts | GET /v1/x/communities/posts/list | 20 | $0.0003 per post · at most $0.006 per call |
from $0.0003 to $0.004 a call, each endpoint at its own price. A call that fails costs nothing.
The object it returns: 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.
# 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.