getanyapi 0.1.0__py3-none-any.whl

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.
Files changed (68) hide show
  1. getanyapi/__init__.py +76 -0
  2. getanyapi/_account.py +132 -0
  3. getanyapi/_async_client.py +215 -0
  4. getanyapi/_client.py +274 -0
  5. getanyapi/_errors.py +115 -0
  6. getanyapi/_pagination.py +295 -0
  7. getanyapi/_transport.py +239 -0
  8. getanyapi/platforms/__init__.py +89 -0
  9. getanyapi/platforms/ahrefs.py +384 -0
  10. getanyapi/platforms/airbnb.py +120 -0
  11. getanyapi/platforms/alibaba.py +95 -0
  12. getanyapi/platforms/amazon.py +442 -0
  13. getanyapi/platforms/appstore.py +95 -0
  14. getanyapi/platforms/bluesky.py +215 -0
  15. getanyapi/platforms/booking.py +128 -0
  16. getanyapi/platforms/coinmarketcap.py +113 -0
  17. getanyapi/platforms/congress.py +106 -0
  18. getanyapi/platforms/dexscreener.py +104 -0
  19. getanyapi/platforms/ebay.py +215 -0
  20. getanyapi/platforms/email.py +166 -0
  21. getanyapi/platforms/facebook.py +2324 -0
  22. getanyapi/platforms/fiverr.py +122 -0
  23. getanyapi/platforms/github.py +954 -0
  24. getanyapi/platforms/glassdoor.py +93 -0
  25. getanyapi/platforms/google.py +232 -0
  26. getanyapi/platforms/google_ads.py +380 -0
  27. getanyapi/platforms/google_finance.py +170 -0
  28. getanyapi/platforms/google_shopping.py +103 -0
  29. getanyapi/platforms/hackernews.py +276 -0
  30. getanyapi/platforms/indeed.py +114 -0
  31. getanyapi/platforms/instagram.py +1868 -0
  32. getanyapi/platforms/linkedin.py +1064 -0
  33. getanyapi/platforms/maps.py +412 -0
  34. getanyapi/platforms/pandaexpress.py +262 -0
  35. getanyapi/platforms/person.py +96 -0
  36. getanyapi/platforms/pinterest.py +96 -0
  37. getanyapi/platforms/playstore.py +99 -0
  38. getanyapi/platforms/polymarket.py +109 -0
  39. getanyapi/platforms/realtor.py +104 -0
  40. getanyapi/platforms/reddit.py +582 -0
  41. getanyapi/platforms/redfin.py +95 -0
  42. getanyapi/platforms/rednote.py +807 -0
  43. getanyapi/platforms/sec.py +118 -0
  44. getanyapi/platforms/semrush.py +358 -0
  45. getanyapi/platforms/snapchat.py +146 -0
  46. getanyapi/platforms/social.py +105 -0
  47. getanyapi/platforms/spotify.py +588 -0
  48. getanyapi/platforms/substack.py +142 -0
  49. getanyapi/platforms/threads.py +358 -0
  50. getanyapi/platforms/tiktok.py +1827 -0
  51. getanyapi/platforms/tiktok_shop.py +536 -0
  52. getanyapi/platforms/tripadvisor.py +180 -0
  53. getanyapi/platforms/trustpilot.py +114 -0
  54. getanyapi/platforms/truthsocial.py +226 -0
  55. getanyapi/platforms/twitter.py +798 -0
  56. getanyapi/platforms/upwork.py +119 -0
  57. getanyapi/platforms/walmart.py +93 -0
  58. getanyapi/platforms/web.py +264 -0
  59. getanyapi/platforms/whatsapp.py +91 -0
  60. getanyapi/platforms/yahoo_finance.py +95 -0
  61. getanyapi/platforms/yelp.py +141 -0
  62. getanyapi/platforms/youtube.py +1452 -0
  63. getanyapi/platforms/zillow.py +218 -0
  64. getanyapi/py.typed +0 -0
  65. getanyapi/types.py +170 -0
  66. getanyapi-0.1.0.dist-info/METADATA +155 -0
  67. getanyapi-0.1.0.dist-info/RECORD +68 -0
  68. getanyapi-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,807 @@
1
+ # Generated - do not edit. Regenerate with: pnpm generate
2
+ """Generated namespace module for the rednote platform."""
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Literal, TYPE_CHECKING
7
+
8
+ from pydantic import BaseModel, ConfigDict, Field
9
+ from typing_extensions import NotRequired, Required, TypedDict, Unpack
10
+
11
+ from ..types import RequestOptions, RunResult
12
+ from .._pagination import (
13
+ AsyncPaginator,
14
+ Paginator,
15
+ apaginate,
16
+ paginate,
17
+ )
18
+
19
+ if TYPE_CHECKING:
20
+ from .._async_client import AsyncAnyAPI
21
+ from .._client import AnyAPI
22
+
23
+
24
+ class RednoteNoteInput(TypedDict, total=False):
25
+ """Input for RedNote (Xiaohongshu) Note."""
26
+
27
+ noteId: Required[str]
28
+ """RedNote (Xiaohongshu) note ID."""
29
+
30
+
31
+ class RednoteNoteCommentsInput(TypedDict, total=False):
32
+ """Input for RedNote (Xiaohongshu) Note Comments."""
33
+
34
+ cursor: NotRequired[str]
35
+ """Pagination cursor from the previous response."""
36
+ noteId: Required[str]
37
+ """RedNote (Xiaohongshu) note ID."""
38
+
39
+
40
+ class RednoteProfileInput(TypedDict, total=False):
41
+ """Input for RedNote (Xiaohongshu) Profile."""
42
+
43
+ userId: Required[str]
44
+ """RedNote (Xiaohongshu) user ID."""
45
+
46
+
47
+ class RednoteSearchInput(TypedDict, total=False):
48
+ """Input for RedNote (Xiaohongshu) Search."""
49
+
50
+ cursor: NotRequired[str]
51
+ """Pagination cursor from the previous response."""
52
+ query: Required[str]
53
+ """Keyword to search for on RedNote (Xiaohongshu)."""
54
+ sort: NotRequired[Literal["general", "hot", "time"]]
55
+ """Sort order for matching notes. Default: general."""
56
+
57
+
58
+ class RednoteSearchUsersInput(TypedDict, total=False):
59
+ """Input for RedNote (Xiaohongshu) User Search."""
60
+
61
+ cursor: NotRequired[str]
62
+ """Pagination cursor from the previous response."""
63
+ query: Required[str]
64
+ """Keyword to search for on RedNote (Xiaohongshu)."""
65
+
66
+
67
+ class RednoteUserNotesInput(TypedDict, total=False):
68
+ """Input for RedNote (Xiaohongshu) User Notes."""
69
+
70
+ cursor: NotRequired[str]
71
+ """Pagination cursor from the previous response."""
72
+ userId: Required[str]
73
+ """RedNote (Xiaohongshu) user ID."""
74
+
75
+
76
+ class RednoteNoteData(BaseModel):
77
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
78
+
79
+ author_image: str | None = Field(
80
+ default=None,
81
+ alias="authorImage",
82
+ description="Present whenever the upstream returns this record.",
83
+ )
84
+ author_nickname: str | None = Field(
85
+ default=None,
86
+ alias="authorNickname",
87
+ description="Present whenever the upstream returns this record.",
88
+ )
89
+ author_red_id: str | None = Field(
90
+ default=None,
91
+ alias="authorRedId",
92
+ description="Present whenever the upstream returns this record.",
93
+ )
94
+ author_user_id: str | None = Field(
95
+ default=None,
96
+ alias="authorUserId",
97
+ description="Present whenever the upstream returns this record.",
98
+ )
99
+ collect_count: int | None = Field(default=None, alias="collectCount")
100
+ comment_count: int | None = Field(default=None, alias="commentCount")
101
+ created_at: int | None = Field(
102
+ default=None,
103
+ alias="createdAt",
104
+ description="Present whenever the upstream returns this record.",
105
+ )
106
+ description: str | None = Field(
107
+ default=None, description="Present whenever the upstream returns this record."
108
+ )
109
+ image: str | None = Field(
110
+ default=None, description="Present whenever the upstream returns this record."
111
+ )
112
+ language: str | None = Field(
113
+ default=None, description="Present whenever the upstream returns this record."
114
+ )
115
+ like_count: int | None = Field(default=None, alias="likeCount")
116
+ note_id: str = Field(alias="noteId")
117
+ share_count: int | None = Field(default=None, alias="shareCount")
118
+ title: str | None = Field(
119
+ default=None, description="Present whenever the upstream returns this record."
120
+ )
121
+ type_: str | None = Field(
122
+ default=None,
123
+ alias="type",
124
+ description="Present whenever the upstream returns this record.",
125
+ )
126
+ updated_at: int | None = Field(
127
+ default=None,
128
+ alias="updatedAt",
129
+ description="Present whenever the upstream returns this record.",
130
+ )
131
+ url: str | None = Field(
132
+ default=None, description="Present whenever the upstream returns this record."
133
+ )
134
+
135
+
136
+ class RednoteNoteCommentsData(BaseModel):
137
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
138
+
139
+ comments: list[RednoteNoteCommentsComment]
140
+ next_cursor: str = Field(alias="nextCursor")
141
+
142
+
143
+ class RednoteNoteCommentsComment(BaseModel):
144
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
145
+
146
+ comment_id: str = Field(alias="commentId")
147
+ created_at: int | None = Field(
148
+ default=None,
149
+ alias="createdAt",
150
+ description="Present whenever the upstream returns this record.",
151
+ )
152
+ image: str | None = Field(
153
+ default=None, description="Present whenever the upstream returns this record."
154
+ )
155
+ ip_location: str | None = Field(
156
+ default=None,
157
+ alias="ipLocation",
158
+ description="Present whenever the upstream returns this record.",
159
+ )
160
+ like_count: int | None = Field(default=None, alias="likeCount")
161
+ nickname: str | None = Field(
162
+ default=None, description="Present whenever the upstream returns this record."
163
+ )
164
+ note_id: str | None = Field(
165
+ default=None,
166
+ alias="noteId",
167
+ description="Present whenever the upstream returns this record.",
168
+ )
169
+ red_id: str | None = Field(
170
+ default=None,
171
+ alias="redId",
172
+ description="Present whenever the upstream returns this record.",
173
+ )
174
+ reply_count: int | None = Field(default=None, alias="replyCount")
175
+ text: str | None = Field(
176
+ default=None, description="Present whenever the upstream returns this record."
177
+ )
178
+ user_id: str | None = Field(
179
+ default=None,
180
+ alias="userId",
181
+ description="Present whenever the upstream returns this record.",
182
+ )
183
+
184
+
185
+ class RednoteProfileData(BaseModel):
186
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
187
+
188
+ collected_count: int | None = Field(default=None, alias="collectedCount")
189
+ description: str | None = Field(
190
+ default=None, description="Present whenever the upstream returns this record."
191
+ )
192
+ followers: int | None = None
193
+ following: int | None = None
194
+ gender: int | None = None
195
+ image: str | None = Field(
196
+ default=None, description="Present whenever the upstream returns this record."
197
+ )
198
+ liked_count: int | None = Field(default=None, alias="likedCount")
199
+ location: str | None = Field(
200
+ default=None, description="Present whenever the upstream returns this record."
201
+ )
202
+ nickname: str | None = Field(
203
+ default=None, description="Present whenever the upstream returns this record."
204
+ )
205
+ posted_notes: int | None = Field(default=None, alias="postedNotes")
206
+ red_id: str | None = Field(
207
+ default=None,
208
+ alias="redId",
209
+ description="Present whenever the upstream returns this record.",
210
+ )
211
+ share_url: str | None = Field(
212
+ default=None,
213
+ alias="shareUrl",
214
+ description="Present whenever the upstream returns this record.",
215
+ )
216
+ user_id: str = Field(alias="userId")
217
+ verified: bool | None = None
218
+ verify_type: int | None = Field(default=None, alias="verifyType")
219
+
220
+
221
+ class RednoteSearchData(BaseModel):
222
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
223
+
224
+ next_cursor: str = Field(alias="nextCursor")
225
+ notes: list[RednoteSearchNote]
226
+
227
+
228
+ class RednoteSearchNote(BaseModel):
229
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
230
+
231
+ author_image: str | None = Field(
232
+ default=None,
233
+ alias="authorImage",
234
+ description="Present whenever the upstream returns this record.",
235
+ )
236
+ author_nickname: str | None = Field(
237
+ default=None,
238
+ alias="authorNickname",
239
+ description="Present whenever the upstream returns this record.",
240
+ )
241
+ author_red_id: str | None = Field(
242
+ default=None,
243
+ alias="authorRedId",
244
+ description="Present whenever the upstream returns this record.",
245
+ )
246
+ author_user_id: str | None = Field(
247
+ default=None,
248
+ alias="authorUserId",
249
+ description="Present whenever the upstream returns this record.",
250
+ )
251
+ collect_count: int | None = Field(default=None, alias="collectCount")
252
+ comment_count: int | None = Field(default=None, alias="commentCount")
253
+ created_at: int | None = Field(default=None, alias="createdAt")
254
+ description: str | None = Field(
255
+ default=None, description="Present whenever the upstream returns this record."
256
+ )
257
+ image: str | None = Field(
258
+ default=None, description="Present whenever the upstream returns this record."
259
+ )
260
+ like_count: int | None = Field(default=None, alias="likeCount")
261
+ note_id: str = Field(alias="noteId")
262
+ share_count: int | None = Field(default=None, alias="shareCount")
263
+ title: str | None = Field(
264
+ default=None, description="Present whenever the upstream returns this record."
265
+ )
266
+ type_: str | None = Field(
267
+ default=None,
268
+ alias="type",
269
+ description="Present whenever the upstream returns this record.",
270
+ )
271
+ xsec_token: str | None = Field(
272
+ default=None,
273
+ alias="xsecToken",
274
+ description="Present whenever the upstream returns this record.",
275
+ )
276
+
277
+
278
+ class RednoteSearchUsersData(BaseModel):
279
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
280
+
281
+ next_cursor: str = Field(alias="nextCursor")
282
+ users: list[RednoteSearchUsersUser]
283
+
284
+
285
+ class RednoteSearchUsersUser(BaseModel):
286
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
287
+
288
+ description: str | None = Field(
289
+ default=None, description="Present whenever the upstream returns this record."
290
+ )
291
+ image: str | None = Field(
292
+ default=None, description="Present whenever the upstream returns this record."
293
+ )
294
+ link: str | None = Field(
295
+ default=None, description="Present whenever the upstream returns this record."
296
+ )
297
+ name: str | None = Field(
298
+ default=None, description="Present whenever the upstream returns this record."
299
+ )
300
+ red_id: str | None = Field(
301
+ default=None,
302
+ alias="redId",
303
+ description="Present whenever the upstream returns this record.",
304
+ )
305
+ subtitle: str | None = Field(
306
+ default=None, description="Present whenever the upstream returns this record."
307
+ )
308
+ user_id: str = Field(alias="userId")
309
+ verified: bool | None = None
310
+ verify_type: int | None = Field(default=None, alias="verifyType")
311
+
312
+
313
+ class RednoteUserNotesData(BaseModel):
314
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
315
+
316
+ next_cursor: str = Field(alias="nextCursor")
317
+ notes: list[RednoteUserNotesNote]
318
+
319
+
320
+ class RednoteUserNotesNote(BaseModel):
321
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
322
+
323
+ author_image: str | None = Field(
324
+ default=None,
325
+ alias="authorImage",
326
+ description="Present whenever the upstream returns this record.",
327
+ )
328
+ author_nickname: str | None = Field(
329
+ default=None,
330
+ alias="authorNickname",
331
+ description="Present whenever the upstream returns this record.",
332
+ )
333
+ author_user_id: str | None = Field(
334
+ default=None,
335
+ alias="authorUserId",
336
+ description="Present whenever the upstream returns this record.",
337
+ )
338
+ collect_count: int | None = Field(default=None, alias="collectCount")
339
+ comment_count: int | None = Field(default=None, alias="commentCount")
340
+ created_at: int | None = Field(default=None, alias="createdAt")
341
+ description: str | None = Field(
342
+ default=None, description="Present whenever the upstream returns this record."
343
+ )
344
+ image: str | None = Field(
345
+ default=None, description="Present whenever the upstream returns this record."
346
+ )
347
+ like_count: int | None = Field(default=None, alias="likeCount")
348
+ note_id: str = Field(alias="noteId")
349
+ share_count: int | None = Field(default=None, alias="shareCount")
350
+ title: str | None = Field(
351
+ default=None, description="Present whenever the upstream returns this record."
352
+ )
353
+ type_: str | None = Field(
354
+ default=None,
355
+ alias="type",
356
+ description="Present whenever the upstream returns this record.",
357
+ )
358
+
359
+
360
+ class RednoteNamespace:
361
+ """Typed methods for this platform. Attached lazily to the client."""
362
+
363
+ def __init__(self, client: "AnyAPI") -> None:
364
+ self._client = client
365
+
366
+ def note(
367
+ self,
368
+ *,
369
+ options: RequestOptions | None = None,
370
+ **input: Unpack[RednoteNoteInput],
371
+ ) -> RunResult[RednoteNoteData]:
372
+ """RedNote (Xiaohongshu) Note
373
+
374
+ Look up a RedNote (Xiaohongshu) note by note ID and return normalized note
375
+ details.
376
+
377
+ Price: $0.01 per request.
378
+
379
+ Example:
380
+ res = client.rednote.note(noteId="66f2a24f000000002c02cf57")
381
+ """
382
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
383
+ "rednote.note", dict(input), options
384
+ )
385
+ return RunResult[RednoteNoteData].model_validate(raw)
386
+
387
+ def note_comments(
388
+ self,
389
+ *,
390
+ options: RequestOptions | None = None,
391
+ **input: Unpack[RednoteNoteCommentsInput],
392
+ ) -> RunResult[RednoteNoteCommentsData]:
393
+ """RedNote (Xiaohongshu) Note Comments
394
+
395
+ List comments on a RedNote (Xiaohongshu) note and return normalized comment
396
+ records with pagination.
397
+
398
+ Price: $0.01 per request.
399
+
400
+ Example:
401
+ res = client.rednote.note_comments(noteId="68dd422c0000000203019829")
402
+ """
403
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
404
+ "rednote.note_comments", dict(input), options
405
+ )
406
+ return RunResult[RednoteNoteCommentsData].model_validate(raw)
407
+
408
+ def iter_note_comments(
409
+ self,
410
+ *,
411
+ options: RequestOptions | None = None,
412
+ **input: Unpack[RednoteNoteCommentsInput],
413
+ ) -> Paginator[RednoteNoteCommentsComment, RednoteNoteCommentsData]:
414
+ """Iterate RedNote (Xiaohongshu) Note Comments results, following pagination cursors.
415
+
416
+ Yields validated `RednoteNoteCommentsComment` items from the `comments` field of
417
+ each page. Use `.pages()` on the returned paginator to walk whole
418
+ `RunResult` pages.
419
+ """
420
+ return paginate(
421
+ self._client,
422
+ "rednote.note_comments",
423
+ dict(input),
424
+ "comments",
425
+ item_model=RednoteNoteCommentsComment,
426
+ data_model=RednoteNoteCommentsData,
427
+ bare=False,
428
+ options=options,
429
+ )
430
+
431
+ def profile(
432
+ self,
433
+ *,
434
+ options: RequestOptions | None = None,
435
+ **input: Unpack[RednoteProfileInput],
436
+ ) -> RunResult[RednoteProfileData]:
437
+ """RedNote (Xiaohongshu) Profile
438
+
439
+ Look up a RedNote (Xiaohongshu) profile by user ID and return normalized
440
+ profile details.
441
+
442
+ Price: $0.01 per request.
443
+
444
+ Example:
445
+ res = client.rednote.profile(userId="56b0a4491c07df6365277af7")
446
+ """
447
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
448
+ "rednote.profile", dict(input), options
449
+ )
450
+ return RunResult[RednoteProfileData].model_validate(raw)
451
+
452
+ def search(
453
+ self,
454
+ *,
455
+ options: RequestOptions | None = None,
456
+ **input: Unpack[RednoteSearchInput],
457
+ ) -> RunResult[RednoteSearchData]:
458
+ """RedNote (Xiaohongshu) Search
459
+
460
+ Search RedNote (Xiaohongshu) notes by keyword and return normalized note
461
+ records with pagination.
462
+
463
+ Price: $0.01 per request.
464
+
465
+ Example:
466
+ res = client.rednote.search(query="coffee", sort="general")
467
+ """
468
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
469
+ "rednote.search", dict(input), options
470
+ )
471
+ return RunResult[RednoteSearchData].model_validate(raw)
472
+
473
+ def iter_search(
474
+ self,
475
+ *,
476
+ options: RequestOptions | None = None,
477
+ **input: Unpack[RednoteSearchInput],
478
+ ) -> Paginator[RednoteSearchNote, RednoteSearchData]:
479
+ """Iterate RedNote (Xiaohongshu) Search results, following pagination cursors.
480
+
481
+ Yields validated `RednoteSearchNote` items from the `notes` field of
482
+ each page. Use `.pages()` on the returned paginator to walk whole
483
+ `RunResult` pages.
484
+ """
485
+ return paginate(
486
+ self._client,
487
+ "rednote.search",
488
+ dict(input),
489
+ "notes",
490
+ item_model=RednoteSearchNote,
491
+ data_model=RednoteSearchData,
492
+ bare=False,
493
+ options=options,
494
+ )
495
+
496
+ def search_users(
497
+ self,
498
+ *,
499
+ options: RequestOptions | None = None,
500
+ **input: Unpack[RednoteSearchUsersInput],
501
+ ) -> RunResult[RednoteSearchUsersData]:
502
+ """RedNote (Xiaohongshu) User Search
503
+
504
+ Search RedNote (Xiaohongshu) users by keyword and return normalized user
505
+ records with pagination.
506
+
507
+ Price: $0.01 per request.
508
+
509
+ Example:
510
+ res = client.rednote.search_users(query="coffee")
511
+ """
512
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
513
+ "rednote.search_users", dict(input), options
514
+ )
515
+ return RunResult[RednoteSearchUsersData].model_validate(raw)
516
+
517
+ def iter_search_users(
518
+ self,
519
+ *,
520
+ options: RequestOptions | None = None,
521
+ **input: Unpack[RednoteSearchUsersInput],
522
+ ) -> Paginator[RednoteSearchUsersUser, RednoteSearchUsersData]:
523
+ """Iterate RedNote (Xiaohongshu) User Search results, following pagination cursors.
524
+
525
+ Yields validated `RednoteSearchUsersUser` items from the `users` field of
526
+ each page. Use `.pages()` on the returned paginator to walk whole
527
+ `RunResult` pages.
528
+ """
529
+ return paginate(
530
+ self._client,
531
+ "rednote.search_users",
532
+ dict(input),
533
+ "users",
534
+ item_model=RednoteSearchUsersUser,
535
+ data_model=RednoteSearchUsersData,
536
+ bare=False,
537
+ options=options,
538
+ )
539
+
540
+ def user_notes(
541
+ self,
542
+ *,
543
+ options: RequestOptions | None = None,
544
+ **input: Unpack[RednoteUserNotesInput],
545
+ ) -> RunResult[RednoteUserNotesData]:
546
+ """RedNote (Xiaohongshu) User Notes
547
+
548
+ List notes posted by a RedNote (Xiaohongshu) user and return normalized note
549
+ records with pagination.
550
+
551
+ Price: $0.01 per request.
552
+
553
+ Example:
554
+ res = client.rednote.user_notes(userId="56b0a4491c07df6365277af7")
555
+ """
556
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
557
+ "rednote.user_notes", dict(input), options
558
+ )
559
+ return RunResult[RednoteUserNotesData].model_validate(raw)
560
+
561
+ def iter_user_notes(
562
+ self,
563
+ *,
564
+ options: RequestOptions | None = None,
565
+ **input: Unpack[RednoteUserNotesInput],
566
+ ) -> Paginator[RednoteUserNotesNote, RednoteUserNotesData]:
567
+ """Iterate RedNote (Xiaohongshu) User Notes results, following pagination cursors.
568
+
569
+ Yields validated `RednoteUserNotesNote` items from the `notes` field of
570
+ each page. Use `.pages()` on the returned paginator to walk whole
571
+ `RunResult` pages.
572
+ """
573
+ return paginate(
574
+ self._client,
575
+ "rednote.user_notes",
576
+ dict(input),
577
+ "notes",
578
+ item_model=RednoteUserNotesNote,
579
+ data_model=RednoteUserNotesData,
580
+ bare=False,
581
+ options=options,
582
+ )
583
+
584
+
585
+ class AsyncRednoteNamespace:
586
+ """Typed methods for this platform. Attached lazily to the client."""
587
+
588
+ def __init__(self, client: "AsyncAnyAPI") -> None:
589
+ self._client = client
590
+
591
+ async def note(
592
+ self,
593
+ *,
594
+ options: RequestOptions | None = None,
595
+ **input: Unpack[RednoteNoteInput],
596
+ ) -> RunResult[RednoteNoteData]:
597
+ """RedNote (Xiaohongshu) Note
598
+
599
+ Look up a RedNote (Xiaohongshu) note by note ID and return normalized note
600
+ details.
601
+
602
+ Price: $0.01 per request.
603
+
604
+ Example:
605
+ res = client.rednote.note(noteId="66f2a24f000000002c02cf57")
606
+ """
607
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
608
+ "rednote.note", dict(input), options
609
+ )
610
+ return RunResult[RednoteNoteData].model_validate(raw)
611
+
612
+ async def note_comments(
613
+ self,
614
+ *,
615
+ options: RequestOptions | None = None,
616
+ **input: Unpack[RednoteNoteCommentsInput],
617
+ ) -> RunResult[RednoteNoteCommentsData]:
618
+ """RedNote (Xiaohongshu) Note Comments
619
+
620
+ List comments on a RedNote (Xiaohongshu) note and return normalized comment
621
+ records with pagination.
622
+
623
+ Price: $0.01 per request.
624
+
625
+ Example:
626
+ res = client.rednote.note_comments(noteId="68dd422c0000000203019829")
627
+ """
628
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
629
+ "rednote.note_comments", dict(input), options
630
+ )
631
+ return RunResult[RednoteNoteCommentsData].model_validate(raw)
632
+
633
+ def iter_note_comments(
634
+ self,
635
+ *,
636
+ options: RequestOptions | None = None,
637
+ **input: Unpack[RednoteNoteCommentsInput],
638
+ ) -> AsyncPaginator[RednoteNoteCommentsComment, RednoteNoteCommentsData]:
639
+ """Iterate RedNote (Xiaohongshu) Note Comments results, following pagination cursors.
640
+
641
+ Yields validated `RednoteNoteCommentsComment` items from the `comments` field of
642
+ each page. Use `.pages()` on the returned paginator to walk whole
643
+ `RunResult` pages.
644
+ """
645
+ return apaginate(
646
+ self._client,
647
+ "rednote.note_comments",
648
+ dict(input),
649
+ "comments",
650
+ item_model=RednoteNoteCommentsComment,
651
+ data_model=RednoteNoteCommentsData,
652
+ bare=False,
653
+ options=options,
654
+ )
655
+
656
+ async def profile(
657
+ self,
658
+ *,
659
+ options: RequestOptions | None = None,
660
+ **input: Unpack[RednoteProfileInput],
661
+ ) -> RunResult[RednoteProfileData]:
662
+ """RedNote (Xiaohongshu) Profile
663
+
664
+ Look up a RedNote (Xiaohongshu) profile by user ID and return normalized
665
+ profile details.
666
+
667
+ Price: $0.01 per request.
668
+
669
+ Example:
670
+ res = client.rednote.profile(userId="56b0a4491c07df6365277af7")
671
+ """
672
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
673
+ "rednote.profile", dict(input), options
674
+ )
675
+ return RunResult[RednoteProfileData].model_validate(raw)
676
+
677
+ async def search(
678
+ self,
679
+ *,
680
+ options: RequestOptions | None = None,
681
+ **input: Unpack[RednoteSearchInput],
682
+ ) -> RunResult[RednoteSearchData]:
683
+ """RedNote (Xiaohongshu) Search
684
+
685
+ Search RedNote (Xiaohongshu) notes by keyword and return normalized note
686
+ records with pagination.
687
+
688
+ Price: $0.01 per request.
689
+
690
+ Example:
691
+ res = client.rednote.search(query="coffee", sort="general")
692
+ """
693
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
694
+ "rednote.search", dict(input), options
695
+ )
696
+ return RunResult[RednoteSearchData].model_validate(raw)
697
+
698
+ def iter_search(
699
+ self,
700
+ *,
701
+ options: RequestOptions | None = None,
702
+ **input: Unpack[RednoteSearchInput],
703
+ ) -> AsyncPaginator[RednoteSearchNote, RednoteSearchData]:
704
+ """Iterate RedNote (Xiaohongshu) Search results, following pagination cursors.
705
+
706
+ Yields validated `RednoteSearchNote` items from the `notes` field of
707
+ each page. Use `.pages()` on the returned paginator to walk whole
708
+ `RunResult` pages.
709
+ """
710
+ return apaginate(
711
+ self._client,
712
+ "rednote.search",
713
+ dict(input),
714
+ "notes",
715
+ item_model=RednoteSearchNote,
716
+ data_model=RednoteSearchData,
717
+ bare=False,
718
+ options=options,
719
+ )
720
+
721
+ async def search_users(
722
+ self,
723
+ *,
724
+ options: RequestOptions | None = None,
725
+ **input: Unpack[RednoteSearchUsersInput],
726
+ ) -> RunResult[RednoteSearchUsersData]:
727
+ """RedNote (Xiaohongshu) User Search
728
+
729
+ Search RedNote (Xiaohongshu) users by keyword and return normalized user
730
+ records with pagination.
731
+
732
+ Price: $0.01 per request.
733
+
734
+ Example:
735
+ res = client.rednote.search_users(query="coffee")
736
+ """
737
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
738
+ "rednote.search_users", dict(input), options
739
+ )
740
+ return RunResult[RednoteSearchUsersData].model_validate(raw)
741
+
742
+ def iter_search_users(
743
+ self,
744
+ *,
745
+ options: RequestOptions | None = None,
746
+ **input: Unpack[RednoteSearchUsersInput],
747
+ ) -> AsyncPaginator[RednoteSearchUsersUser, RednoteSearchUsersData]:
748
+ """Iterate RedNote (Xiaohongshu) User Search results, following pagination cursors.
749
+
750
+ Yields validated `RednoteSearchUsersUser` items from the `users` field of
751
+ each page. Use `.pages()` on the returned paginator to walk whole
752
+ `RunResult` pages.
753
+ """
754
+ return apaginate(
755
+ self._client,
756
+ "rednote.search_users",
757
+ dict(input),
758
+ "users",
759
+ item_model=RednoteSearchUsersUser,
760
+ data_model=RednoteSearchUsersData,
761
+ bare=False,
762
+ options=options,
763
+ )
764
+
765
+ async def user_notes(
766
+ self,
767
+ *,
768
+ options: RequestOptions | None = None,
769
+ **input: Unpack[RednoteUserNotesInput],
770
+ ) -> RunResult[RednoteUserNotesData]:
771
+ """RedNote (Xiaohongshu) User Notes
772
+
773
+ List notes posted by a RedNote (Xiaohongshu) user and return normalized note
774
+ records with pagination.
775
+
776
+ Price: $0.01 per request.
777
+
778
+ Example:
779
+ res = client.rednote.user_notes(userId="56b0a4491c07df6365277af7")
780
+ """
781
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
782
+ "rednote.user_notes", dict(input), options
783
+ )
784
+ return RunResult[RednoteUserNotesData].model_validate(raw)
785
+
786
+ def iter_user_notes(
787
+ self,
788
+ *,
789
+ options: RequestOptions | None = None,
790
+ **input: Unpack[RednoteUserNotesInput],
791
+ ) -> AsyncPaginator[RednoteUserNotesNote, RednoteUserNotesData]:
792
+ """Iterate RedNote (Xiaohongshu) User Notes results, following pagination cursors.
793
+
794
+ Yields validated `RednoteUserNotesNote` items from the `notes` field of
795
+ each page. Use `.pages()` on the returned paginator to walk whole
796
+ `RunResult` pages.
797
+ """
798
+ return apaginate(
799
+ self._client,
800
+ "rednote.user_notes",
801
+ dict(input),
802
+ "notes",
803
+ item_model=RednoteUserNotesNote,
804
+ data_model=RednoteUserNotesData,
805
+ bare=False,
806
+ options=options,
807
+ )