Language navigation

Handle API errors and retry read-only archive requests

Classify HTTP errors, uncertain transport outcomes and local failures before retrying archive reads. Use bounded backoff and budget charged successes.

Record the outcome before deciding to repeat

This service operates as an independent historical archive rather than the official live Reddit API. It does not support Reddit OAuth, posting, voting or private messages. The name Reddit API Proxy does not imply transparent forwarding or bypassing access controls. A GET request reads archived records, but it still has a credit-accounting effect when successful. Read-only is not a guarantee of identical results or free retries.

Separate four outcomes in your application: an HTTP error response, a successful empty response, a transport failure with no usable response and a local processing failure after receiving data. These need different actions. Save an actual received response before transforming records or moving a progress marker. Reprocessing your saved copy locally does not require a new API request; fetching the remote page again is another billable operation if successful.

Start with https://api.redditapiproxy.com/v1/comments?subreddit=devops&limit=3, the homepage example. Keep the archive key server-side and use X-API-Key: <key> or Authorization: Bearer <key>. Either works independently of the account session. Check the host, query parameters and header shape without logging the secret. The request asks for at most three comments, not a complete devops discussion or a guaranteed useful sample.

Choose an action for each HTTP error

For 400, correct the parameters and confirm that the route accepts them. Content searches accept q, subreddit, author, kind, from, to, min_score, limit and page; item instead requires id only, and subreddits accepts prefix and limit. Do not repeatedly resend an unsupported parent_id filter or treat a Reddit URL as an item ID. A valid route contract is more useful than increasing the retry count.

For 401, inspect the key and chosen header rather than retrying the same configuration indefinitely. A signed-in user can regenerate a lost or exposed key after password confirmation; the previous key becomes invalid immediately. There is no password-reset or emailed-key feature. For 402, pause paid work and check balance in the key page's account panel. Funding requires login and an explicitly created invoice before transfer, not an automatic payment attempt from a retrieval retry.

For 429, apply bounded backoff with a maximum attempt count and a delay policy in your own application. This is a request-frequency limit, not proof of a particular load, service tier or guaranteed recovery time. Upstream retrieval failures refund reservations; a client timeout may conceal server success. Backoff reduces repeated demand but cannot guarantee availability or prevent every successful retry charge.

Keep page boundaries and costs with the saved data

Content requests return at most 100 records per page and allow page from 1 to 100 across separate requests. The order is _doc, not chronology, relevance or score. from/to use YYYY-MM-DD UTC dates with the final day included, while min_score filters without sorting. Flat records may contain parent_id and link_id for local grouping; no complete discussion or ancestry is promised.

Read total with relation: eq is exact for the query, gte a lower bound and unknown unreliable or null. None proves that all records were downloaded. Splitting dates and local deduplication can organize processing without proving full coverage, uniqueness or repeat-query stability. Preserve missing fields and unresolved references in your own output instead of interpreting a finished retry queue as complete archive ingestion.

Each successful request, including an empty result or repeat, costs one credit. Invalid requests do not debit and upstream failures refund reservations, but lost responses and local database failures do not establish a refund. Read pricing before planning retries: $1 per 1000 successes, a $50 paid minimum and conditional 100 trial credits. Public /v1/status is free but only confirms HTTP response and static scope; it cannot settle an uncertain retrieval outcome or show balance.