Datasets:
Request access to the OP-R1 Reddit corpus
This dataset contains pseudonymized but re-identifiable social-media content about substance use. Access is reviewed manually and granted only for public-health / harm-reduction research. Requests without a verifiable institutional affiliation and a specific research purpose will be declined.
DATA USE AGREEMENT — read in full before requesting access.
This corpus contains Reddit posts and comments about drug use, including opioids. Author usernames are replaced by salted HMAC pseudonyms, but the dataset retains original Reddit post/comment identifiers (id, link_id, parent_id). Those identifiers can be resolved on reddit.com to the original content and, where not deleted, to the author's real account. Treat every record as identifiable personal data concerning health and potentially criminal conduct.
By requesting access you represent that you have read this agreement and agree to be bound by it.
1. Permitted use. Aggregate public-health, harm-reduction, epidemiological, computational-social-science or NLP research, conducted under the oversight of an IRB / research ethics committee (or a documented determination that such oversight is not required in your jurisdiction).
2. Prohibited uses. You will NOT: (a) attempt to re-identify, deanonymize, unmask or determine the real-world identity of any individual, including by resolving retained Reddit identifiers, cross-referencing external data, or querying any API or web service with dataset content; (b) contact, message, survey, recruit, profile, monitor or surveil any individual represented in the data; (c) use the data for law-enforcement, prosecutorial, immigration, insurance, credit, employment or any other adverse determination about an individual; (d) use it for commercial purposes, advertising, or targeting; (e) use it to facilitate the acquisition or distribution of controlled substances; (f) publish, present or otherwise disclose any verbatim quotation, username, pseudonymous user_id, Reddit identifier, or any other detail that could reasonably permit identification of an individual.
3. No redistribution. You will not republish, mirror, share, sublicense, post to any public repository or model hub, or otherwise transfer the data or any substantial derivative of it, in whole or in part, to any third party. Access is personal to you. Collaborators must request access individually. Models trained on this data must not be released if they can reproduce identifying content.
4. Security. You will store the data on access-controlled systems, restrict access to named personnel covered by this agreement, and not upload it to third-party services (including commercial LLM APIs) that may retain, train on, or disclose it.
5. Underlying rights. Content remains the intellectual property of its original authors and is subject to the Reddit User Agreement. This dataset is a research derivative; nothing here grants you rights in the underlying content. You are responsible for your own compliance with Reddit's terms and with all applicable law, including GDPR, HIPAA and equivalents.
6. Deletion. You will delete all copies upon completion of the stated research, upon withdrawal of access, or on request of the maintainers.
7. Incident reporting. You will report any accidental disclosure, re-identification, breach, or loss of control of the data to the maintainer within 72 hours.
8. Publication. Report results in aggregate. Paraphrase rather than quote. Cite the dataset and the upstream arctic_shift project.
9. Termination. Access may be revoked at any time, with or without cause. Breach terminates your rights immediately and obliges you to delete all copies.
10. No warranty. Provided "as is", without warranty of any kind. The maintainers accept no liability arising from your use. The data is a non-representative convenience sample and must not be used for clinical, diagnostic, or individual decision-making purposes.
Log in or Sign Up to review the conditions and access this dataset content.
OP-Reddit-User — per-user interaction structure
1,132,208 users from 37 drug-related subreddits, 2016-01-01 → 2026-07-27. Each row is one user: their profile, an interaction summary, and the structure of every thread they participated in.
This dataset contains no post text. It stores ids only, and is designed to be joined against OP-R1/OP-Reddit-Post to materialize the text on demand. That keeps this dataset small enough to download whole while the 47M-row text corpus stays remote.
Access. Gated — requests are reviewed manually and granted only for public-health / harm-reduction research under ethics oversight. See the Data Use Agreement on the access request form. IRB-gated human-subjects material.
Why user-level
OP-R1 classifies a user's role in the
opioid ecosystem (buyer / seller / user) with a supporting rationale. The
unit of prediction is therefore a person, not a post — and the evidence is a
person's messages in context.
"How much for a G?" is meaningless alone and damning under a sourcing ad. So this dataset preserves who replied to whom, not just a flat list of a user's text.
Schema
| Column | Type | Meaning |
|---|---|---|
user_id |
string |
Salted-HMAC pseudonym. Joins to OP-Reddit-Post.user_id. |
n_items / n_posts / n_comments |
int64 |
Activity counts |
n_threads |
int64 |
Distinct threads participated in |
first_seen / last_seen |
timestamp[ms, UTC] |
First/last activity |
active_days |
int64 |
Distinct days with activity |
subreddits |
list<struct> |
{name, n, first, last} per community, desc by n |
interactions |
struct |
See below |
threads |
list<struct> |
The evidence — see below |
threads_truncated |
bool |
True if the 500-thread cap applied |
role |
string (null) |
Label slot — buyer / seller / user |
rationale |
string (null) |
Label slot — free-text justification |
interactions
| Field | Meaning |
|---|---|
threads_started |
User authored the thread's anchor submission |
replies_to_others |
Replies the user made to other people |
replies_to_self |
Self-replies — characteristic of bumping one's own ad |
replies_received |
Replies the user received — the strongest relational signal |
distinct_repliers |
How many distinct people replied to them |
distinct_users_replied_to |
How many distinct people they replied to |
threads[]
| Field | Meaning |
|---|---|
link_id |
Thread id (t3_…) |
subreddit |
Community |
user_started / anchor_by_user |
Did this user author the thread root? |
anchor_id |
Bare id of the root submission — join key for its text |
items[] |
This user's own contributions, chronological |
threads[].items[]
| Field | Meaning |
|---|---|
id |
The record's Reddit id — join key for its text |
kind |
post or comment |
created_utc |
timestamp[ms, UTC] |
score |
Score at archival (nullable) |
parent_id |
What it replied to (t3_… post / t1_… comment) |
parent_kind |
post / comment / null |
parent_by_user |
Was the parent authored by this same user? |
reply_ids[] |
Ids of items replying to this item (capped at 20) |
Materializing text
Ids join to OP-Reddit-Post, which ships lookup indexes so you can fetch just
what you need rather than the whole 47M-row corpus:
See Retrieval helper below — the module
ships inside this repo and is loaded with importlib.
Manually, the join keys are:
| From this dataset | Fetch from OP-Reddit-Post |
|---|---|
threads[].items[].id |
the user's own message text |
threads[].anchor_id |
the thread's opening post |
threads[].items[].parent_id |
what they were replying to |
threads[].items[].reply_ids[] |
what people replied back |
Retrieval helper (retrieve.py)
retrieve.py ships inside this dataset repo, so approved users get it with
the data — no separate install, and it is always versioned against the index
layout it was built for.
Note. The
datasetslibrary removed loading scripts (trust_remote_codeno longer exists as ofdatasetsv5), soload_datasetwill not import this file. Download and load it explicitly:
import importlib.util, sys
from huggingface_hub import hf_hub_download
path = hf_hub_download(
"OP-R1/OP-Reddit-Post", "retrieve.py", repo_type="dataset",
)
spec = importlib.util.spec_from_file_location("opr1_retrieve", path)
mod = importlib.util.module_from_spec(spec)
sys.modules["opr1_retrieve"] = mod # REQUIRED before exec_module (see below)
spec.loader.exec_module(mod)
r = mod.OpR1Retriever() # uses HF_TOKEN, or pass token=...
user = r.get_user("18a38e35a00f09e39207") # profile + threads + text
⚠️ sys.modules[...] = mod is not optional. retrieve.py uses
@dataclass(slots=True), whose class construction looks the module up in
sys.modules. Omitting that line fails with:
AttributeError: 'NoneType' object has no attribute '__dict__'
Requirements
pip install huggingface_hub fsspec pyarrow
CLI
The same file runs standalone:
python retrieve.py --user-id 18a38e35a00f09e39207 --out user.json
It reports bytes fetched and the number of HTTP range requests on stderr, so you can confirm it is doing ranged reads rather than pulling whole files.
What it does
- Looks the user up in
index/user_index.parquet→ file + contiguous row range - Reads only the row groups covering that range via HTTP range requests
- Resolves anchor posts, parents and replies through
index/id_index.parquet - Returns one nested structure with text filled in
Measured on a real user: 11.87 MB in 6 ranged reads (1.9 s) versus a 7.3 GB full download — about 615× less data.
Statistics
| Metric | Value |
|---|---|
| Users | 1,132,208 |
| Items covered | 39,762,155 |
| Threads started (total) | 3,025,121 |
| Coverage | 2016-01-01 → 2026-07-27 |
| Subreddits | 37 |
Activity is heavily skewed — plan splits and batching accordingly:
| Percentile | Items/user | Threads/user | Replies received |
|---|---|---|---|
| median | 8 | 5 | 8 |
| p90 | 65 | 40 | 65 |
| p99 | 453 | — | — |
| max | 41,571 | 26,108 | 28,577 |
59,681 users (5.3%) received zero replies — isolated posters, a useful negative class.
Inclusion rules and caps
--min-items 3: users with fewer than 3 records are excluded (1,063,112 dropped). The median user in the raw corpus has only 2 items, so this removes the long tail that carries no usable evidence.- Deleted / removed content is retained as thread structure.
[deleted]and[removed]authors get no user row (they cannot be labeled), but their items still appear as other users'parent_id,anchor_idandreply_ids— the edge survives even when the body does not. This matters: moderation removes sourcing language hardest, so discarding tombstones would thin thesellerclass specifically. - Caps (recorded, not silent):
reply_idscapped at 20 per item (101,693 lists affected); threads capped at 500 per user (4,321 users, flagged viathreads_truncated).
De-identification
user_id is HMAC-SHA256(secret_salt, username)[:20], using the same salt as
OP-Reddit-Post, so the two datasets join. The salt is never distributed.
⚠️ Reddit ids are retained in cleartext (id, link_id, parent_id,
anchor_id). They resolve on reddit.com to the original content and, where not
deleted, to the author's real account. No salt is required to do this. The
pseudonym prevents casual identification, not a determined linkage attack. Treat
every row as identifiable personal data concerning health and potentially
criminal conduct, and see the Data Use Agreement.
Limitations
- No labels yet.
roleandrationaleare null placeholders. - Survivorship bias, most consequential here: moderation removes exactly the
sourcing/transaction language distinguishing
buyerfromseller, so those signals are systematically under-represented. - Not a population sample — self-selected, skews young, Western, English.
- Text is not included; anything requiring it needs
OP-Reddit-Postaccess.
Provenance
Derived from arctic_shift
Reddit archives via the OP-R1 pipeline (src/data/build_user_threads.py). Reddit
content belongs to its original authors.
Maintainer: Tianyi (Billy) Ma · tma2@nd.edu · University of Notre Dame
- Downloads last month
- 7