scrapebadger 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3275,6 +3275,684 @@ var GoogleClient = class {
3275
3275
  }
3276
3276
  };
3277
3277
 
3278
+ // src/reddit/search.ts
3279
+ var SearchClient3 = class {
3280
+ client;
3281
+ constructor(client) {
3282
+ this.client = client;
3283
+ }
3284
+ /**
3285
+ * Search Reddit posts.
3286
+ *
3287
+ * @param options - Search parameters.
3288
+ * @param options.query - Search query string.
3289
+ * @param options.subreddit - Restrict search to a specific subreddit.
3290
+ * @param options.sort - Sort order (relevance, hot, top, new, comments).
3291
+ * @param options.time - Time filter (hour, day, week, month, year, all).
3292
+ * @param options.after - Pagination cursor for the next page.
3293
+ * @param options.limit - Number of results to return (max 100).
3294
+ * @returns Search results with posts and pagination metadata.
3295
+ * @throws AuthenticationError - If the API key is invalid.
3296
+ * @throws ValidationError - If the search parameters are invalid.
3297
+ *
3298
+ * @example
3299
+ * ```typescript
3300
+ * const results = await client.reddit.search.posts({
3301
+ * query: "best practices",
3302
+ * subreddit: "programming",
3303
+ * sort: "top",
3304
+ * time: "month",
3305
+ * limit: 25,
3306
+ * });
3307
+ * console.log(`Found ${results.posts.length} posts`);
3308
+ * ```
3309
+ */
3310
+ async posts(options) {
3311
+ return this.client.request("/v1/reddit/search/posts", {
3312
+ params: {
3313
+ query: options.query,
3314
+ subreddit: options.subreddit,
3315
+ sort: options.sort,
3316
+ time: options.time,
3317
+ after: options.after,
3318
+ limit: options.limit
3319
+ }
3320
+ });
3321
+ }
3322
+ /**
3323
+ * Search Reddit subreddits.
3324
+ *
3325
+ * @param options - Search parameters.
3326
+ * @param options.query - Search query string.
3327
+ * @param options.after - Pagination cursor for the next page.
3328
+ * @param options.limit - Number of results to return (max 100).
3329
+ * @returns Matching subreddits with pagination metadata.
3330
+ * @throws AuthenticationError - If the API key is invalid.
3331
+ * @throws ValidationError - If the search parameters are invalid.
3332
+ *
3333
+ * @example
3334
+ * ```typescript
3335
+ * const results = await client.reddit.search.subreddits({
3336
+ * query: "javascript",
3337
+ * limit: 10,
3338
+ * });
3339
+ * for (const sub of results.subreddits) {
3340
+ * console.log(`r/${sub.display_name}: ${sub.subscribers.toLocaleString()} subscribers`);
3341
+ * }
3342
+ * ```
3343
+ */
3344
+ async subreddits(options) {
3345
+ return this.client.request(
3346
+ "/v1/reddit/search/subreddits",
3347
+ {
3348
+ params: {
3349
+ query: options.query,
3350
+ after: options.after,
3351
+ limit: options.limit
3352
+ }
3353
+ }
3354
+ );
3355
+ }
3356
+ /**
3357
+ * Search Reddit users.
3358
+ *
3359
+ * @param options - Search parameters.
3360
+ * @param options.query - Search query string.
3361
+ * @param options.after - Pagination cursor for the next page.
3362
+ * @param options.limit - Number of results to return (max 100).
3363
+ * @returns Matching users with pagination metadata.
3364
+ * @throws AuthenticationError - If the API key is invalid.
3365
+ * @throws ValidationError - If the search parameters are invalid.
3366
+ *
3367
+ * @example
3368
+ * ```typescript
3369
+ * const results = await client.reddit.search.users({
3370
+ * query: "john",
3371
+ * limit: 20,
3372
+ * });
3373
+ * for (const user of results.users) {
3374
+ * console.log(`u/${user.name}: ${user.total_karma.toLocaleString()} karma`);
3375
+ * }
3376
+ * ```
3377
+ */
3378
+ async users(options) {
3379
+ return this.client.request(
3380
+ "/v1/reddit/search/users",
3381
+ {
3382
+ params: {
3383
+ query: options.query,
3384
+ after: options.after,
3385
+ limit: options.limit
3386
+ }
3387
+ }
3388
+ );
3389
+ }
3390
+ /**
3391
+ * Get Reddit posts linking to a specific domain.
3392
+ *
3393
+ * @param options - Request parameters.
3394
+ * @param options.domain - Domain name to search for (e.g. "github.com").
3395
+ * @param options.sort - Sort order (hot, new, top, rising).
3396
+ * @param options.time - Time filter for top sort (hour, day, week, month, year, all).
3397
+ * @param options.after - Pagination cursor for the next page.
3398
+ * @param options.limit - Number of results to return (max 100).
3399
+ * @returns Posts linking to the domain with pagination metadata.
3400
+ * @throws AuthenticationError - If the API key is invalid.
3401
+ * @throws ValidationError - If the parameters are invalid.
3402
+ *
3403
+ * @example
3404
+ * ```typescript
3405
+ * const results = await client.reddit.search.domainPosts({
3406
+ * domain: "github.com",
3407
+ * sort: "top",
3408
+ * time: "week",
3409
+ * limit: 25,
3410
+ * });
3411
+ * for (const post of results.posts) {
3412
+ * console.log(`r/${post.subreddit}: ${post.title}`);
3413
+ * }
3414
+ * ```
3415
+ */
3416
+ async domainPosts(options) {
3417
+ return this.client.request(
3418
+ "/v1/reddit/search/domain",
3419
+ {
3420
+ params: {
3421
+ domain: options.domain,
3422
+ sort: options.sort,
3423
+ time: options.time,
3424
+ after: options.after,
3425
+ limit: options.limit
3426
+ }
3427
+ }
3428
+ );
3429
+ }
3430
+ };
3431
+
3432
+ // src/reddit/posts.ts
3433
+ var PostsClient = class {
3434
+ client;
3435
+ constructor(client) {
3436
+ this.client = client;
3437
+ }
3438
+ /**
3439
+ * Get trending/hot posts from Reddit or a specific subreddit.
3440
+ *
3441
+ * @param options - Request parameters.
3442
+ * @param options.subreddit - Subreddit name (without r/). If omitted, returns site-wide posts.
3443
+ * @param options.sort - Sort order (hot, new, top, rising, controversial).
3444
+ * @param options.time - Time filter for top/controversial (hour, day, week, month, year, all).
3445
+ * @param options.after - Pagination cursor for the next page.
3446
+ * @param options.limit - Number of results to return (max 100).
3447
+ * @returns Trending posts with pagination metadata.
3448
+ * @throws AuthenticationError - If the API key is invalid.
3449
+ *
3450
+ * @example
3451
+ * ```typescript
3452
+ * const results = await client.reddit.posts.trending({
3453
+ * subreddit: "worldnews",
3454
+ * sort: "hot",
3455
+ * limit: 25,
3456
+ * });
3457
+ * for (const post of results.posts) {
3458
+ * console.log(`${post.title} (${post.num_comments} comments)`);
3459
+ * }
3460
+ * ```
3461
+ */
3462
+ async trending(options = {}) {
3463
+ return this.client.request("/v1/reddit/posts", {
3464
+ params: {
3465
+ subreddit: options.subreddit,
3466
+ sort: options.sort,
3467
+ time: options.time,
3468
+ after: options.after,
3469
+ limit: options.limit
3470
+ }
3471
+ });
3472
+ }
3473
+ /**
3474
+ * Get full details of a single Reddit post.
3475
+ *
3476
+ * @param postId - The Reddit post ID (e.g. "abc123" or "t3_abc123").
3477
+ * @param options - Optional parameters.
3478
+ * @param options.subreddit - Subreddit name (helps resolve the post URL).
3479
+ * @returns Full post details.
3480
+ * @throws NotFoundError - If the post doesn't exist.
3481
+ * @throws AuthenticationError - If the API key is invalid.
3482
+ *
3483
+ * @example
3484
+ * ```typescript
3485
+ * const response = await client.reddit.posts.get("abc123", { subreddit: "programming" });
3486
+ * const { post } = response;
3487
+ * console.log(`${post.title} by u/${post.author}`);
3488
+ * console.log(`Score: ${post.score}, Comments: ${post.num_comments}`);
3489
+ * ```
3490
+ */
3491
+ async get(postId, options = {}) {
3492
+ return this.client.request(
3493
+ `/v1/reddit/posts/${postId}`,
3494
+ { params: { subreddit: options.subreddit } }
3495
+ );
3496
+ }
3497
+ /**
3498
+ * Get comments for a Reddit post.
3499
+ *
3500
+ * @param postId - The Reddit post ID (e.g. "abc123" or "t3_abc123").
3501
+ * @param options - Optional parameters.
3502
+ * @param options.subreddit - Subreddit name (helps resolve the post URL).
3503
+ * @param options.sort - Comment sort order (confidence, top, new, controversial, old, qa).
3504
+ * @param options.depth - Maximum comment tree depth.
3505
+ * @param options.limit - Number of top-level comments to return.
3506
+ * @returns Post details and nested comment tree.
3507
+ * @throws NotFoundError - If the post doesn't exist.
3508
+ * @throws AuthenticationError - If the API key is invalid.
3509
+ *
3510
+ * @example
3511
+ * ```typescript
3512
+ * const response = await client.reddit.posts.comments("abc123", {
3513
+ * subreddit: "programming",
3514
+ * sort: "top",
3515
+ * limit: 50,
3516
+ * });
3517
+ * for (const comment of response.comments) {
3518
+ * console.log(`u/${comment.author}: ${comment.body.slice(0, 100)}`);
3519
+ * }
3520
+ * ```
3521
+ */
3522
+ async comments(postId, options = {}) {
3523
+ return this.client.request(
3524
+ `/v1/reddit/posts/${postId}/comments`,
3525
+ {
3526
+ params: {
3527
+ subreddit: options.subreddit,
3528
+ sort: options.sort,
3529
+ depth: options.depth,
3530
+ limit: options.limit
3531
+ }
3532
+ }
3533
+ );
3534
+ }
3535
+ /**
3536
+ * Get cross-posts and duplicate submissions of a Reddit post.
3537
+ *
3538
+ * @param postId - The Reddit post ID (e.g. "abc123" or "t3_abc123").
3539
+ * @param options - Optional parameters.
3540
+ * @param options.after - Pagination cursor for the next page.
3541
+ * @param options.limit - Number of results to return (max 100).
3542
+ * @returns The original post and its duplicate submissions.
3543
+ * @throws NotFoundError - If the post doesn't exist.
3544
+ * @throws AuthenticationError - If the API key is invalid.
3545
+ *
3546
+ * @example
3547
+ * ```typescript
3548
+ * const response = await client.reddit.posts.duplicates("abc123");
3549
+ * console.log(`Original: ${response.post.title}`);
3550
+ * console.log(`Cross-posted ${response.duplicates.length} times`);
3551
+ * for (const dupe of response.duplicates) {
3552
+ * console.log(` r/${dupe.subreddit}: ${dupe.score} points`);
3553
+ * }
3554
+ * ```
3555
+ */
3556
+ async duplicates(postId, options = {}) {
3557
+ return this.client.request(
3558
+ `/v1/reddit/posts/${postId}/duplicates`,
3559
+ {
3560
+ params: {
3561
+ after: options.after,
3562
+ limit: options.limit
3563
+ }
3564
+ }
3565
+ );
3566
+ }
3567
+ };
3568
+
3569
+ // src/reddit/subreddits.ts
3570
+ var SubredditsClient = class {
3571
+ client;
3572
+ constructor(client) {
3573
+ this.client = client;
3574
+ }
3575
+ /**
3576
+ * Get a subreddit's full details and metadata.
3577
+ *
3578
+ * @param subreddit - Subreddit name (without r/ prefix).
3579
+ * @returns Full subreddit details.
3580
+ * @throws NotFoundError - If the subreddit doesn't exist.
3581
+ * @throws AuthenticationError - If the API key is invalid.
3582
+ *
3583
+ * @example
3584
+ * ```typescript
3585
+ * const response = await client.reddit.subreddits.get("javascript");
3586
+ * const { subreddit } = response;
3587
+ * console.log(`${subreddit.title}: ${subreddit.subscribers.toLocaleString()} members`);
3588
+ * console.log(`Description: ${subreddit.public_description}`);
3589
+ * ```
3590
+ */
3591
+ async get(subreddit) {
3592
+ return this.client.request(
3593
+ `/v1/reddit/subreddits/${subreddit}`
3594
+ );
3595
+ }
3596
+ /**
3597
+ * Get posts from a subreddit.
3598
+ *
3599
+ * @param subreddit - Subreddit name (without r/ prefix).
3600
+ * @param options - Optional parameters.
3601
+ * @param options.sort - Sort order (hot, new, top, rising, controversial).
3602
+ * @param options.time - Time filter for top/controversial (hour, day, week, month, year, all).
3603
+ * @param options.after - Pagination cursor for the next page.
3604
+ * @param options.limit - Number of results to return (max 100).
3605
+ * @returns Subreddit posts with pagination metadata.
3606
+ * @throws NotFoundError - If the subreddit doesn't exist.
3607
+ * @throws AuthenticationError - If the API key is invalid.
3608
+ *
3609
+ * @example
3610
+ * ```typescript
3611
+ * const response = await client.reddit.subreddits.posts("typescript", {
3612
+ * sort: "top",
3613
+ * time: "week",
3614
+ * limit: 25,
3615
+ * });
3616
+ * for (const post of response.posts) {
3617
+ * console.log(`${post.title} — ${post.score} pts`);
3618
+ * }
3619
+ * ```
3620
+ */
3621
+ async posts(subreddit, options = {}) {
3622
+ return this.client.request(
3623
+ `/v1/reddit/subreddits/${subreddit}/posts`,
3624
+ {
3625
+ params: {
3626
+ sort: options.sort,
3627
+ time: options.time,
3628
+ after: options.after,
3629
+ limit: options.limit
3630
+ }
3631
+ }
3632
+ );
3633
+ }
3634
+ /**
3635
+ * Get the rules for a subreddit.
3636
+ *
3637
+ * @param subreddit - Subreddit name (without r/ prefix).
3638
+ * @returns List of subreddit rules.
3639
+ * @throws NotFoundError - If the subreddit doesn't exist.
3640
+ * @throws AuthenticationError - If the API key is invalid.
3641
+ *
3642
+ * @example
3643
+ * ```typescript
3644
+ * const response = await client.reddit.subreddits.rules("AskReddit");
3645
+ * for (const rule of response.rules) {
3646
+ * console.log(`${rule.priority}. ${rule.short_name}`);
3647
+ * console.log(` ${rule.description}`);
3648
+ * }
3649
+ * ```
3650
+ */
3651
+ async rules(subreddit) {
3652
+ return this.client.request(
3653
+ `/v1/reddit/subreddits/${subreddit}/rules`
3654
+ );
3655
+ }
3656
+ /**
3657
+ * Get the moderators of a subreddit.
3658
+ *
3659
+ * @param subreddit - Subreddit name (without r/ prefix).
3660
+ * @param options - Optional parameters.
3661
+ * @param options.after - Pagination cursor for the next page.
3662
+ * @param options.limit - Number of results to return.
3663
+ * @returns List of moderators with pagination metadata.
3664
+ * @throws NotFoundError - If the subreddit doesn't exist.
3665
+ * @throws AuthenticationError - If the API key is invalid.
3666
+ *
3667
+ * @example
3668
+ * ```typescript
3669
+ * const response = await client.reddit.subreddits.moderators("programming");
3670
+ * for (const mod of response.moderators) {
3671
+ * console.log(`u/${mod.name}: [${mod.mod_permissions.join(", ")}]`);
3672
+ * }
3673
+ * ```
3674
+ */
3675
+ async moderators(subreddit, options = {}) {
3676
+ return this.client.request(
3677
+ `/v1/reddit/subreddits/${subreddit}/moderators`,
3678
+ {
3679
+ params: {
3680
+ after: options.after,
3681
+ limit: options.limit
3682
+ }
3683
+ }
3684
+ );
3685
+ }
3686
+ /**
3687
+ * List all wiki pages in a subreddit.
3688
+ *
3689
+ * @param subreddit - Subreddit name (without r/ prefix).
3690
+ * @returns List of wiki page slugs.
3691
+ * @throws NotFoundError - If the subreddit doesn't exist.
3692
+ * @throws AuthenticationError - If the API key is invalid.
3693
+ *
3694
+ * @example
3695
+ * ```typescript
3696
+ * const response = await client.reddit.subreddits.wikiPages("rust");
3697
+ * for (const page of response.pages) {
3698
+ * console.log(`/r/rust/wiki/${page}`);
3699
+ * }
3700
+ * ```
3701
+ */
3702
+ async wikiPages(subreddit) {
3703
+ return this.client.request(
3704
+ `/v1/reddit/subreddits/${subreddit}/wiki`
3705
+ );
3706
+ }
3707
+ /**
3708
+ * Get the content of a specific wiki page in a subreddit.
3709
+ *
3710
+ * @param subreddit - Subreddit name (without r/ prefix).
3711
+ * @param page - Wiki page slug (e.g. "index", "faq").
3712
+ * @returns Wiki page content and metadata.
3713
+ * @throws NotFoundError - If the subreddit or wiki page doesn't exist.
3714
+ * @throws AuthenticationError - If the API key is invalid.
3715
+ *
3716
+ * @example
3717
+ * ```typescript
3718
+ * const response = await client.reddit.subreddits.wikiPage("learnprogramming", "faq");
3719
+ * console.log(`Last edited by: u/${response.page.revision_by}`);
3720
+ * console.log(response.page.content_md);
3721
+ * ```
3722
+ */
3723
+ async wikiPage(subreddit, page) {
3724
+ return this.client.request(
3725
+ `/v1/reddit/subreddits/${subreddit}/wiki/${page}`
3726
+ );
3727
+ }
3728
+ /**
3729
+ * Get the most popular subreddits on Reddit.
3730
+ *
3731
+ * @param options - Optional parameters.
3732
+ * @param options.after - Pagination cursor for the next page.
3733
+ * @param options.limit - Number of results to return (max 100).
3734
+ * @returns Popular subreddits with pagination metadata.
3735
+ * @throws AuthenticationError - If the API key is invalid.
3736
+ *
3737
+ * @example
3738
+ * ```typescript
3739
+ * const response = await client.reddit.subreddits.popular({ limit: 20 });
3740
+ * for (const sub of response.subreddits) {
3741
+ * console.log(`r/${sub.display_name}: ${sub.subscribers.toLocaleString()} subscribers`);
3742
+ * }
3743
+ * ```
3744
+ */
3745
+ async popular(options = {}) {
3746
+ return this.client.request(
3747
+ "/v1/reddit/subreddits/popular",
3748
+ {
3749
+ params: {
3750
+ after: options.after,
3751
+ limit: options.limit
3752
+ }
3753
+ }
3754
+ );
3755
+ }
3756
+ /**
3757
+ * Get newly created subreddits on Reddit.
3758
+ *
3759
+ * @param options - Optional parameters.
3760
+ * @param options.after - Pagination cursor for the next page.
3761
+ * @param options.limit - Number of results to return (max 100).
3762
+ * @returns New subreddits with pagination metadata.
3763
+ * @throws AuthenticationError - If the API key is invalid.
3764
+ *
3765
+ * @example
3766
+ * ```typescript
3767
+ * const response = await client.reddit.subreddits.newSubreddits({ limit: 20 });
3768
+ * for (const sub of response.subreddits) {
3769
+ * console.log(`r/${sub.display_name} (created: ${new Date(sub.created_utc * 1000).toLocaleDateString()})`);
3770
+ * }
3771
+ * ```
3772
+ */
3773
+ async newSubreddits(options = {}) {
3774
+ return this.client.request(
3775
+ "/v1/reddit/subreddits/new",
3776
+ {
3777
+ params: {
3778
+ after: options.after,
3779
+ limit: options.limit
3780
+ }
3781
+ }
3782
+ );
3783
+ }
3784
+ };
3785
+
3786
+ // src/reddit/users.ts
3787
+ var UsersClient3 = class {
3788
+ client;
3789
+ constructor(client) {
3790
+ this.client = client;
3791
+ }
3792
+ /**
3793
+ * Get a Reddit user's profile.
3794
+ *
3795
+ * @param username - The Reddit username (without u/ prefix).
3796
+ * @returns The user profile response.
3797
+ * @throws NotFoundError - If the user doesn't exist or is suspended.
3798
+ * @throws AuthenticationError - If the API key is invalid.
3799
+ *
3800
+ * @example
3801
+ * ```typescript
3802
+ * const response = await client.reddit.users.get("spez");
3803
+ * const { user } = response;
3804
+ * console.log(`u/${user.name}`);
3805
+ * console.log(`Karma: ${user.total_karma.toLocaleString()} (${user.link_karma} post, ${user.comment_karma} comment)`);
3806
+ * console.log(`Account age: ${new Date(user.created_utc * 1000).toLocaleDateString()}`);
3807
+ * ```
3808
+ */
3809
+ async get(username) {
3810
+ return this.client.request(
3811
+ `/v1/reddit/users/${username}`
3812
+ );
3813
+ }
3814
+ /**
3815
+ * Get posts submitted by a Reddit user.
3816
+ *
3817
+ * @param username - The Reddit username (without u/ prefix).
3818
+ * @param options - Optional parameters.
3819
+ * @param options.sort - Sort order (hot, new, top, controversial).
3820
+ * @param options.time - Time filter for top/controversial (hour, day, week, month, year, all).
3821
+ * @param options.after - Pagination cursor for the next page.
3822
+ * @param options.limit - Number of results to return (max 100).
3823
+ * @returns The user's posts with pagination metadata.
3824
+ * @throws NotFoundError - If the user doesn't exist.
3825
+ * @throws AuthenticationError - If the API key is invalid.
3826
+ *
3827
+ * @example
3828
+ * ```typescript
3829
+ * const response = await client.reddit.users.posts("spez", {
3830
+ * sort: "top",
3831
+ * time: "all",
3832
+ * limit: 25,
3833
+ * });
3834
+ * for (const post of response.posts) {
3835
+ * console.log(`r/${post.subreddit}: ${post.title} (${post.score} pts)`);
3836
+ * }
3837
+ * ```
3838
+ */
3839
+ async posts(username, options = {}) {
3840
+ return this.client.request(
3841
+ `/v1/reddit/users/${username}/posts`,
3842
+ {
3843
+ params: {
3844
+ sort: options.sort,
3845
+ time: options.time,
3846
+ after: options.after,
3847
+ limit: options.limit
3848
+ }
3849
+ }
3850
+ );
3851
+ }
3852
+ /**
3853
+ * Get comments made by a Reddit user.
3854
+ *
3855
+ * @param username - The Reddit username (without u/ prefix).
3856
+ * @param options - Optional parameters.
3857
+ * @param options.sort - Sort order (hot, new, top, controversial).
3858
+ * @param options.time - Time filter for top/controversial (hour, day, week, month, year, all).
3859
+ * @param options.after - Pagination cursor for the next page.
3860
+ * @param options.limit - Number of results to return (max 100).
3861
+ * @returns The user's comments with pagination metadata.
3862
+ * @throws NotFoundError - If the user doesn't exist.
3863
+ * @throws AuthenticationError - If the API key is invalid.
3864
+ *
3865
+ * @example
3866
+ * ```typescript
3867
+ * const response = await client.reddit.users.comments("spez", {
3868
+ * sort: "new",
3869
+ * limit: 50,
3870
+ * });
3871
+ * for (const comment of response.comments) {
3872
+ * console.log(`r/${comment.subreddit}: ${comment.body.slice(0, 80)}`);
3873
+ * }
3874
+ * ```
3875
+ */
3876
+ async comments(username, options = {}) {
3877
+ return this.client.request(
3878
+ `/v1/reddit/users/${username}/comments`,
3879
+ {
3880
+ params: {
3881
+ sort: options.sort,
3882
+ time: options.time,
3883
+ after: options.after,
3884
+ limit: options.limit
3885
+ }
3886
+ }
3887
+ );
3888
+ }
3889
+ /**
3890
+ * Get subreddits moderated by a Reddit user.
3891
+ *
3892
+ * @param username - The Reddit username (without u/ prefix).
3893
+ * @returns Subreddits moderated by the user.
3894
+ * @throws NotFoundError - If the user doesn't exist.
3895
+ * @throws AuthenticationError - If the API key is invalid.
3896
+ *
3897
+ * @example
3898
+ * ```typescript
3899
+ * const response = await client.reddit.users.moderated("spez");
3900
+ * for (const sub of response.subreddits) {
3901
+ * console.log(`r/${sub.display_name}: ${sub.subscribers.toLocaleString()} subscribers`);
3902
+ * }
3903
+ * ```
3904
+ */
3905
+ async moderated(username) {
3906
+ return this.client.request(
3907
+ `/v1/reddit/users/${username}/moderated`
3908
+ );
3909
+ }
3910
+ /**
3911
+ * Get trophies awarded to a Reddit user.
3912
+ *
3913
+ * @param username - The Reddit username (without u/ prefix).
3914
+ * @returns List of trophies awarded to the user.
3915
+ * @throws NotFoundError - If the user doesn't exist.
3916
+ * @throws AuthenticationError - If the API key is invalid.
3917
+ *
3918
+ * @example
3919
+ * ```typescript
3920
+ * const response = await client.reddit.users.trophies("spez");
3921
+ * for (const trophy of response.trophies) {
3922
+ * console.log(`${trophy.name}${trophy.description ? `: ${trophy.description}` : ""}`);
3923
+ * }
3924
+ * ```
3925
+ */
3926
+ async trophies(username) {
3927
+ return this.client.request(
3928
+ `/v1/reddit/users/${username}/trophies`
3929
+ );
3930
+ }
3931
+ };
3932
+
3933
+ // src/reddit/client.ts
3934
+ var RedditClient = class {
3935
+ /** Client for search operations (posts, subreddits, users, domain posts) */
3936
+ search;
3937
+ /** Client for post operations (trending, details, comments, duplicates) */
3938
+ posts;
3939
+ /** Client for subreddit operations (details, posts, rules, moderators, wiki) */
3940
+ subreddits;
3941
+ /** Client for user operations (profile, posts, comments, moderated, trophies) */
3942
+ users;
3943
+ /**
3944
+ * Create a new Reddit client.
3945
+ *
3946
+ * @param client - The base HTTP client for making requests.
3947
+ */
3948
+ constructor(client) {
3949
+ this.search = new SearchClient3(client);
3950
+ this.posts = new PostsClient(client);
3951
+ this.subreddits = new SubredditsClient(client);
3952
+ this.users = new UsersClient3(client);
3953
+ }
3954
+ };
3955
+
3278
3956
  // src/client.ts
3279
3957
  var ScrapeBadger = class {
3280
3958
  baseClient;
@@ -3286,6 +3964,8 @@ var ScrapeBadger = class {
3286
3964
  vinted;
3287
3965
  /** Google Scraper API client — 19 Google product APIs */
3288
3966
  google;
3967
+ /** Reddit scraper API client */
3968
+ reddit;
3289
3969
  /**
3290
3970
  * Create a new ScrapeBadger client.
3291
3971
  *
@@ -3324,6 +4004,7 @@ var ScrapeBadger = class {
3324
4004
  this.web = new WebClient(this.baseClient);
3325
4005
  this.vinted = new VintedClient(this.baseClient);
3326
4006
  this.google = new GoogleClient(this.baseClient);
4007
+ this.reddit = new RedditClient(this.baseClient);
3327
4008
  }
3328
4009
  };
3329
4010
 
@@ -3355,6 +4036,11 @@ exports.InsufficientCreditsError = InsufficientCreditsError;
3355
4036
  exports.ListsClient = ListsClient;
3356
4037
  exports.NotFoundError = NotFoundError;
3357
4038
  exports.RateLimitError = RateLimitError;
4039
+ exports.RedditClient = RedditClient;
4040
+ exports.RedditPostsClient = PostsClient;
4041
+ exports.RedditSearchClient = SearchClient3;
4042
+ exports.RedditSubredditsClient = SubredditsClient;
4043
+ exports.RedditUsersClient = UsersClient3;
3358
4044
  exports.ScrapeBadger = ScrapeBadger;
3359
4045
  exports.ScrapeBadgerError = ScrapeBadgerError;
3360
4046
  exports.ServerError = ServerError;