getanyapi 0.7.1__tar.gz → 0.8.0__tar.gz
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.
- {getanyapi-0.7.1 → getanyapi-0.8.0}/PKG-INFO +1 -1
- {getanyapi-0.7.1 → getanyapi-0.8.0}/pyproject.toml +1 -1
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/__init__.py +1 -1
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/twitter.py +149 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/.gitignore +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/README.md +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_account.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_async_client.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_client.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_errors.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_pagination.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/_transport.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/__init__.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/ahrefs.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/airbnb.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/alibaba.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/amazon.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/apollo.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/appstore.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/bluesky.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/booking.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/coinmarketcap.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/congress.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/dexscreener.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/douyin.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/ebay.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/email.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/facebook.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/fiverr.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/github.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/glassdoor.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/google.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/google_ads.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/google_finance.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/google_shopping.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/hackernews.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/indeed.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/instagram.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/linkedin.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/maps.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/pandaexpress.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/person.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/pinterest.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/playstore.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/polymarket.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/realtor.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/reddit.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/redfin.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/rednote.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/sec.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/semrush.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/seo.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/snapchat.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/social.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/spotify.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/substack.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/threads.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/tiktok.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/tiktok_shop.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/tripadvisor.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/trustpilot.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/truthsocial.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/upwork.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/walmart.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/web.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/weibo.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/whatsapp.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/yahoo_finance.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/yelp.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/youtube.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/zhihu.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/platforms/zillow.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/py.typed +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/src/getanyapi/types.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/conftest.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_account.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_client.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_envelope.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_errors.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_fixture_roundtrip.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_fixture_sweep.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_pagination.py +0 -0
- {getanyapi-0.7.1 → getanyapi-0.8.0}/tests/test_transport.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: getanyapi
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.0
|
|
4
4
|
Summary: Official typed Python SDK for AnyAPI: any API, one wallet, USD, no subscriptions.
|
|
5
5
|
Project-URL: Homepage, https://getanyapi.com
|
|
6
6
|
Project-URL: Documentation, https://getanyapi.com/docs
|
|
@@ -108,6 +108,15 @@ class TwitterTweetTranscriptInput(TypedDict, total=False):
|
|
|
108
108
|
"""Tweet URL of the video to transcribe (e.g. https://x.com/TheoVon/status/1916982720317821050)."""
|
|
109
109
|
|
|
110
110
|
|
|
111
|
+
class TwitterUserPostsInput(TypedDict, total=False):
|
|
112
|
+
"""Input for X / Twitter User Posts."""
|
|
113
|
+
|
|
114
|
+
cursor: NotRequired[str]
|
|
115
|
+
"""Opaque pagination cursor from a previous response's nextCursor. Omit for the first page."""
|
|
116
|
+
handle: Required[str]
|
|
117
|
+
"""Twitter/X handle without the leading @."""
|
|
118
|
+
|
|
119
|
+
|
|
111
120
|
class TwitterUserTweetsInput(TypedDict, total=False):
|
|
112
121
|
"""Input for X / Twitter User Tweets and Replies."""
|
|
113
122
|
|
|
@@ -408,6 +417,54 @@ class TwitterTweetTranscriptData(BaseModel):
|
|
|
408
417
|
transcript: str
|
|
409
418
|
|
|
410
419
|
|
|
420
|
+
class TwitterUserPostsData(BaseModel):
|
|
421
|
+
model_config = ConfigDict(populate_by_name=True)
|
|
422
|
+
|
|
423
|
+
next_cursor: str = Field(
|
|
424
|
+
alias="nextCursor",
|
|
425
|
+
description="Opaque cursor for the next native Posts-tab page, or null when no more pages are available.",
|
|
426
|
+
)
|
|
427
|
+
tweets: list[TwitterUserPostsTweet] = Field(
|
|
428
|
+
description="Posts in profile order. A pinned post may appear before otherwise reverse-chronological results. Populated whenever the provider has data for the entity."
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
class TwitterUserPostsTweet(BaseModel):
|
|
433
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
434
|
+
|
|
435
|
+
bookmarks: int = Field(description="Number of bookmarks.")
|
|
436
|
+
created_utc: float = Field(
|
|
437
|
+
alias="createdUtc",
|
|
438
|
+
description="UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity.",
|
|
439
|
+
)
|
|
440
|
+
id: str = Field(
|
|
441
|
+
description="The post's numeric tweet ID, represented as a string. Populated whenever the provider has data for the entity."
|
|
442
|
+
)
|
|
443
|
+
is_pinned: bool = Field(
|
|
444
|
+
alias="isPinned",
|
|
445
|
+
description="Whether X marks the post as pinned on the profile.",
|
|
446
|
+
)
|
|
447
|
+
is_reply: bool | None = Field(
|
|
448
|
+
default=None,
|
|
449
|
+
alias="isReply",
|
|
450
|
+
description="Whether X marks the record as a reply. Certified Posts-tab captures use this for self-thread continuations.",
|
|
451
|
+
)
|
|
452
|
+
lang: str | None = Field(
|
|
453
|
+
default=None, description="Language code reported for the post, when available."
|
|
454
|
+
)
|
|
455
|
+
likes: int = Field(description="Number of likes.")
|
|
456
|
+
quotes: int | None = Field(default=None, description="Number of quote posts.")
|
|
457
|
+
replies: int = Field(description="Number of replies.")
|
|
458
|
+
retweets: int = Field(description="Number of reposts or retweets.")
|
|
459
|
+
text: str = Field(
|
|
460
|
+
description="The post text. Empty for media-only posts. Populated whenever the provider has data for the entity."
|
|
461
|
+
)
|
|
462
|
+
url: str = Field(
|
|
463
|
+
description="Canonical x.com URL of the post. Populated whenever the provider has data for the entity."
|
|
464
|
+
)
|
|
465
|
+
views: int = Field(description="Number of views.")
|
|
466
|
+
|
|
467
|
+
|
|
411
468
|
class TwitterUserTweetsData(BaseModel):
|
|
412
469
|
model_config = ConfigDict(populate_by_name=True)
|
|
413
470
|
|
|
@@ -720,6 +777,52 @@ class TwitterNamespace:
|
|
|
720
777
|
)
|
|
721
778
|
return RunResult[TwitterTweetTranscriptData].model_validate(raw)
|
|
722
779
|
|
|
780
|
+
def user_posts(
|
|
781
|
+
self,
|
|
782
|
+
*,
|
|
783
|
+
options: RequestOptions | None = None,
|
|
784
|
+
**input: Unpack[TwitterUserPostsInput],
|
|
785
|
+
) -> RunResult[TwitterUserPostsData]:
|
|
786
|
+
"""X / Twitter User Posts
|
|
787
|
+
|
|
788
|
+
Get an X (Twitter) account's profile Posts-tab timeline by handle. Results
|
|
789
|
+
follow profile order: a pinned post may appear first, followed by otherwise
|
|
790
|
+
reverse-chronological authored posts, reposts, quotes, and self-thread
|
|
791
|
+
continuations.
|
|
792
|
+
|
|
793
|
+
Price: $0.00075 per request.
|
|
794
|
+
|
|
795
|
+
Example:
|
|
796
|
+
res = client.twitter.user_posts(handle="levelsio")
|
|
797
|
+
"""
|
|
798
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
799
|
+
"twitter.user_posts", dict(input), options
|
|
800
|
+
)
|
|
801
|
+
return RunResult[TwitterUserPostsData].model_validate(raw)
|
|
802
|
+
|
|
803
|
+
def iter_user_posts(
|
|
804
|
+
self,
|
|
805
|
+
*,
|
|
806
|
+
options: RequestOptions | None = None,
|
|
807
|
+
**input: Unpack[TwitterUserPostsInput],
|
|
808
|
+
) -> Paginator[TwitterUserPostsTweet, TwitterUserPostsData]:
|
|
809
|
+
"""Iterate X / Twitter User Posts results, following pagination cursors.
|
|
810
|
+
|
|
811
|
+
Yields validated `TwitterUserPostsTweet` items from the `tweets` field of
|
|
812
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
813
|
+
`RunResult` pages.
|
|
814
|
+
"""
|
|
815
|
+
return paginate(
|
|
816
|
+
self._client,
|
|
817
|
+
"twitter.user_posts",
|
|
818
|
+
dict(input),
|
|
819
|
+
"tweets",
|
|
820
|
+
item_model=TwitterUserPostsTweet,
|
|
821
|
+
data_model=TwitterUserPostsData,
|
|
822
|
+
bare=False,
|
|
823
|
+
options=options,
|
|
824
|
+
)
|
|
825
|
+
|
|
723
826
|
def user_tweets(
|
|
724
827
|
self,
|
|
725
828
|
*,
|
|
@@ -1039,6 +1142,52 @@ class AsyncTwitterNamespace:
|
|
|
1039
1142
|
)
|
|
1040
1143
|
return RunResult[TwitterTweetTranscriptData].model_validate(raw)
|
|
1041
1144
|
|
|
1145
|
+
async def user_posts(
|
|
1146
|
+
self,
|
|
1147
|
+
*,
|
|
1148
|
+
options: RequestOptions | None = None,
|
|
1149
|
+
**input: Unpack[TwitterUserPostsInput],
|
|
1150
|
+
) -> RunResult[TwitterUserPostsData]:
|
|
1151
|
+
"""X / Twitter User Posts
|
|
1152
|
+
|
|
1153
|
+
Get an X (Twitter) account's profile Posts-tab timeline by handle. Results
|
|
1154
|
+
follow profile order: a pinned post may appear first, followed by otherwise
|
|
1155
|
+
reverse-chronological authored posts, reposts, quotes, and self-thread
|
|
1156
|
+
continuations.
|
|
1157
|
+
|
|
1158
|
+
Price: $0.00075 per request.
|
|
1159
|
+
|
|
1160
|
+
Example:
|
|
1161
|
+
res = client.twitter.user_posts(handle="levelsio")
|
|
1162
|
+
"""
|
|
1163
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
1164
|
+
"twitter.user_posts", dict(input), options
|
|
1165
|
+
)
|
|
1166
|
+
return RunResult[TwitterUserPostsData].model_validate(raw)
|
|
1167
|
+
|
|
1168
|
+
def iter_user_posts(
|
|
1169
|
+
self,
|
|
1170
|
+
*,
|
|
1171
|
+
options: RequestOptions | None = None,
|
|
1172
|
+
**input: Unpack[TwitterUserPostsInput],
|
|
1173
|
+
) -> AsyncPaginator[TwitterUserPostsTweet, TwitterUserPostsData]:
|
|
1174
|
+
"""Iterate X / Twitter User Posts results, following pagination cursors.
|
|
1175
|
+
|
|
1176
|
+
Yields validated `TwitterUserPostsTweet` items from the `tweets` field of
|
|
1177
|
+
each page. Use `.pages()` on the returned paginator to walk whole
|
|
1178
|
+
`RunResult` pages.
|
|
1179
|
+
"""
|
|
1180
|
+
return apaginate(
|
|
1181
|
+
self._client,
|
|
1182
|
+
"twitter.user_posts",
|
|
1183
|
+
dict(input),
|
|
1184
|
+
"tweets",
|
|
1185
|
+
item_model=TwitterUserPostsTweet,
|
|
1186
|
+
data_model=TwitterUserPostsData,
|
|
1187
|
+
bare=False,
|
|
1188
|
+
options=options,
|
|
1189
|
+
)
|
|
1190
|
+
|
|
1042
1191
|
async def user_tweets(
|
|
1043
1192
|
self,
|
|
1044
1193
|
*,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|