API para Reddit: Posts do subreddit
Posts da listagem de um subreddit (hot, new ou top), com janelas de tempo. Pagine com o cursor after.
US$ 0,38/mil req., pague por requisição, sem assinatura.
r/MechanicalKeyboards
r/MechanicalKeyboards·u/soldernoob· Jun 12, 2024
My first custom build is finally done
{"id": "t3_1def567","title": "My first custom build is finally done","author": "soldernoob","score": 5412,"numComments": 218,"url": "https://www.reddit.com/r/MechanicalKeyboards/comments/1def567/","permalink": "/r/MechanicalKeyboards/comments/1def567/","createdUtc": 1718180000,... 7 campos a mais}
Preços e provedores
Preços do endpoint Posts do subreddit da API para Reddit: uma API, 3 provedores intercambiáveis
O provedor mais barato atende primeiro. Se ele falhar, o próximo assume na mesma chamada.
Teste
Obtenha Posts do subreddit do Reddit em uma só requisição
Este exemplo mostra 13 de 20 campos. Ver todos os campos
{
"found": true,
"data": {
"posts": [
{
"id": "t3_1def567",
"title": "My first custom build is finally done",
"author": "soldernoob",
"score": 5412,
"numComments": 218,
"url": "https://www.reddit.com/r/MechanicalKeyboards/comments/1def567/",
"permalink": "/r/MechanicalKeyboards/comments/1def567/",
"createdUtc": 1718180000,
"subreddit": "MechanicalKeyboards"
}
],
"nextCursor": "t3_1def567"
}
}Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.
Referência
Uma requisição, um formato de resposta.
Cada campo que você envia e cada campo que você recebe, cada um com um exemplo real.
Última verificação em 2026-11-14 · disponibilidade e latência medidas em 30d
Corpo da requisição
JSON, enviado via POST para este endpoint.
- subredditstring
MechanicalKeyboards
Nome do subreddit sem o r/ inicial (ex.: "golang").
- afterstring
Alias de paginação legado. Prefira `cursor`; omita os dois campos na primeira página.
- cursorstring
Cursor de paginação opaco do `nextCursor` de uma resposta anterior; omita na primeira página.
- limitinteger
Page size to ask for (up to 100). Some sources honor it; others always return their whole page of about 25 posts. A page is never trimmed after the call, so pass nextCursor back as cursor to continue exactly where this response ended.
- requireFieldsarray
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 `selftext`, 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.
- sortenum
hot
Ordem da listagem.
- timeframeenum
Janela de tempo, aplicada quando sort é "top" (ex.: "year" para os posts mais votados do ano). Ignorada para hot/new. Omita para usar o dia atual como padrão em top.
Resposta
JSON, um valor de exemplo por campo.
- nextCursorstring
t3_1def567
Cursor for the next page of results; pass it back as the `cursor` input to fetch the following page. Null when there are no more results.
Populated whenever the provider has data for the entity.
- authorstring
soldernoob
Author username, without the u/ prefix. Populated whenever the provider has data for the entity.
- authorIdstring
Reddit account ID of the author, without the t2_ prefix.
- createdUtcnumber
1718180000
UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity.
- idstring
t3_1def567
Reddit post ID (base-36, without the t3_ prefix). Populated whenever the provider has data for the entity.
- isArchivedbooleanpode ser exigido
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.
- isLockedbooleanpode ser exigido
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.
- nsfwboolean
Whether the post is marked not-safe-for-work.
- numCommentsinteger
218
Total number of comments on the post.
- permalinkstring
/r/MechanicalKeyboards/comments/1def567/
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.
- scoreinteger
5412
Net score (upvotes minus downvotes) at fetch time.
- selftextstringpode ser exigido
Body text of a self post, as Markdown. Empty on a link post, which has no body.
- subredditstring
MechanicalKeyboards
Subreddit name, without the r/ prefix. Populated whenever the provider has data for the entity.
- titlestring
My first custom build is finally done
Post title. Populated whenever the provider has data for the entity.
- upvoteRationumber
Share of votes on the post that are upvotes, between 0 and 1.
- urlstring
https://www.reddit.com/r/MechanicalKeyboards/comments/1def567/
The post's destination link: the external URL for a link post, the media URL for an image, gallery or video post, or the thread URL for a text post. A text post that also carries an image may give either its thread URL or the image URL. Populated whenever the provider has data for the entity.
- foundboolean
true
- reason"not_found" | "banned" | "private"
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. `banned`: the platform has banned the community. `private`: the community is private, so only its approved members can see it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.
Vende esta API? Veja o schema completo que o seu endpoint precisa retornar.
Dúvidas frequentes
Sobre o endpoint Posts do subreddit da API para Reddit
O endpoint Posts do subreddit da AnyAPI para Reddit retorna dados de Reddit em JSON normalizado com uma chamada POST para /v1/run/reddit.subreddit_posts. Posts da listagem de um subreddit (hot, new ou top), com janelas de tempo. Pagine com o cursor after. 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 subreddit da API para Reddit feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 2,0 segundos, em 100.133 chamadas medidas.