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.
- getanyapi/__init__.py +76 -0
- getanyapi/_account.py +132 -0
- getanyapi/_async_client.py +215 -0
- getanyapi/_client.py +274 -0
- getanyapi/_errors.py +115 -0
- getanyapi/_pagination.py +295 -0
- getanyapi/_transport.py +239 -0
- getanyapi/platforms/__init__.py +89 -0
- getanyapi/platforms/ahrefs.py +384 -0
- getanyapi/platforms/airbnb.py +120 -0
- getanyapi/platforms/alibaba.py +95 -0
- getanyapi/platforms/amazon.py +442 -0
- getanyapi/platforms/appstore.py +95 -0
- getanyapi/platforms/bluesky.py +215 -0
- getanyapi/platforms/booking.py +128 -0
- getanyapi/platforms/coinmarketcap.py +113 -0
- getanyapi/platforms/congress.py +106 -0
- getanyapi/platforms/dexscreener.py +104 -0
- getanyapi/platforms/ebay.py +215 -0
- getanyapi/platforms/email.py +166 -0
- getanyapi/platforms/facebook.py +2324 -0
- getanyapi/platforms/fiverr.py +122 -0
- getanyapi/platforms/github.py +954 -0
- getanyapi/platforms/glassdoor.py +93 -0
- getanyapi/platforms/google.py +232 -0
- getanyapi/platforms/google_ads.py +380 -0
- getanyapi/platforms/google_finance.py +170 -0
- getanyapi/platforms/google_shopping.py +103 -0
- getanyapi/platforms/hackernews.py +276 -0
- getanyapi/platforms/indeed.py +114 -0
- getanyapi/platforms/instagram.py +1868 -0
- getanyapi/platforms/linkedin.py +1064 -0
- getanyapi/platforms/maps.py +412 -0
- getanyapi/platforms/pandaexpress.py +262 -0
- getanyapi/platforms/person.py +96 -0
- getanyapi/platforms/pinterest.py +96 -0
- getanyapi/platforms/playstore.py +99 -0
- getanyapi/platforms/polymarket.py +109 -0
- getanyapi/platforms/realtor.py +104 -0
- getanyapi/platforms/reddit.py +582 -0
- getanyapi/platforms/redfin.py +95 -0
- getanyapi/platforms/rednote.py +807 -0
- getanyapi/platforms/sec.py +118 -0
- getanyapi/platforms/semrush.py +358 -0
- getanyapi/platforms/snapchat.py +146 -0
- getanyapi/platforms/social.py +105 -0
- getanyapi/platforms/spotify.py +588 -0
- getanyapi/platforms/substack.py +142 -0
- getanyapi/platforms/threads.py +358 -0
- getanyapi/platforms/tiktok.py +1827 -0
- getanyapi/platforms/tiktok_shop.py +536 -0
- getanyapi/platforms/tripadvisor.py +180 -0
- getanyapi/platforms/trustpilot.py +114 -0
- getanyapi/platforms/truthsocial.py +226 -0
- getanyapi/platforms/twitter.py +798 -0
- getanyapi/platforms/upwork.py +119 -0
- getanyapi/platforms/walmart.py +93 -0
- getanyapi/platforms/web.py +264 -0
- getanyapi/platforms/whatsapp.py +91 -0
- getanyapi/platforms/yahoo_finance.py +95 -0
- getanyapi/platforms/yelp.py +141 -0
- getanyapi/platforms/youtube.py +1452 -0
- getanyapi/platforms/zillow.py +218 -0
- getanyapi/py.typed +0 -0
- getanyapi/types.py +170 -0
- getanyapi-0.1.0.dist-info/METADATA +155 -0
- getanyapi-0.1.0.dist-info/RECORD +68 -0
- getanyapi-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the tripadvisor 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 TripadvisorReviewsInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Tripadvisor Reviews."""
|
|
20
|
+
|
|
21
|
+
limit: NotRequired[int]
|
|
22
|
+
"""Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less. Range: 1 to 20."""
|
|
23
|
+
since: NotRequired[str]
|
|
24
|
+
"""Only return reviews newer than this date, YYYY-MM-DD or a relative window like '3 months' (e.g. 2026-01-01)."""
|
|
25
|
+
url: Required[str]
|
|
26
|
+
"""Tripadvisor page URL of the hotel, restaurant, or attraction."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class TripadvisorSearchInput(TypedDict, total=False):
|
|
30
|
+
"""Input for Tripadvisor Search."""
|
|
31
|
+
|
|
32
|
+
currency: NotRequired[str]
|
|
33
|
+
"""ISO currency code for prices (e.g. USD, EUR). Default: USD."""
|
|
34
|
+
limit: NotRequired[int]
|
|
35
|
+
"""Maximum number of results to return (1-20, default 20). You are billed per result returned, so a lower limit costs less. Range: 1 to 20."""
|
|
36
|
+
query: Required[str]
|
|
37
|
+
"""Destination or keyword to search for (e.g. Barcelona)."""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class TripadvisorReviewsData(BaseModel):
|
|
41
|
+
items: list[TripadvisorReviewsItem] = Field(
|
|
42
|
+
description="Review records for the place: rating, title, review text, publish date, trip type, and reviewer details."
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class TripadvisorReviewsItem(BaseModel):
|
|
47
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
48
|
+
|
|
49
|
+
published_at: str | None = Field(
|
|
50
|
+
default=None,
|
|
51
|
+
alias="publishedAt",
|
|
52
|
+
description="Publish date. Present whenever the upstream returns this record.",
|
|
53
|
+
)
|
|
54
|
+
rating: float = Field(description="Star rating (typically 1-5).")
|
|
55
|
+
text: str = Field(description="Review body text.")
|
|
56
|
+
title: str | None = Field(
|
|
57
|
+
default=None, description="Present whenever the upstream returns this record."
|
|
58
|
+
)
|
|
59
|
+
url: str | None = Field(
|
|
60
|
+
default=None,
|
|
61
|
+
description="Canonical review URL. Present whenever the upstream returns this record.",
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class TripadvisorSearchData(BaseModel):
|
|
66
|
+
items: list[TripadvisorSearchItem] = Field(
|
|
67
|
+
description="Matching place records: name, type (hotel/restaurant/attraction), rating, review count, address, contact details, and pricing."
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class TripadvisorSearchItem(BaseModel):
|
|
72
|
+
model_config = ConfigDict(extra="allow")
|
|
73
|
+
|
|
74
|
+
rating: float
|
|
75
|
+
title: str
|
|
76
|
+
url: str
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class TripadvisorNamespace:
|
|
80
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
81
|
+
|
|
82
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
83
|
+
self._client = client
|
|
84
|
+
|
|
85
|
+
def reviews(
|
|
86
|
+
self,
|
|
87
|
+
*,
|
|
88
|
+
options: RequestOptions | None = None,
|
|
89
|
+
**input: Unpack[TripadvisorReviewsInput],
|
|
90
|
+
) -> RunResult[TripadvisorReviewsData]:
|
|
91
|
+
"""Tripadvisor Reviews
|
|
92
|
+
|
|
93
|
+
Fetch the latest reviews for any Tripadvisor hotel, restaurant, or
|
|
94
|
+
attraction by its page URL - rating, text, date, and trip details as
|
|
95
|
+
normalized JSON with transparent per-request USD pricing.
|
|
96
|
+
|
|
97
|
+
Price: $0.00325 per request.
|
|
98
|
+
|
|
99
|
+
Example:
|
|
100
|
+
res = client.tripadvisor.reviews(limit=3, url="https://www.tripadvisor.com/Hotel_Review-g60763-d93450-Reviews-The_Plaza-New_York_City_New_York.html")
|
|
101
|
+
"""
|
|
102
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
103
|
+
"tripadvisor.reviews", dict(input), options
|
|
104
|
+
)
|
|
105
|
+
return RunResult[TripadvisorReviewsData].model_validate(raw)
|
|
106
|
+
|
|
107
|
+
def search(
|
|
108
|
+
self,
|
|
109
|
+
*,
|
|
110
|
+
options: RequestOptions | None = None,
|
|
111
|
+
**input: Unpack[TripadvisorSearchInput],
|
|
112
|
+
) -> RunResult[TripadvisorSearchData]:
|
|
113
|
+
"""Tripadvisor Search
|
|
114
|
+
|
|
115
|
+
Search Tripadvisor for hotels, restaurants, and attractions in any
|
|
116
|
+
destination and get rich place records (ratings, review counts, contact
|
|
117
|
+
details, pricing) as normalized JSON with transparent per-request USD
|
|
118
|
+
pricing.
|
|
119
|
+
|
|
120
|
+
Price: $0.00325 per request.
|
|
121
|
+
|
|
122
|
+
Example:
|
|
123
|
+
res = client.tripadvisor.search(limit=3, query="Paris")
|
|
124
|
+
"""
|
|
125
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
126
|
+
"tripadvisor.search", dict(input), options
|
|
127
|
+
)
|
|
128
|
+
return RunResult[TripadvisorSearchData].model_validate(raw)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class AsyncTripadvisorNamespace:
|
|
132
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
133
|
+
|
|
134
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
135
|
+
self._client = client
|
|
136
|
+
|
|
137
|
+
async def reviews(
|
|
138
|
+
self,
|
|
139
|
+
*,
|
|
140
|
+
options: RequestOptions | None = None,
|
|
141
|
+
**input: Unpack[TripadvisorReviewsInput],
|
|
142
|
+
) -> RunResult[TripadvisorReviewsData]:
|
|
143
|
+
"""Tripadvisor Reviews
|
|
144
|
+
|
|
145
|
+
Fetch the latest reviews for any Tripadvisor hotel, restaurant, or
|
|
146
|
+
attraction by its page URL - rating, text, date, and trip details as
|
|
147
|
+
normalized JSON with transparent per-request USD pricing.
|
|
148
|
+
|
|
149
|
+
Price: $0.00325 per request.
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
res = client.tripadvisor.reviews(limit=3, url="https://www.tripadvisor.com/Hotel_Review-g60763-d93450-Reviews-The_Plaza-New_York_City_New_York.html")
|
|
153
|
+
"""
|
|
154
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
155
|
+
"tripadvisor.reviews", dict(input), options
|
|
156
|
+
)
|
|
157
|
+
return RunResult[TripadvisorReviewsData].model_validate(raw)
|
|
158
|
+
|
|
159
|
+
async def search(
|
|
160
|
+
self,
|
|
161
|
+
*,
|
|
162
|
+
options: RequestOptions | None = None,
|
|
163
|
+
**input: Unpack[TripadvisorSearchInput],
|
|
164
|
+
) -> RunResult[TripadvisorSearchData]:
|
|
165
|
+
"""Tripadvisor Search
|
|
166
|
+
|
|
167
|
+
Search Tripadvisor for hotels, restaurants, and attractions in any
|
|
168
|
+
destination and get rich place records (ratings, review counts, contact
|
|
169
|
+
details, pricing) as normalized JSON with transparent per-request USD
|
|
170
|
+
pricing.
|
|
171
|
+
|
|
172
|
+
Price: $0.00325 per request.
|
|
173
|
+
|
|
174
|
+
Example:
|
|
175
|
+
res = client.tripadvisor.search(limit=3, query="Paris")
|
|
176
|
+
"""
|
|
177
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
178
|
+
"tripadvisor.search", dict(input), options
|
|
179
|
+
)
|
|
180
|
+
return RunResult[TripadvisorSearchData].model_validate(raw)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the trustpilot 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 TrustpilotReviewsInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Trustpilot Reviews."""
|
|
20
|
+
|
|
21
|
+
company: Required[str]
|
|
22
|
+
"""Brand name or Trustpilot review-page URL to fetch reviews for (e.g. nike or https://www.trustpilot.com/review/nike.com)."""
|
|
23
|
+
limit: NotRequired[int]
|
|
24
|
+
"""Maximum number of results to return (1-50, default 50). You are billed per result returned, so a lower limit costs less. Range: 1 to 50."""
|
|
25
|
+
sortBy: NotRequired[str]
|
|
26
|
+
"""Review ordering: auto, relevancy, or recent (e.g. recent). Default: auto."""
|
|
27
|
+
stars: NotRequired[str]
|
|
28
|
+
"""Limit reviews to a single star rating from 1 to 5 (e.g. 5); omit for all ratings."""
|
|
29
|
+
verifiedOnly: NotRequired[bool]
|
|
30
|
+
"""Set true to return only verified reviews (e.g. true). Default: false."""
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class TrustpilotReviewsData(BaseModel):
|
|
34
|
+
items: list[TrustpilotReviewsItem] = Field(
|
|
35
|
+
description="Review records: star rating, review title and text, date, reviewer name and country, and company reply when present."
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class TrustpilotReviewsItem(BaseModel):
|
|
40
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
41
|
+
|
|
42
|
+
published_at: str | None = Field(
|
|
43
|
+
default=None,
|
|
44
|
+
alias="publishedAt",
|
|
45
|
+
description="Publish date (ISO 8601). Present whenever the upstream returns this record.",
|
|
46
|
+
)
|
|
47
|
+
rating: float = Field(description="Star rating (1-5).")
|
|
48
|
+
text: str = Field(description="Review body text.")
|
|
49
|
+
title: str | None = Field(
|
|
50
|
+
default=None, description="Present whenever the upstream returns this record."
|
|
51
|
+
)
|
|
52
|
+
url: str | None = Field(
|
|
53
|
+
default=None,
|
|
54
|
+
description="Canonical review URL. Present whenever the upstream returns this record.",
|
|
55
|
+
)
|
|
56
|
+
verified: bool | None = Field(
|
|
57
|
+
default=None, description="Whether the reviewer is verified."
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class TrustpilotNamespace:
|
|
62
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
63
|
+
|
|
64
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
65
|
+
self._client = client
|
|
66
|
+
|
|
67
|
+
def reviews(
|
|
68
|
+
self,
|
|
69
|
+
*,
|
|
70
|
+
options: RequestOptions | None = None,
|
|
71
|
+
**input: Unpack[TrustpilotReviewsInput],
|
|
72
|
+
) -> RunResult[TrustpilotReviewsData]:
|
|
73
|
+
"""Trustpilot Reviews
|
|
74
|
+
|
|
75
|
+
Pull Trustpilot reviews for any company by brand name - star ratings, review
|
|
76
|
+
text, dates, and reviewer details as clean JSON, billed per request in USD.
|
|
77
|
+
|
|
78
|
+
Price: $0.01625 per request.
|
|
79
|
+
|
|
80
|
+
Example:
|
|
81
|
+
res = client.trustpilot.reviews(company="stripe.com", limit=3)
|
|
82
|
+
"""
|
|
83
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
84
|
+
"trustpilot.reviews", dict(input), options
|
|
85
|
+
)
|
|
86
|
+
return RunResult[TrustpilotReviewsData].model_validate(raw)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class AsyncTrustpilotNamespace:
|
|
90
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
91
|
+
|
|
92
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
93
|
+
self._client = client
|
|
94
|
+
|
|
95
|
+
async def reviews(
|
|
96
|
+
self,
|
|
97
|
+
*,
|
|
98
|
+
options: RequestOptions | None = None,
|
|
99
|
+
**input: Unpack[TrustpilotReviewsInput],
|
|
100
|
+
) -> RunResult[TrustpilotReviewsData]:
|
|
101
|
+
"""Trustpilot Reviews
|
|
102
|
+
|
|
103
|
+
Pull Trustpilot reviews for any company by brand name - star ratings, review
|
|
104
|
+
text, dates, and reviewer details as clean JSON, billed per request in USD.
|
|
105
|
+
|
|
106
|
+
Price: $0.01625 per request.
|
|
107
|
+
|
|
108
|
+
Example:
|
|
109
|
+
res = client.trustpilot.reviews(company="stripe.com", limit=3)
|
|
110
|
+
"""
|
|
111
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
112
|
+
"trustpilot.reviews", dict(input), options
|
|
113
|
+
)
|
|
114
|
+
return RunResult[TrustpilotReviewsData].model_validate(raw)
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the truthsocial 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 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 TruthsocialPostInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Truth Social Post."""
|
|
20
|
+
|
|
21
|
+
url: Required[str]
|
|
22
|
+
"""Full Truth Social post URL, e.g. "https://truthsocial.com/@realDonaldTrump/posts/116824551176646175"."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class TruthsocialProfileInput(TypedDict, total=False):
|
|
26
|
+
"""Input for Truth Social Profile."""
|
|
27
|
+
|
|
28
|
+
handle: Required[str]
|
|
29
|
+
"""Truth Social handle without the @, e.g. "realDonaldTrump"."""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TruthsocialUserPostsInput(TypedDict, total=False):
|
|
33
|
+
"""Input for Truth Social User Posts."""
|
|
34
|
+
|
|
35
|
+
handle: Required[str]
|
|
36
|
+
"""Truth Social handle without the @, e.g. "realDonaldTrump"."""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class TruthsocialPostData(BaseModel):
|
|
40
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
41
|
+
|
|
42
|
+
comments: int
|
|
43
|
+
display_name: str = Field(alias="displayName")
|
|
44
|
+
id: str
|
|
45
|
+
likes: int
|
|
46
|
+
published_at: str = Field(alias="publishedAt")
|
|
47
|
+
shares: int
|
|
48
|
+
text: str
|
|
49
|
+
username: str
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class TruthsocialProfileData(BaseModel):
|
|
53
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
54
|
+
|
|
55
|
+
avatar_url: str = Field(alias="avatarUrl")
|
|
56
|
+
bio: str
|
|
57
|
+
display_name: str = Field(alias="displayName")
|
|
58
|
+
followers: int
|
|
59
|
+
following: int
|
|
60
|
+
id: str
|
|
61
|
+
joined_at: str = Field(alias="joinedAt")
|
|
62
|
+
posts_count: int = Field(alias="postsCount")
|
|
63
|
+
private: bool
|
|
64
|
+
url: str
|
|
65
|
+
username: str
|
|
66
|
+
verified: bool
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class TruthsocialUserPostsData(BaseModel):
|
|
70
|
+
posts: list[TruthsocialUserPostsPost]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class TruthsocialUserPostsPost(BaseModel):
|
|
74
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
75
|
+
|
|
76
|
+
comments: int
|
|
77
|
+
id: str
|
|
78
|
+
likes: int
|
|
79
|
+
published_at: str = Field(alias="publishedAt")
|
|
80
|
+
shares: int
|
|
81
|
+
text: str
|
|
82
|
+
url: str
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class TruthsocialNamespace:
|
|
86
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
87
|
+
|
|
88
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
89
|
+
self._client = client
|
|
90
|
+
|
|
91
|
+
def post(
|
|
92
|
+
self,
|
|
93
|
+
*,
|
|
94
|
+
options: RequestOptions | None = None,
|
|
95
|
+
**input: Unpack[TruthsocialPostInput],
|
|
96
|
+
) -> RunResult[TruthsocialPostData]:
|
|
97
|
+
"""Truth Social Post
|
|
98
|
+
|
|
99
|
+
Get a single Truth Social post by its URL - text, author, engagement (likes,
|
|
100
|
+
comments, shares), and timestamp as clean JSON, billed per request in USD.
|
|
101
|
+
|
|
102
|
+
Price: $0.00325 per request.
|
|
103
|
+
|
|
104
|
+
Example:
|
|
105
|
+
res = client.truthsocial.post(url="https://truthsocial.com/@realDonaldTrump/posts/116824551176646175")
|
|
106
|
+
"""
|
|
107
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
108
|
+
"truthsocial.post", dict(input), options
|
|
109
|
+
)
|
|
110
|
+
return RunResult[TruthsocialPostData].model_validate(raw)
|
|
111
|
+
|
|
112
|
+
def profile(
|
|
113
|
+
self,
|
|
114
|
+
*,
|
|
115
|
+
options: RequestOptions | None = None,
|
|
116
|
+
**input: Unpack[TruthsocialProfileInput],
|
|
117
|
+
) -> RunResult[TruthsocialProfileData]:
|
|
118
|
+
"""Truth Social Profile
|
|
119
|
+
|
|
120
|
+
Get a Truth Social account's public profile by handle - display name, bio,
|
|
121
|
+
follower/following counts, and post count as clean JSON, billed per request
|
|
122
|
+
in USD.
|
|
123
|
+
|
|
124
|
+
Price: $0.00325 per request.
|
|
125
|
+
|
|
126
|
+
Example:
|
|
127
|
+
res = client.truthsocial.profile(handle="realDonaldTrump")
|
|
128
|
+
"""
|
|
129
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
130
|
+
"truthsocial.profile", dict(input), options
|
|
131
|
+
)
|
|
132
|
+
return RunResult[TruthsocialProfileData].model_validate(raw)
|
|
133
|
+
|
|
134
|
+
def user_posts(
|
|
135
|
+
self,
|
|
136
|
+
*,
|
|
137
|
+
options: RequestOptions | None = None,
|
|
138
|
+
**input: Unpack[TruthsocialUserPostsInput],
|
|
139
|
+
) -> RunResult[TruthsocialUserPostsData]:
|
|
140
|
+
"""Truth Social User Posts
|
|
141
|
+
|
|
142
|
+
List a Truth Social account's recent posts by handle - text, engagement
|
|
143
|
+
(likes, comments, shares), and timestamps as clean JSON, billed per request
|
|
144
|
+
in USD.
|
|
145
|
+
|
|
146
|
+
Price: $0.00325 per request.
|
|
147
|
+
|
|
148
|
+
Example:
|
|
149
|
+
res = client.truthsocial.user_posts(handle="realDonaldTrump")
|
|
150
|
+
"""
|
|
151
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
152
|
+
"truthsocial.user_posts", dict(input), options
|
|
153
|
+
)
|
|
154
|
+
return RunResult[TruthsocialUserPostsData].model_validate(raw)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class AsyncTruthsocialNamespace:
|
|
158
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
159
|
+
|
|
160
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
161
|
+
self._client = client
|
|
162
|
+
|
|
163
|
+
async def post(
|
|
164
|
+
self,
|
|
165
|
+
*,
|
|
166
|
+
options: RequestOptions | None = None,
|
|
167
|
+
**input: Unpack[TruthsocialPostInput],
|
|
168
|
+
) -> RunResult[TruthsocialPostData]:
|
|
169
|
+
"""Truth Social Post
|
|
170
|
+
|
|
171
|
+
Get a single Truth Social post by its URL - text, author, engagement (likes,
|
|
172
|
+
comments, shares), and timestamp as clean JSON, billed per request in USD.
|
|
173
|
+
|
|
174
|
+
Price: $0.00325 per request.
|
|
175
|
+
|
|
176
|
+
Example:
|
|
177
|
+
res = client.truthsocial.post(url="https://truthsocial.com/@realDonaldTrump/posts/116824551176646175")
|
|
178
|
+
"""
|
|
179
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
180
|
+
"truthsocial.post", dict(input), options
|
|
181
|
+
)
|
|
182
|
+
return RunResult[TruthsocialPostData].model_validate(raw)
|
|
183
|
+
|
|
184
|
+
async def profile(
|
|
185
|
+
self,
|
|
186
|
+
*,
|
|
187
|
+
options: RequestOptions | None = None,
|
|
188
|
+
**input: Unpack[TruthsocialProfileInput],
|
|
189
|
+
) -> RunResult[TruthsocialProfileData]:
|
|
190
|
+
"""Truth Social Profile
|
|
191
|
+
|
|
192
|
+
Get a Truth Social account's public profile by handle - display name, bio,
|
|
193
|
+
follower/following counts, and post count as clean JSON, billed per request
|
|
194
|
+
in USD.
|
|
195
|
+
|
|
196
|
+
Price: $0.00325 per request.
|
|
197
|
+
|
|
198
|
+
Example:
|
|
199
|
+
res = client.truthsocial.profile(handle="realDonaldTrump")
|
|
200
|
+
"""
|
|
201
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
202
|
+
"truthsocial.profile", dict(input), options
|
|
203
|
+
)
|
|
204
|
+
return RunResult[TruthsocialProfileData].model_validate(raw)
|
|
205
|
+
|
|
206
|
+
async def user_posts(
|
|
207
|
+
self,
|
|
208
|
+
*,
|
|
209
|
+
options: RequestOptions | None = None,
|
|
210
|
+
**input: Unpack[TruthsocialUserPostsInput],
|
|
211
|
+
) -> RunResult[TruthsocialUserPostsData]:
|
|
212
|
+
"""Truth Social User Posts
|
|
213
|
+
|
|
214
|
+
List a Truth Social account's recent posts by handle - text, engagement
|
|
215
|
+
(likes, comments, shares), and timestamps as clean JSON, billed per request
|
|
216
|
+
in USD.
|
|
217
|
+
|
|
218
|
+
Price: $0.00325 per request.
|
|
219
|
+
|
|
220
|
+
Example:
|
|
221
|
+
res = client.truthsocial.user_posts(handle="realDonaldTrump")
|
|
222
|
+
"""
|
|
223
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
224
|
+
"truthsocial.user_posts", dict(input), options
|
|
225
|
+
)
|
|
226
|
+
return RunResult[TruthsocialUserPostsData].model_validate(raw)
|