POST

API health

24h health
Normal
  • Healthy / normal
  • Available
Normal

Last 24 hours

Last 30 days

Get the rules of one subreddit as a single object. subreddit is required, written as in subreddit_info. The object has community, community_id, url, rules (an array; each item has name and description), menu_links (the links in the community's top menu; each has text and url), apps (an array of the Reddit apps the community has installed), icon_url and banner_url. A community that does not exist, is private or has been banned returns an empty result.

Send POST https://api.everyinfra.com/api/v1/social with platform set to reddit and action set to subreddit_rules. Price $0.79 per 1,000 requests ($0.000792 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.

AI prompt

#
Please help me write a data collection script with the EveryInfra Reddit Subreddit rules endpoint (reddit/subreddit_rules).

How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to reddit and action to subreddit_rules, and put the parameters inside params.
- Required parameters:
  - subreddit: The community whose rules you want: a name (python or r/python) or a community link. One community per call.
- Returns one object. Main fields: community, community_id (Reddit's ID for the community, starting…), url, rules (The community's rules (subreddit_rules)…), menu_links (The links in the community's top menu (…), apps (Names of the Reddit apps the community…), icon_url (Image URL of the icon: the community ic…), banner_url (Image URL of the banner on the communit…).
- Example request body:
{
  "platform": "reddit",
  "action": "subreddit_rules",
  "params": {
    "subreddit": "python"
  }
}
- Price: $0.79 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

#
NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesredditPlatform identifier, fixed value.
actionbodystringYessubreddit_rulesCapability identifier, fixed value.
subredditbody.paramsstringYes-The community whose rules you want: a name (python or r/python) or a community link. One community per call.

Code samples

#
bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "reddit",
  "action": "subreddit_rules",
  "params": {
    "subreddit": "python"
  }
}'

OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

#
No sample response is available for these parameters yet. This preview shows the response shape and fields from the API definition, with … as placeholders; it is not the result of a live call.
json
{  "id": "req_…",  "platform": "reddit",  "action": "subreddit_rules",  "results": {    "community": …,    "community_id": …,    "url": …,    "rules": …,    "menu_links": …,    "apps": …,    "icon_url": …,    "banner_url": …,    "platform": …  },  "billing": {    "charged": …,    "charged_usd": …,    "balance_after_usd": …,    …  },  "quota": { … }}

Response fields

#

Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.

FieldMeaning
communityKeeps the platform's own meaning
community_idReddit's ID for the community, starting with t5_ (subreddit_info, subreddit_rules, search_suggest, user_subreddits, explore, topic_subreddits).
urlLink to the record on the platform.
rulesThe community's rules (subreddit_rules): an array in which each item has name and description.
menu_linksThe links in the community's top menu (subreddit_rules): an array in which each item has text and url.
appsNames of the Reddit apps the community has installed (subreddit_rules): an array.
icon_urlImage URL of the icon: the community icon (subreddit_info, subreddit_rules, search_suggest, user_subreddits, explore, topic_subreddits) or the achievement icon (user_trophies).
banner_urlImage URL of the banner on the community page (subreddit_info, subreddit_rules) or on the user's profile (profile).
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).

Errors and billing

#
401
Missing or invalid key.
402
Insufficient balance. Top up first.
422
Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
429
Per-minute request limit reached. Wait for Retry-After, then try again.
503
Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
200 empty
No data. No charge.

Errors

Google Analytics needs consent. Privacy