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