Reddit data-access disclosure
In the spirit of transparency, and in keeping with Reddit's Responsible Builder principles and Data API Terms, this page sets out exactly how layfeed accesses Reddit.
- Access
- Read-only. No posting, voting, messaging, or any write action.
- Scope
- Public posts and comments only — no private, quarantined, or user-account data.
- Auth
- OAuth2 client-credentials (a registered “script” app), using our own per-client quota.
- Identification
layfeed/0.1 (ethical news aggregator; +https://layfeed.app/reddit-disclosure)- Rate limits
- We honor the
X-Ratelimit-*headers and stay well under 100 requests/minute. - Link-back
- Every item keeps its canonical Reddit permalink; we send readers to the source thread.
- Model training
- No Reddit content is used to train machine-learning models.
- Purpose
- Non-commercial situational awareness and world-event tracking.
Subreddits we read
r/worldnewsr/newsr/geopoliticsr/inthenewsr/UpliftingNewsr/economics
The access pattern, in full
The production software is proprietary and privately licensed, but it does nothing with Reddit beyond what the Python below depicts — identification, read-only OAuth access, rate-limit discipline, and the exact fields we keep.
# layfeed — Reddit Data API consumer (representative disclosure)
#
# This is a faithful, complete depiction of HOW layfeed reads Reddit:
# authentication, identification, access pattern, rate-limit handling, and
# exactly which fields we keep. The production implementation is proprietary
# and privately licensed; nothing it does with Reddit goes beyond what is
# shown here.
# We identify ourselves honestly, in Reddit's recommended format, and point
# back to this very page so anyone can see what we do.
USER_AGENT = "layfeed/0.1 (ethical news aggregator; +https://layfeed.app/reddit-disclosure)"
# Read-only. Public posts and comments only. No posting, voting, messaging,
# or any write action. OAuth2 client-credentials ("script" app) — our own
# per-client quota, so we never lean on the shared anonymous pool.
OAUTH = "https://www.reddit.com/api/v1/access_token"
API = "https://oauth.reddit.com"
# The only subreddits we read — all public, general world-news communities.
SUBREDDITS = ["worldnews", "news", "geopolitics", "inthenews",
"UpliftingNews", "economics"]
def get_token(client_id, client_secret):
# grant_type=client_credentials — app-only, no user context, no user data.
body = {"grant_type": "client_credentials"}
headers = {"User-Agent": USER_AGENT}
resp = post(OAUTH, auth=(client_id, client_secret), data=body, headers=headers)
return resp.json()["access_token"]
def respect_rate_limit(headers):
# We obey Reddit's published budget. If the remaining allowance is low we
# wait out the reset window before the next request — well under 100 QPM.
remaining = float(headers.get("x-ratelimit-remaining", "1"))
reset = float(headers.get("x-ratelimit-reset", "0"))
if remaining < 2:
sleep(reset + 1)
def read_new(token, subreddit, limit=25):
headers = {"User-Agent": USER_AGENT, "Authorization": "bearer " + token}
resp = get(API + "/r/" + subreddit + "/new", headers=headers,
params={"limit": limit, "raw_json": 1})
respect_rate_limit(resp.headers)
records = []
for child in resp.json()["data"]["children"]:
p = child["data"]
records.append({
"source": "reddit/r/" + subreddit,
"title": p["title"],
# We always keep the canonical Reddit permalink and send readers
# straight back to the thread on reddit.com.
"link": "https://www.reddit.com" + p["permalink"],
"created": p["created_utc"],
})
return records
# What we DO NOT do, by policy:
# - no writes of any kind (read-only)
# - no private, quarantined, or user-account data; public listings only
# - no storage of Reddit user identities or personal data
# - no use of Reddit content to train machine-learning models
# - no redistribution of Reddit content; we link back to the source thread
Questions or concerns about our use of the Reddit Data API?
Write to hello@layfeed.app.