Skip to content

Feed

GET
/api/v1/feed
agent-data call d7ac1bae-c5c2-496b-bcfc-2c984b83ff5b get-feed --source <source> [--subreddit <subreddit>] [--q <q>] [--user elonmusk] [--trend <trend>] [--limit <limit>] [--page_token <page_token>] [--since_token <since_token>]
source
required
Source

Exactly one of hackernews, lobsters, reddit, or x — one source per request. Comma-separated lists and all are rejected. When source=x, also provide exactly one of q, user, or trend. When source=reddit, also provide subreddit. Reuse the same source with any returned cursor.

string
Allowed values: x reddit hackernews lobsters

Exactly one of hackernews, lobsters, reddit, or x — one source per request. Comma-separated lists and all are rejected. When source=x, also provide exactly one of q, user, or trend. When source=reddit, also provide subreddit. Reuse the same source with any returned cursor.

subreddit
Any of:
string

Required when source=reddit; rejected otherwise. Format r/. r/all and r/new are rejected.

q
Any of:
string

X only (source=x). Keyword or hashtag search; returns the newest tweets matching this query. Provide exactly one of q, user, or trend. Rejected when source does not include x.

user
Any of:
string

X only (source=x). A single @handle whose newest tweets to return (e.g. elonmusk); one handle only. This is the only X mode that supports since_token monitoring. Provide exactly one of q, user, or trend.

trend
Any of:
string

X only (source=x). A single trend category to surface: one of trending, news, sport, entertainment. Provide exactly one of q, user, or trend.

limit
Any of:
integer
>= 1 <= 100

Return at most this many feed items in the current response. Omit this parameter to use the source-aware route default (20 for x, since it pages at ~20 items per rate-limited op; 100 for the firehose sources). Increase it only when you need a larger page and can process more rows in one call.

page_token
Any of:
string

Opaque cursor from a prior response’s meta.next_page_token. Omit on the first request. Reuse only with the same source and subreddit that produced it.

since_token
Any of:
string

Fetch only items newer than a previously saved checkpoint by passing the opaque token returned in meta.next_since_token. Omit this parameter when requesting the newest page. Use it for monitoring-style polling rather than for the first page of the feed, and reuse it only with the same source selection and subreddit selection that produced it. For source=x it is supported only with user=.

Successful Response

Media type application/json
FeedResponse
object
data
required
Data
Array<object>
FeedItem
object
id
required
Id
string
url
Any of:
string
title
Any of:
string
author
Any of:
string
source
required
Source
string
Allowed values: x reddit hackernews lobsters
channel
required
Channel
string
item_id
required
Item Id
string
permalink
required
Permalink
string
created_at
required
Created At
string format: date-time
engagement
required
Engagement
object
score
Any of:
integer
view_count
Any of:
integer
quote_count
Quote Count
integer
0
upvote_count
Any of:
integer
comment_count
Comment Count
integer
0
retweet_count
Retweet Count
integer
0
bookmark_count
Bookmark Count
integer
0
poll_option_count
Poll Option Count
integer
0
body_preview
Any of:
string
meta
required
FeedMeta
object
error
Any of:
string
source
required
Source
string
Allowed values: x reddit hackernews lobsters
last_id
Any of:
string
has_more
Has More
boolean
returned
required
Returned
integer
generated_at
required
Generated At
string format: date-time
next_page_token
Any of:
string
checkpoint_error
Any of:
string
next_since_token
Any of:
string
result_direction
Result Direction
string
default: desc
Allowed values: desc asc
checkpoint_status
Checkpoint Status
string
default: ok
Allowed values: ok expired partial
oldest_item_age_seconds
Any of:
integer
Example
{
"data": [
{
"source": "x",
"engagement": {
"quote_count": 0,
"comment_count": 0,
"retweet_count": 0,
"bookmark_count": 0,
"poll_option_count": 0
}
}
],
"meta": {
"source": "x",
"has_more": false,
"result_direction": "desc",
"checkpoint_status": "ok"
}
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
Example generated
{
"detail": [
{
"ctx": {},
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example"
}
]
}