API para Reddit: Posts do usuário
Liste os posts de um usuário do Reddit pelo nome de usuário, ordenados por new, top, hot ou controversial, com paginação por cursor.
Rede de provedores
Provedores ordenados por tráfego
Teste
Faça sua primeira requisição
{
"data": {
"nextCursor": "example",
"posts": [
{
"author": "Alex Rivera",
"authorId": "Alex Rivera",
"createdUtc": 12.5,
"id": "a1b2c3d4",
"isArchived": false,
"isLocked": true,
"media": [
{
"height": 42,
"type": "general",
"url": "https://example.com/page",
"videoUrl": "https://example.com/page",
"width": 1024
}
],
"nsfw": true,
"numComments": 12500,
"permalink": "https://example.com/page",
"score": 5,
"selftext": "A short example description of this item.",
"subreddit": "example",
"title": "Example title",
"upvoteRatio": 12.5,
"url": "https://example.com/page"
}
]
},
"found": true,
"reason": "not_found"
}interface RedditUserPostsResponse {
data: {
nextCursor: string | null;
posts: {
author: string;
authorId?: string;
createdUtc: number;
id: string;
isArchived?: boolean;
isLocked?: boolean;
media?: {
height?: number;
type: string | null;
url: string;
videoUrl?: string;
width?: number;
}[];
nsfw?: boolean;
numComments?: number;
permalink: string;
score?: number;
selftext?: string;
subreddit?: string;
title: string;
upvoteRatio?: number;
url?: string;
}[];
} | null;
found: boolean;
reason?: "not_found";
}Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.
Referência
Requisição, resposta e preço
Última verificação em 2026-09-29 · disponibilidade e latência medidas em 30dcurl -X POST https://api.getanyapi.com/v1/run/reddit.user_posts \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"username":"spez"}'| Campo | Tipo | Valor de exemplo |
|---|---|---|
| Corpo da requisição | ||
| username | string | "spez"Nome de usuário do Reddit sem o prefixo u/ inicial (ex.: "spez"). |
| cursor | string | Cursor de paginação opaco vindo do nextCursor de uma resposta anterior. Omita na primeira página; envie-o de volta para buscar a próxima. |
| requireFields | array | Opcional; se omitido, o roteamento não muda e a fonte mais barata atende. Informe os campos de saída que esta requisição precisa poder retornar, por exemplo `isArchived` ou `isLocked`, e ela só será atendida por uma fonte que retorne todos eles. Os campos que você não informar continuam sendo retornados sempre que a fonte que atende os tiver. Isso pode aumentar o seu preço: quando a fonte mais barata não consegue retornar um campo informado, uma fonte mais cara atende, e você recebe a cotação e é cobrado pelo preço dela. Um campo informado ainda pode vir ausente em um post que realmente não o tenha. Se você informar uma combinação de campos que nenhuma fonte retorna sozinha, a requisição é recusada como entrada inválida, sem cobrança. Ao paginar, vale só para a primeira página; as páginas seguintes continuam na fonte que a primeira página escolheu, pelo preço cotado. |
| sort | enum | Ordem dos posts do usuário. O padrão é new (mais recentes primeiro). |
| Resposta | ||
| data | object | One page of the user's posts, or null when the user was not found. |
| data.nextCursor | string | Opaque cursor for the next page of this user's posts; pass it back as the `cursor` input to fetch the following page. Null when there are no more pages. |
| data.posts | object[] | The user's posts in feed order. Posts hosted on the user's own profile (r/u_<name>) are included and carry an empty subreddit. Populated whenever the provider has data for the entity. |
| data.posts[].author | string | Author username, without the u/ prefix. Populated whenever the provider has data for the entity. |
| data.posts[].authorId | string | Reddit account ID of the author, without the t2_ prefix. |
| data.posts[].createdUtc | number | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. |
| data.posts[].id | string | Reddit post ID (base-36, without the t3_ prefix). Populated whenever the provider has data for the entity. |
| data.posts[].isArchivedpode ser exigido | boolean | True when Reddit has archived the thread, which blocks new comments and votes. Archiving is a per-community setting, so an old thread is not necessarily archived. Absent when the source that served this request does not report it, which means unknown rather than false. |
| data.posts[].isLockedpode ser exigido | boolean | True when a moderator has locked the thread, which blocks new comments. Absent when the source that served this request does not report it, which means unknown rather than false. |
| data.posts[].media | object[] | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| data.posts[].media[].height | integer | |
| data.posts[].media[].type | string | One of photo, video, or gif, or null when the serving source wraps a thumbnail it cannot classify. |
| data.posts[].media[].url | string | Image URL. For a video or GIF this is the poster/thumbnail frame. |
| data.posts[].media[].videoUrl | string | Playable video file URL. Present only for video and gif items. |
| data.posts[].media[].width | integer | |
| data.posts[].nsfw | boolean | Whether the post is marked not-safe-for-work. |
| data.posts[].numComments | integer | Total number of comments on the post. |
| data.posts[].permalink | string | Canonical reddit.com thread path for the post (e.g. "/r/golang/comments/abc123/..."). Differs from url, which is the destination link. Empty if the upstream omits it. Populated whenever the provider has data for the entity. |
| data.posts[].score | integer | Net score (upvotes minus downvotes) at fetch time. |
| data.posts[].selftext | string | Body text of a self post, as Markdown. Empty on a link post, which has no body. |
| data.posts[].subreddit | string | Subreddit name, without the r/ prefix. Populated whenever the provider has data for the entity. |
| data.posts[].title | string | Post title. Populated whenever the provider has data for the entity. |
| data.posts[].upvoteRatio | number | Share of votes on the post that are upvotes, between 0 and 1. |
| data.posts[].url | string | The post's destination link (the external URL for link posts, or the thread URL for self posts). Populated whenever the provider has data for the entity. |
| found | boolean | Whether the user's post feed was returned. |
| reason | "not_found" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| Preço | ||
| Preço por requisição | USD | US$ 0,00038 |
| Preço /mil req. | USD | US$ 0,38 |
Dúvidas frequentes
Sobre o endpoint Posts do usuário da API para Reddit
O endpoint Posts do usuário da AnyAPI para Reddit retorna dados de Reddit em JSON normalizado com uma chamada POST para /v1/run/reddit.user_posts. Liste os posts de um usuário do Reddit pelo nome de usuário, ordenados por new, top, hot ou controversial, com paginação por cursor. A AnyAPI distribui cada requisição entre 3 fontes, com failover automático quando uma falha. Custa a partir de US$ 0,38 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Nos últimos 30 dias, 100,0% das chamadas ao endpoint Posts do usuário da API para Reddit feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 1,6 segundos, em 12 chamadas medidas.