Skip to content

Resource ArticleResource

CrucifiedPain edited this page Jun 26, 2026 · 10 revisions

ArticleResource (client.article)

Endpoints: • article.getArticleById • article.getArticleLiteById • article.getArticlesPaginated (cursor-paginated)

.collect_all()

Fetch all items across all pages concurrently using parallel time-slicing.

Signature

await client.article.collect_all(**kwargs: 'typing.Any') -> 'list[ArticleLite]'

Parameters

Name Type Default
kwargs Any *Required*

Return Models

ArticleLite

Field Type Required Description
_id string Optional
__v integer Optional
title string Optional The title.
authorId string Optional The author id.
countryId string Optional The country id.
type string Optional The type.
category string Optional The category.
language string Optional The language.
score integer Optional The score.
views integer Optional The views.
image string Optional The image.
createdAt string Optional The timestamp when this record was created.
author string Optional The author.
content string Optional The content.
isDeleted boolean Optional The is deleted.
isPublished boolean Optional The is published.
isPublic boolean Optional The is public.
slug string Optional The slug.
publishedAt string Optional The published at.
stats ArticleStats Optional The stats.
updatedAt string Optional The timestamp when this record was last modified.

ArticleStats

Field Type Required Description
_id string Optional
__v integer Optional
comments integer Optional The comments.
dislikes integer Optional The dislikes.
gemTips integer Optional The gem tips.
likes integer Optional The likes.
score integer Optional The score.
subs integer Optional The subs.
tips integer Optional The tips.
views integer Optional The views.

.get()

Get a full article by ID (includes content body).

Signature

await client.article.get(article_id: 'str') -> 'Article'

Parameters

Name Type Default
article_id str *Required*

Return Models

Article

Field Type Required Description
_id string Optional
__v integer Optional
title string Optional The title.
content string Optional The content.
authorId string Optional The author id.
countryId string Optional The country id.
type string Optional The type.
category string Optional The category.
language string Optional The language.
score integer Optional The score.
views integer Optional The views.
comments integer Optional The comments.
image string Optional The image.
createdAt string Optional The timestamp when this record was created.
author string Optional The author.
isDeleted boolean Optional The is deleted.
isPublished boolean Optional The is published.
isPublic boolean Optional The is public.
slug string Optional The slug.
publishedAt string Optional The published at.
stats ArticleStats Optional The stats.
updatedAt string Optional The timestamp when this record was last modified.

ArticleStats

Field Type Required Description
_id string Optional
__v integer Optional
comments integer Optional The comments.
dislikes integer Optional The dislikes.
gemTips integer Optional The gem tips.
likes integer Optional The likes.
score integer Optional The score.
subs integer Optional The subs.
tips integer Optional The tips.
views integer Optional The views.

.get_lite()

Get a lightweight article by ID (metadata only, no content body).

Signature

await client.article.get_lite(article_id: 'str') -> 'ArticleLite'

Parameters

Name Type Default
article_id str *Required*

Return Models

ArticleLite

Field Type Required Description
_id string Optional
__v integer Optional
title string Optional The title.
authorId string Optional The author id.
countryId string Optional The country id.
type string Optional The type.
category string Optional The category.
language string Optional The language.
score integer Optional The score.
views integer Optional The views.
image string Optional The image.
createdAt string Optional The timestamp when this record was created.
author string Optional The author.
content string Optional The content.
isDeleted boolean Optional The is deleted.
isPublished boolean Optional The is published.
isPublic boolean Optional The is public.
slug string Optional The slug.
publishedAt string Optional The published at.
stats ArticleStats Optional The stats.
updatedAt string Optional The timestamp when this record was last modified.

ArticleStats

Field Type Required Description
_id string Optional
__v integer Optional
comments integer Optional The comments.
dislikes integer Optional The dislikes.
gemTips integer Optional The gem tips.
likes integer Optional The likes.
score integer Optional The score.
subs integer Optional The subs.
tips integer Optional The tips.
views integer Optional The views.

.get_paginated()

Get articles (cursor-paginated).

Args: type: Article feed type (daily, weekly, top, my, subscriptions, last). user_id: Filter to articles by a specific author. categories: Filter by category list. languages: Filter by language codes (e.g. ["en", "ro"]). positive_score_only: When True, exclude downvoted articles. auto_items: If True, returns an AsyncIterator of individual items. max_pages: Maximum number of pages to fetch when auto-paginating. cursor_end: Date string. Auto-pagination stops when cursor date is older than this.

Signature

await client.article.get_paginated(type: 'ArticleType | str', *, limit: 'int' = 10, cursor: 'str | None' = None, user_id: 'str | None' = None, categories: 'list[str] | None' = None, languages: 'list[str] | None' = None, positive_score_only: 'bool | None' = None, auto_items: 'bool' = False, max_pages: 'int | float' = inf, cursor_end: 'str | None' = None) -> 'CursorPage[ArticleLite] | AsyncIterator[ArticleLite]'

Parameters

Name Type Default
type ArticleType | str *Required*
limit int 10
cursor str None
user_id str None
categories list[str] None
languages list[str] None
positive_score_only bool None
auto_items bool False
max_pages int | float inf
cursor_end str None

Return Models

ArticleLite

Field Type Required Description
_id string Optional
__v integer Optional
title string Optional The title.
authorId string Optional The author id.
countryId string Optional The country id.
type string Optional The type.
category string Optional The category.
language string Optional The language.
score integer Optional The score.
views integer Optional The views.
image string Optional The image.
createdAt string Optional The timestamp when this record was created.
author string Optional The author.
content string Optional The content.
isDeleted boolean Optional The is deleted.
isPublished boolean Optional The is published.
isPublic boolean Optional The is public.
slug string Optional The slug.
publishedAt string Optional The published at.
stats ArticleStats Optional The stats.
updatedAt string Optional The timestamp when this record was last modified.

ArticleStats

Field Type Required Description
_id string Optional
__v integer Optional
comments integer Optional The comments.
dislikes integer Optional The dislikes.
gemTips integer Optional The gem tips.
likes integer Optional The likes.
score integer Optional The score.
subs integer Optional The subs.
tips integer Optional The tips.
views integer Optional The views.

CursorPage[ArticleLite]

Field Type Required Description
_id string Optional
__v integer Optional
items array[ArticleLite] Required
nextCursor string Optional
hasMore boolean Optional

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.article.invalidate_cache() -> 'None'

Clone this wiki locally