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,105 @@
1
+ # Generated - do not edit. Regenerate with: pnpm generate
2
+ """Generated namespace module for the social platform."""
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import 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
+
13
+ if TYPE_CHECKING:
14
+ from .._async_client import AsyncAnyAPI
15
+ from .._client import AnyAPI
16
+
17
+
18
+ class SocialFinderInput(TypedDict, total=False):
19
+ """Input for Social Profile Finder."""
20
+
21
+ limit: NotRequired[int]
22
+ """Maximum number of results to return (1-10, default 10). You are billed per result returned, so a lower limit costs less. Range: 1 to 10."""
23
+ name: Required[str]
24
+ """The profile name or handle to search for across social networks (e.g. johndoe)."""
25
+ platform: NotRequired[str]
26
+ """Limit the search to one network: askfm, discord, facebook, github, instagram, linkedin, medium, pinterest, steam, threads, tiktok, twitch, or youtube (e.g. instagram); all networks are searched when omitted."""
27
+
28
+
29
+ class SocialFinderData(BaseModel):
30
+ items: list[SocialFinderItem] = Field(
31
+ description="Profile match records: the queried profile name, the social network, and the matching profile URL when one was found."
32
+ )
33
+
34
+
35
+ class SocialFinderItem(BaseModel):
36
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
37
+
38
+ input_profile_name: str | None = Field(
39
+ default=None,
40
+ alias="inputProfileName",
41
+ description="The name that was searched for. Present whenever the upstream returns this record.",
42
+ )
43
+ social: str = Field(
44
+ description="The social network checked (e.g. discord, facebook, github)."
45
+ )
46
+ social_profile_url: str = Field(
47
+ alias="socialProfileUrl",
48
+ description="URL of the matching profile, or null when no account was found on that network.",
49
+ )
50
+
51
+
52
+ class SocialNamespace:
53
+ """Typed methods for this platform. Attached lazily to the client."""
54
+
55
+ def __init__(self, client: "AnyAPI") -> None:
56
+ self._client = client
57
+
58
+ def finder(
59
+ self,
60
+ *,
61
+ options: RequestOptions | None = None,
62
+ **input: Unpack[SocialFinderInput],
63
+ ) -> RunResult[SocialFinderData]:
64
+ """Social Profile Finder
65
+
66
+ Find a person's or brand's profiles across major social networks from a
67
+ single name, returned as normalized JSON with flat per-request USD pricing.
68
+
69
+ Price: $0.001 per request plus $0.002 per result.
70
+
71
+ Example:
72
+ res = client.social.finder(limit=3, name="Elon Musk")
73
+ """
74
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
75
+ "social.finder", dict(input), options
76
+ )
77
+ return RunResult[SocialFinderData].model_validate(raw)
78
+
79
+
80
+ class AsyncSocialNamespace:
81
+ """Typed methods for this platform. Attached lazily to the client."""
82
+
83
+ def __init__(self, client: "AsyncAnyAPI") -> None:
84
+ self._client = client
85
+
86
+ async def finder(
87
+ self,
88
+ *,
89
+ options: RequestOptions | None = None,
90
+ **input: Unpack[SocialFinderInput],
91
+ ) -> RunResult[SocialFinderData]:
92
+ """Social Profile Finder
93
+
94
+ Find a person's or brand's profiles across major social networks from a
95
+ single name, returned as normalized JSON with flat per-request USD pricing.
96
+
97
+ Price: $0.001 per request plus $0.002 per result.
98
+
99
+ Example:
100
+ res = client.social.finder(limit=3, name="Elon Musk")
101
+ """
102
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
103
+ "social.finder", dict(input), options
104
+ )
105
+ return RunResult[SocialFinderData].model_validate(raw)
@@ -0,0 +1,588 @@
1
+ # Generated - do not edit. Regenerate with: pnpm generate
2
+ """Generated namespace module for the spotify platform."""
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import 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 SpotifyAlbumInput(TypedDict, total=False):
25
+ """Input for Spotify Album."""
26
+
27
+ id: NotRequired[str]
28
+ """Spotify album ID (alternative to url)."""
29
+ url: NotRequired[str]
30
+ """Spotify album URL (e.g. https://open.spotify.com/album/0pgrg7phBbnwGJ2HBEl9EG)."""
31
+
32
+
33
+ class SpotifyArtistInput(TypedDict, total=False):
34
+ """Input for Spotify Artist."""
35
+
36
+ id: NotRequired[str]
37
+ """Spotify artist ID (alternative to url)."""
38
+ url: NotRequired[str]
39
+ """Spotify artist URL (e.g. https://open.spotify.com/artist/3DiDSECUqqY1AuBP8qtaIa)."""
40
+
41
+
42
+ class SpotifyPlayCountInput(TypedDict, total=False):
43
+ """Input for Spotify Play Count."""
44
+
45
+ url: Required[str]
46
+ """Spotify track, album, or artist URL to fetch stream counts for (e.g. https://open.spotify.com/track/3n3Ppam7vgaVa1iaRUc9Lp)."""
47
+
48
+
49
+ class SpotifyPodcastInput(TypedDict, total=False):
50
+ """Input for Spotify Podcast."""
51
+
52
+ id: NotRequired[str]
53
+ """Spotify podcast show ID (alternative to url)."""
54
+ url: NotRequired[str]
55
+ """Spotify podcast show URL (e.g. https://open.spotify.com/show/3mliji9352UAk3XnWElnDV)."""
56
+
57
+
58
+ class SpotifyPodcastEpisodesInput(TypedDict, total=False):
59
+ """Input for Spotify Podcast Episodes."""
60
+
61
+ cursor: NotRequired[str]
62
+ """Pagination cursor from a previous response for subsequent pages."""
63
+ id: NotRequired[str]
64
+ """Spotify podcast show ID (alternative to url)."""
65
+ url: NotRequired[str]
66
+ """Spotify podcast show URL (e.g. https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk)."""
67
+
68
+
69
+ class SpotifySearchInput(TypedDict, total=False):
70
+ """Input for Spotify Search."""
71
+
72
+ query: Required[str]
73
+ """Search term (e.g. "my first million")."""
74
+
75
+
76
+ class SpotifyTrackInput(TypedDict, total=False):
77
+ """Input for Spotify Track."""
78
+
79
+ id: NotRequired[str]
80
+ """Spotify track ID (alternative to url)."""
81
+ url: NotRequired[str]
82
+ """Spotify track URL (e.g. https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT)."""
83
+
84
+
85
+ class SpotifyAlbumData(BaseModel):
86
+ model_config = ConfigDict(populate_by_name=True)
87
+
88
+ id: str
89
+ label: str
90
+ name: str
91
+ popularity: int
92
+ release_date: str = Field(alias="releaseDate")
93
+ tracks: list[SpotifyAlbumTrack]
94
+ type_: str = Field(alias="type")
95
+ uri: str
96
+
97
+
98
+ class SpotifyAlbumTrack(BaseModel):
99
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
100
+
101
+ duration_ms: int = Field(alias="durationMs")
102
+ name: str
103
+ playcount: int
104
+ uri: str
105
+
106
+
107
+ class SpotifyArtistData(BaseModel):
108
+ model_config = ConfigDict(populate_by_name=True)
109
+
110
+ albums: list[SpotifyArtistAlbum]
111
+ top_tracks: list[SpotifyArtistTopTrack] = Field(alias="topTracks")
112
+
113
+
114
+ class SpotifyArtistAlbum(BaseModel):
115
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
116
+
117
+ id: str
118
+ name: str
119
+ track_count: int = Field(alias="trackCount")
120
+ type_: str = Field(alias="type")
121
+ uri: str
122
+ year: int
123
+
124
+
125
+ class SpotifyArtistTopTrack(BaseModel):
126
+ model_config = ConfigDict(extra="allow")
127
+
128
+ id: str
129
+ name: str
130
+ playcount: int
131
+ uri: str
132
+
133
+
134
+ class SpotifyPlayCountData(BaseModel):
135
+ items: list[SpotifyPlayCountItem] = Field(
136
+ description="Play-count records: track, album, or artist metadata with stream counts and statistics."
137
+ )
138
+
139
+
140
+ class SpotifyPlayCountItem(BaseModel):
141
+ model_config = ConfigDict(extra="allow")
142
+
143
+ id: str
144
+ name: str
145
+ url: str | None = Field(
146
+ default=None, description="Present whenever the upstream returns this record."
147
+ )
148
+
149
+
150
+ class SpotifyPodcastData(BaseModel):
151
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
152
+
153
+ average_rating: float = Field(alias="averageRating")
154
+ description: str
155
+ id: str
156
+ name: str
157
+ publisher: str
158
+ total_ratings: int = Field(alias="totalRatings")
159
+ uri: str
160
+
161
+
162
+ class SpotifyPodcastEpisodesData(BaseModel):
163
+ model_config = ConfigDict(populate_by_name=True)
164
+
165
+ episodes: list[SpotifyPodcastEpisodesEpisode]
166
+ next_cursor: str = Field(alias="nextCursor")
167
+ total_count: int = Field(alias="totalCount")
168
+
169
+
170
+ class SpotifyPodcastEpisodesEpisode(BaseModel):
171
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
172
+
173
+ description: str
174
+ duration_ms: int = Field(alias="durationMs")
175
+ id: str
176
+ name: str
177
+ release_date: str = Field(alias="releaseDate")
178
+ uri: str
179
+
180
+
181
+ class SpotifySearchData(BaseModel):
182
+ albums: list[SpotifySearchAlbum]
183
+ artists: list[SpotifySearchArtist]
184
+ podcasts: list[SpotifySearchPodcast]
185
+ tracks: list[SpotifySearchTrack]
186
+
187
+
188
+ class SpotifySearchAlbum(BaseModel):
189
+ model_config = ConfigDict(extra="allow")
190
+
191
+ id: str
192
+ name: str
193
+ uri: str
194
+ year: int
195
+
196
+
197
+ class SpotifySearchArtist(BaseModel):
198
+ model_config = ConfigDict(extra="allow")
199
+
200
+ id: str
201
+ name: str
202
+ uri: str
203
+ verified: bool
204
+
205
+
206
+ class SpotifySearchPodcast(BaseModel):
207
+ model_config = ConfigDict(extra="allow")
208
+
209
+ id: str
210
+ name: str
211
+ publisher: str
212
+
213
+
214
+ class SpotifySearchTrack(BaseModel):
215
+ model_config = ConfigDict(extra="allow")
216
+
217
+ id: str
218
+ name: str
219
+ uri: str
220
+
221
+
222
+ class SpotifyTrackData(BaseModel):
223
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
224
+
225
+ duration_ms: int = Field(alias="durationMs")
226
+ id: str
227
+ name: str
228
+ playcount: int
229
+ popularity: int
230
+ share_url: str = Field(alias="shareUrl")
231
+ track_number: int = Field(alias="trackNumber")
232
+ uri: str
233
+
234
+
235
+ class SpotifyNamespace:
236
+ """Typed methods for this platform. Attached lazily to the client."""
237
+
238
+ def __init__(self, client: "AnyAPI") -> None:
239
+ self._client = client
240
+
241
+ def album(
242
+ self,
243
+ *,
244
+ options: RequestOptions | None = None,
245
+ **input: Unpack[SpotifyAlbumInput],
246
+ ) -> RunResult[SpotifyAlbumData]:
247
+ """Spotify Album
248
+
249
+ Fetch a Spotify album's tracklist, play counts, label, and release details
250
+ by album URL or ID, with transparent per-request USD pricing.
251
+
252
+ Price: $0.002 per request.
253
+
254
+ Example:
255
+ res = client.spotify.album(url="https://open.spotify.com/album/0pgrg7phBbnwGJ2HBEl9EG")
256
+ """
257
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
258
+ "spotify.album", dict(input), options
259
+ )
260
+ return RunResult[SpotifyAlbumData].model_validate(raw)
261
+
262
+ def artist(
263
+ self,
264
+ *,
265
+ options: RequestOptions | None = None,
266
+ **input: Unpack[SpotifyArtistInput],
267
+ ) -> RunResult[SpotifyArtistData]:
268
+ """Spotify Artist
269
+
270
+ Fetch a Spotify artist's discography (albums, singles, top tracks) and
271
+ metadata by artist URL or ID, with transparent per-request USD pricing.
272
+
273
+ Price: $0.002 per request.
274
+
275
+ Example:
276
+ res = client.spotify.artist(url="https://open.spotify.com/artist/3DiDSECUqqY1AuBP8qtaIa")
277
+ """
278
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
279
+ "spotify.artist", dict(input), options
280
+ )
281
+ return RunResult[SpotifyArtistData].model_validate(raw)
282
+
283
+ def play_count(
284
+ self,
285
+ *,
286
+ options: RequestOptions | None = None,
287
+ **input: Unpack[SpotifyPlayCountInput],
288
+ ) -> RunResult[SpotifyPlayCountData]:
289
+ """Spotify Play Count
290
+
291
+ Fetch stream counts and stats for a Spotify track, album, or artist URL,
292
+ with transparent per-request USD pricing.
293
+
294
+ Price: $0.003 per result.
295
+
296
+ Example:
297
+ res = client.spotify.play_count(url="https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT")
298
+ """
299
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
300
+ "spotify.play_count", dict(input), options
301
+ )
302
+ return RunResult[SpotifyPlayCountData].model_validate(raw)
303
+
304
+ def podcast(
305
+ self,
306
+ *,
307
+ options: RequestOptions | None = None,
308
+ **input: Unpack[SpotifyPodcastInput],
309
+ ) -> RunResult[SpotifyPodcastData]:
310
+ """Spotify Podcast
311
+
312
+ Fetch a Spotify podcast show's name, publisher, description, rating, and
313
+ topics by show URL or ID, with transparent per-request USD pricing.
314
+
315
+ Price: $0.002 per request.
316
+
317
+ Example:
318
+ res = client.spotify.podcast(url="https://open.spotify.com/show/3mliji9352UAk3XnWElnDV")
319
+ """
320
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
321
+ "spotify.podcast", dict(input), options
322
+ )
323
+ return RunResult[SpotifyPodcastData].model_validate(raw)
324
+
325
+ def podcast_episodes(
326
+ self,
327
+ *,
328
+ options: RequestOptions | None = None,
329
+ **input: Unpack[SpotifyPodcastEpisodesInput],
330
+ ) -> RunResult[SpotifyPodcastEpisodesData]:
331
+ """Spotify Podcast Episodes
332
+
333
+ List a Spotify podcast show's episodes with titles, durations, descriptions,
334
+ and release dates by show URL or ID, with transparent per-request USD
335
+ pricing.
336
+
337
+ Price: $0.002 per request.
338
+
339
+ Example:
340
+ res = client.spotify.podcast_episodes(url="https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk")
341
+ """
342
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
343
+ "spotify.podcast_episodes", dict(input), options
344
+ )
345
+ return RunResult[SpotifyPodcastEpisodesData].model_validate(raw)
346
+
347
+ def iter_podcast_episodes(
348
+ self,
349
+ *,
350
+ options: RequestOptions | None = None,
351
+ **input: Unpack[SpotifyPodcastEpisodesInput],
352
+ ) -> Paginator[SpotifyPodcastEpisodesEpisode, SpotifyPodcastEpisodesData]:
353
+ """Iterate Spotify Podcast Episodes results, following pagination cursors.
354
+
355
+ Yields validated `SpotifyPodcastEpisodesEpisode` items from the `episodes` field of
356
+ each page. Use `.pages()` on the returned paginator to walk whole
357
+ `RunResult` pages.
358
+ """
359
+ return paginate(
360
+ self._client,
361
+ "spotify.podcast_episodes",
362
+ dict(input),
363
+ "episodes",
364
+ item_model=SpotifyPodcastEpisodesEpisode,
365
+ data_model=SpotifyPodcastEpisodesData,
366
+ bare=False,
367
+ options=options,
368
+ )
369
+
370
+ def search(
371
+ self,
372
+ *,
373
+ options: RequestOptions | None = None,
374
+ **input: Unpack[SpotifySearchInput],
375
+ ) -> RunResult[SpotifySearchData]:
376
+ """Spotify Search
377
+
378
+ Search Spotify for matching tracks, albums, artists, podcasts, and playlists
379
+ by keyword, with transparent per-request USD pricing.
380
+
381
+ Price: $0.002 per request.
382
+
383
+ Example:
384
+ res = client.spotify.search(query="my first million")
385
+ """
386
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
387
+ "spotify.search", dict(input), options
388
+ )
389
+ return RunResult[SpotifySearchData].model_validate(raw)
390
+
391
+ def track(
392
+ self,
393
+ *,
394
+ options: RequestOptions | None = None,
395
+ **input: Unpack[SpotifyTrackInput],
396
+ ) -> RunResult[SpotifyTrackData]:
397
+ """Spotify Track
398
+
399
+ Fetch a Spotify track's play count, popularity, duration, and album details
400
+ by track URL or ID, with transparent per-request USD pricing.
401
+
402
+ Price: $0.002 per request.
403
+
404
+ Example:
405
+ res = client.spotify.track(url="https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT")
406
+ """
407
+ raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
408
+ "spotify.track", dict(input), options
409
+ )
410
+ return RunResult[SpotifyTrackData].model_validate(raw)
411
+
412
+
413
+ class AsyncSpotifyNamespace:
414
+ """Typed methods for this platform. Attached lazily to the client."""
415
+
416
+ def __init__(self, client: "AsyncAnyAPI") -> None:
417
+ self._client = client
418
+
419
+ async def album(
420
+ self,
421
+ *,
422
+ options: RequestOptions | None = None,
423
+ **input: Unpack[SpotifyAlbumInput],
424
+ ) -> RunResult[SpotifyAlbumData]:
425
+ """Spotify Album
426
+
427
+ Fetch a Spotify album's tracklist, play counts, label, and release details
428
+ by album URL or ID, with transparent per-request USD pricing.
429
+
430
+ Price: $0.002 per request.
431
+
432
+ Example:
433
+ res = client.spotify.album(url="https://open.spotify.com/album/0pgrg7phBbnwGJ2HBEl9EG")
434
+ """
435
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
436
+ "spotify.album", dict(input), options
437
+ )
438
+ return RunResult[SpotifyAlbumData].model_validate(raw)
439
+
440
+ async def artist(
441
+ self,
442
+ *,
443
+ options: RequestOptions | None = None,
444
+ **input: Unpack[SpotifyArtistInput],
445
+ ) -> RunResult[SpotifyArtistData]:
446
+ """Spotify Artist
447
+
448
+ Fetch a Spotify artist's discography (albums, singles, top tracks) and
449
+ metadata by artist URL or ID, with transparent per-request USD pricing.
450
+
451
+ Price: $0.002 per request.
452
+
453
+ Example:
454
+ res = client.spotify.artist(url="https://open.spotify.com/artist/3DiDSECUqqY1AuBP8qtaIa")
455
+ """
456
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
457
+ "spotify.artist", dict(input), options
458
+ )
459
+ return RunResult[SpotifyArtistData].model_validate(raw)
460
+
461
+ async def play_count(
462
+ self,
463
+ *,
464
+ options: RequestOptions | None = None,
465
+ **input: Unpack[SpotifyPlayCountInput],
466
+ ) -> RunResult[SpotifyPlayCountData]:
467
+ """Spotify Play Count
468
+
469
+ Fetch stream counts and stats for a Spotify track, album, or artist URL,
470
+ with transparent per-request USD pricing.
471
+
472
+ Price: $0.003 per result.
473
+
474
+ Example:
475
+ res = client.spotify.play_count(url="https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT")
476
+ """
477
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
478
+ "spotify.play_count", dict(input), options
479
+ )
480
+ return RunResult[SpotifyPlayCountData].model_validate(raw)
481
+
482
+ async def podcast(
483
+ self,
484
+ *,
485
+ options: RequestOptions | None = None,
486
+ **input: Unpack[SpotifyPodcastInput],
487
+ ) -> RunResult[SpotifyPodcastData]:
488
+ """Spotify Podcast
489
+
490
+ Fetch a Spotify podcast show's name, publisher, description, rating, and
491
+ topics by show URL or ID, with transparent per-request USD pricing.
492
+
493
+ Price: $0.002 per request.
494
+
495
+ Example:
496
+ res = client.spotify.podcast(url="https://open.spotify.com/show/3mliji9352UAk3XnWElnDV")
497
+ """
498
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
499
+ "spotify.podcast", dict(input), options
500
+ )
501
+ return RunResult[SpotifyPodcastData].model_validate(raw)
502
+
503
+ async def podcast_episodes(
504
+ self,
505
+ *,
506
+ options: RequestOptions | None = None,
507
+ **input: Unpack[SpotifyPodcastEpisodesInput],
508
+ ) -> RunResult[SpotifyPodcastEpisodesData]:
509
+ """Spotify Podcast Episodes
510
+
511
+ List a Spotify podcast show's episodes with titles, durations, descriptions,
512
+ and release dates by show URL or ID, with transparent per-request USD
513
+ pricing.
514
+
515
+ Price: $0.002 per request.
516
+
517
+ Example:
518
+ res = client.spotify.podcast_episodes(url="https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk")
519
+ """
520
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
521
+ "spotify.podcast_episodes", dict(input), options
522
+ )
523
+ return RunResult[SpotifyPodcastEpisodesData].model_validate(raw)
524
+
525
+ def iter_podcast_episodes(
526
+ self,
527
+ *,
528
+ options: RequestOptions | None = None,
529
+ **input: Unpack[SpotifyPodcastEpisodesInput],
530
+ ) -> AsyncPaginator[SpotifyPodcastEpisodesEpisode, SpotifyPodcastEpisodesData]:
531
+ """Iterate Spotify Podcast Episodes results, following pagination cursors.
532
+
533
+ Yields validated `SpotifyPodcastEpisodesEpisode` items from the `episodes` field of
534
+ each page. Use `.pages()` on the returned paginator to walk whole
535
+ `RunResult` pages.
536
+ """
537
+ return apaginate(
538
+ self._client,
539
+ "spotify.podcast_episodes",
540
+ dict(input),
541
+ "episodes",
542
+ item_model=SpotifyPodcastEpisodesEpisode,
543
+ data_model=SpotifyPodcastEpisodesData,
544
+ bare=False,
545
+ options=options,
546
+ )
547
+
548
+ async def search(
549
+ self,
550
+ *,
551
+ options: RequestOptions | None = None,
552
+ **input: Unpack[SpotifySearchInput],
553
+ ) -> RunResult[SpotifySearchData]:
554
+ """Spotify Search
555
+
556
+ Search Spotify for matching tracks, albums, artists, podcasts, and playlists
557
+ by keyword, with transparent per-request USD pricing.
558
+
559
+ Price: $0.002 per request.
560
+
561
+ Example:
562
+ res = client.spotify.search(query="my first million")
563
+ """
564
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
565
+ "spotify.search", dict(input), options
566
+ )
567
+ return RunResult[SpotifySearchData].model_validate(raw)
568
+
569
+ async def track(
570
+ self,
571
+ *,
572
+ options: RequestOptions | None = None,
573
+ **input: Unpack[SpotifyTrackInput],
574
+ ) -> RunResult[SpotifyTrackData]:
575
+ """Spotify Track
576
+
577
+ Fetch a Spotify track's play count, popularity, duration, and album details
578
+ by track URL or ID, with transparent per-request USD pricing.
579
+
580
+ Price: $0.002 per request.
581
+
582
+ Example:
583
+ res = client.spotify.track(url="https://open.spotify.com/track/4cOdK2wGLETKBW3PvgPWqT")
584
+ """
585
+ raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
586
+ "spotify.track", dict(input), options
587
+ )
588
+ return RunResult[SpotifyTrackData].model_validate(raw)