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,412 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the maps 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
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from .._async_client import AsyncAnyAPI
|
|
15
|
+
from .._client import AnyAPI
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class MapsContactsInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Google Maps Contacts."""
|
|
20
|
+
|
|
21
|
+
language: NotRequired[str]
|
|
22
|
+
"""Two-letter language code for the results (e.g. en). Default: en."""
|
|
23
|
+
limit: NotRequired[int]
|
|
24
|
+
"""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."""
|
|
25
|
+
location: Required[str]
|
|
26
|
+
"""Free-text location to search in, ideally city plus country (e.g. Denver, USA)."""
|
|
27
|
+
query: Required[str]
|
|
28
|
+
"""What you would type in the Google Maps search bar (e.g. dentist)."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class MapsPlaceInput(TypedDict, total=False):
|
|
32
|
+
"""Input for Google Maps Place Lookup."""
|
|
33
|
+
|
|
34
|
+
language: NotRequired[str]
|
|
35
|
+
"""Two-letter language code for the result details (e.g. en). Default: en."""
|
|
36
|
+
location: NotRequired[str]
|
|
37
|
+
"""Optional free-text location to scope the search, ideally city plus state or country (e.g. San Francisco, CA). Narrows the query to the best match in that area."""
|
|
38
|
+
query: Required[str]
|
|
39
|
+
"""The business name or search text to look up, as you would type it into the Google Maps search bar (e.g. Blue Bottle Coffee)."""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class MapsReviewsInput(TypedDict, total=False):
|
|
43
|
+
"""Input for Google Maps Reviews."""
|
|
44
|
+
|
|
45
|
+
language: NotRequired[str]
|
|
46
|
+
"""Two-letter language code for the review details (e.g. en). Default: en."""
|
|
47
|
+
limit: NotRequired[int]
|
|
48
|
+
"""Maximum number of results to return (1-100, default 100). You are billed per result returned, so a lower limit costs less. Range: 1 to 100."""
|
|
49
|
+
placeId: Required[str]
|
|
50
|
+
"""The Google Maps place ID to fetch reviews for (e.g. ChIJj61dQgK6j4AR4GeTYWZsKWw)."""
|
|
51
|
+
sort: NotRequired[
|
|
52
|
+
Literal["newest", "mostRelevant", "highestRanking", "lowestRanking"]
|
|
53
|
+
]
|
|
54
|
+
"""Order in which reviews are returned (e.g. newest). Default: newest."""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class MapsSearchInput(TypedDict, total=False):
|
|
58
|
+
"""Input for Google Maps Search."""
|
|
59
|
+
|
|
60
|
+
language: NotRequired[str]
|
|
61
|
+
"""Two-letter language code for the results (e.g. en). Default: en."""
|
|
62
|
+
limit: NotRequired[int]
|
|
63
|
+
"""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."""
|
|
64
|
+
location: Required[str]
|
|
65
|
+
"""Free-text location to search in, ideally city plus country (e.g. Austin, USA)."""
|
|
66
|
+
query: Required[str]
|
|
67
|
+
"""What you would type in the Google Maps search bar (e.g. coffee shop)."""
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class MapsContactsData(BaseModel):
|
|
71
|
+
items: list[MapsContactsItem] = Field(
|
|
72
|
+
description="Business records: name, address, rating, plus enriched contact details such as emails, phone numbers, and social profiles."
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class MapsContactsItem(BaseModel):
|
|
77
|
+
model_config = ConfigDict(extra="allow")
|
|
78
|
+
|
|
79
|
+
name: str
|
|
80
|
+
url: str
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class MapsPlaceData(BaseModel):
|
|
84
|
+
items: list[MapsPlaceItem] = Field(
|
|
85
|
+
description="The best-matching place for the query, with full details: name, address, contact info, category, rating, opening hours, and coordinates. Up to one element (empty when nothing matched)."
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class MapsPlaceItem(BaseModel):
|
|
90
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
91
|
+
|
|
92
|
+
address: str | None = Field(
|
|
93
|
+
default=None,
|
|
94
|
+
description="Full formatted street address. Present whenever the upstream returns this record.",
|
|
95
|
+
)
|
|
96
|
+
category: str | None = Field(
|
|
97
|
+
default=None,
|
|
98
|
+
description="Primary Google Maps category (e.g. Coffee shop). Present whenever the upstream returns this record.",
|
|
99
|
+
)
|
|
100
|
+
city: str | None = None
|
|
101
|
+
country_code: str | None = Field(
|
|
102
|
+
default=None, alias="countryCode", description="Two-letter country code."
|
|
103
|
+
)
|
|
104
|
+
hours: list[MapsPlaceHour] | None = Field(
|
|
105
|
+
default=None,
|
|
106
|
+
description="Opening hours by day: each element is an object with the day name and its hours.",
|
|
107
|
+
)
|
|
108
|
+
image: str | None = Field(
|
|
109
|
+
default=None, description="URL of the primary place photo."
|
|
110
|
+
)
|
|
111
|
+
latitude: float | None = Field(
|
|
112
|
+
default=None, description="Present whenever the upstream returns this record."
|
|
113
|
+
)
|
|
114
|
+
longitude: float | None = Field(
|
|
115
|
+
default=None, description="Present whenever the upstream returns this record."
|
|
116
|
+
)
|
|
117
|
+
name: str = Field(description="Business or place name.")
|
|
118
|
+
neighborhood: str | None = None
|
|
119
|
+
permanently_closed: bool | None = Field(
|
|
120
|
+
default=None,
|
|
121
|
+
alias="permanentlyClosed",
|
|
122
|
+
description="Whether the place is permanently closed.",
|
|
123
|
+
)
|
|
124
|
+
phone: str | None = Field(default=None, description="Formatted phone number.")
|
|
125
|
+
place_id: str | None = Field(
|
|
126
|
+
default=None,
|
|
127
|
+
alias="placeId",
|
|
128
|
+
description="Google Maps place id. Present whenever the upstream returns this record.",
|
|
129
|
+
)
|
|
130
|
+
plus_code: str | None = Field(
|
|
131
|
+
default=None, alias="plusCode", description="Google Plus Code for the location."
|
|
132
|
+
)
|
|
133
|
+
postal_code: str | None = Field(default=None, alias="postalCode")
|
|
134
|
+
price_level: str | None = Field(
|
|
135
|
+
default=None,
|
|
136
|
+
alias="priceLevel",
|
|
137
|
+
description="Price level indicator (e.g. a price range).",
|
|
138
|
+
)
|
|
139
|
+
rating: float | None = Field(default=None, description="Average star rating.")
|
|
140
|
+
reviews_count: int | None = Field(
|
|
141
|
+
default=None, alias="reviewsCount", description="Total number of reviews."
|
|
142
|
+
)
|
|
143
|
+
state: str | None = Field(default=None, description="State or region name.")
|
|
144
|
+
street: str | None = Field(
|
|
145
|
+
default=None, description="Street portion of the address."
|
|
146
|
+
)
|
|
147
|
+
url: str = Field(description="Google Maps URL for the place.")
|
|
148
|
+
website: str | None = Field(default=None, description="Business website URL.")
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class MapsPlaceHour(BaseModel):
|
|
152
|
+
model_config = ConfigDict(extra="allow")
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
class MapsReviewsData(BaseModel):
|
|
156
|
+
items: list[MapsReviewsItem] = Field(
|
|
157
|
+
description="Review records: reviewer, star rating, review text (empty when the reviewer left only a rating), publish date, likes, and owner response where present."
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class MapsReviewsItem(BaseModel):
|
|
162
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
163
|
+
|
|
164
|
+
author: str | None = Field(
|
|
165
|
+
default=None,
|
|
166
|
+
description="Reviewer display name. Present whenever the upstream returns this record.",
|
|
167
|
+
)
|
|
168
|
+
is_local_guide: bool | None = Field(
|
|
169
|
+
default=None,
|
|
170
|
+
alias="isLocalGuide",
|
|
171
|
+
description="Whether the reviewer is a Google Local Guide.",
|
|
172
|
+
)
|
|
173
|
+
likes: int | None = Field(
|
|
174
|
+
default=None, description="Number of likes on the review."
|
|
175
|
+
)
|
|
176
|
+
origin: str | None = Field(
|
|
177
|
+
default=None, description="Source of the review (e.g. Google)."
|
|
178
|
+
)
|
|
179
|
+
owner_response: str | None = Field(
|
|
180
|
+
default=None,
|
|
181
|
+
alias="ownerResponse",
|
|
182
|
+
description="Owner's reply text; empty when there is none.",
|
|
183
|
+
)
|
|
184
|
+
owner_response_at: str | None = Field(
|
|
185
|
+
default=None,
|
|
186
|
+
alias="ownerResponseAt",
|
|
187
|
+
description="ISO 8601 timestamp of the owner's reply; empty when there is none.",
|
|
188
|
+
)
|
|
189
|
+
place_id: str | None = Field(
|
|
190
|
+
default=None,
|
|
191
|
+
alias="placeId",
|
|
192
|
+
description="Google Maps place id the review belongs to. Present whenever the upstream returns this record.",
|
|
193
|
+
)
|
|
194
|
+
published_ago: str | None = Field(
|
|
195
|
+
default=None,
|
|
196
|
+
alias="publishedAgo",
|
|
197
|
+
description="Human-relative publish time (e.g. '7 hours ago').",
|
|
198
|
+
)
|
|
199
|
+
published_at: str | None = Field(
|
|
200
|
+
default=None,
|
|
201
|
+
alias="publishedAt",
|
|
202
|
+
description="ISO 8601 timestamp the review was published. Present whenever the upstream returns this record.",
|
|
203
|
+
)
|
|
204
|
+
rating: float | None = Field(
|
|
205
|
+
default=None, description="Star rating the reviewer gave (1-5)."
|
|
206
|
+
)
|
|
207
|
+
review_id: str = Field(alias="reviewId", description="Stable Google review id.")
|
|
208
|
+
reviewer_id: str | None = Field(default=None, alias="reviewerId")
|
|
209
|
+
reviewer_reviews_count: int | None = Field(
|
|
210
|
+
default=None,
|
|
211
|
+
alias="reviewerReviewsCount",
|
|
212
|
+
description="Total number of reviews the reviewer has written.",
|
|
213
|
+
)
|
|
214
|
+
text: str | None = Field(
|
|
215
|
+
default=None,
|
|
216
|
+
description="Review text; empty string when the reviewer left only a star rating.",
|
|
217
|
+
)
|
|
218
|
+
url: str | None = Field(
|
|
219
|
+
default=None,
|
|
220
|
+
description="Direct URL to the review on Google Maps. Present whenever the upstream returns this record.",
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class MapsSearchData(BaseModel):
|
|
225
|
+
items: list[MapsSearchItem] = Field(
|
|
226
|
+
description="Place records: name, category, address, coordinates, rating, review count, and contact basics."
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
class MapsSearchItem(BaseModel):
|
|
231
|
+
model_config = ConfigDict(extra="allow")
|
|
232
|
+
|
|
233
|
+
name: str
|
|
234
|
+
url: str
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class MapsNamespace:
|
|
238
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
239
|
+
|
|
240
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
241
|
+
self._client = client
|
|
242
|
+
|
|
243
|
+
def contacts(
|
|
244
|
+
self,
|
|
245
|
+
*,
|
|
246
|
+
options: RequestOptions | None = None,
|
|
247
|
+
**input: Unpack[MapsContactsInput],
|
|
248
|
+
) -> RunResult[MapsContactsData]:
|
|
249
|
+
"""Google Maps Contacts
|
|
250
|
+
|
|
251
|
+
Search Google Maps for businesses and enrich each result with contact
|
|
252
|
+
details - emails, phones, and social profiles from their websites - up to 20
|
|
253
|
+
records per request.
|
|
254
|
+
|
|
255
|
+
Price: $0.00005 per request plus $0.003 per result.
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
res = client.maps.contacts(limit=3, location="Austin, TX", query="coffee shop")
|
|
259
|
+
"""
|
|
260
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
261
|
+
"maps.contacts", dict(input), options
|
|
262
|
+
)
|
|
263
|
+
return RunResult[MapsContactsData].model_validate(raw)
|
|
264
|
+
|
|
265
|
+
def place(
|
|
266
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[MapsPlaceInput]
|
|
267
|
+
) -> RunResult[MapsPlaceData]:
|
|
268
|
+
"""Google Maps Place Lookup
|
|
269
|
+
|
|
270
|
+
Look up a place on Google Maps by name or search query (optionally scoped to
|
|
271
|
+
a location) and get the best-matching place with full details - address,
|
|
272
|
+
phone, website, rating, hours, and coordinates - as normalized JSON priced
|
|
273
|
+
per request in USD.
|
|
274
|
+
|
|
275
|
+
Price: $0.003 per request plus $0.005 per result.
|
|
276
|
+
|
|
277
|
+
Example:
|
|
278
|
+
res = client.maps.place(location="San Francisco, CA", query="Blue Bottle Coffee")
|
|
279
|
+
"""
|
|
280
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
281
|
+
"maps.place", dict(input), options
|
|
282
|
+
)
|
|
283
|
+
return RunResult[MapsPlaceData].model_validate(raw)
|
|
284
|
+
|
|
285
|
+
def reviews(
|
|
286
|
+
self,
|
|
287
|
+
*,
|
|
288
|
+
options: RequestOptions | None = None,
|
|
289
|
+
**input: Unpack[MapsReviewsInput],
|
|
290
|
+
) -> RunResult[MapsReviewsData]:
|
|
291
|
+
"""Google Maps Reviews
|
|
292
|
+
|
|
293
|
+
Fetch up to 100 Google Maps reviews for a place by place ID, sorted the way
|
|
294
|
+
you need, in one flat-priced normalized response.
|
|
295
|
+
|
|
296
|
+
Price: $0.00005 per request plus $0.0004 per result.
|
|
297
|
+
|
|
298
|
+
Example:
|
|
299
|
+
res = client.maps.reviews(limit=3, placeId="ChIJN1t_tDeuEmsRUsoyG83frY4")
|
|
300
|
+
"""
|
|
301
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
302
|
+
"maps.reviews", dict(input), options
|
|
303
|
+
)
|
|
304
|
+
return RunResult[MapsReviewsData].model_validate(raw)
|
|
305
|
+
|
|
306
|
+
def search(
|
|
307
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[MapsSearchInput]
|
|
308
|
+
) -> RunResult[MapsSearchData]:
|
|
309
|
+
"""Google Maps Search
|
|
310
|
+
|
|
311
|
+
Search Google Maps for places matching a query and location - up to 20
|
|
312
|
+
normalized place records with ratings, addresses, and contact basics per
|
|
313
|
+
request.
|
|
314
|
+
|
|
315
|
+
Price: $0.00005 per request plus $0.003 per result.
|
|
316
|
+
|
|
317
|
+
Example:
|
|
318
|
+
res = client.maps.search(limit=3, location="Austin, TX", query="coffee")
|
|
319
|
+
"""
|
|
320
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
321
|
+
"maps.search", dict(input), options
|
|
322
|
+
)
|
|
323
|
+
return RunResult[MapsSearchData].model_validate(raw)
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
class AsyncMapsNamespace:
|
|
327
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
328
|
+
|
|
329
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
330
|
+
self._client = client
|
|
331
|
+
|
|
332
|
+
async def contacts(
|
|
333
|
+
self,
|
|
334
|
+
*,
|
|
335
|
+
options: RequestOptions | None = None,
|
|
336
|
+
**input: Unpack[MapsContactsInput],
|
|
337
|
+
) -> RunResult[MapsContactsData]:
|
|
338
|
+
"""Google Maps Contacts
|
|
339
|
+
|
|
340
|
+
Search Google Maps for businesses and enrich each result with contact
|
|
341
|
+
details - emails, phones, and social profiles from their websites - up to 20
|
|
342
|
+
records per request.
|
|
343
|
+
|
|
344
|
+
Price: $0.00005 per request plus $0.003 per result.
|
|
345
|
+
|
|
346
|
+
Example:
|
|
347
|
+
res = client.maps.contacts(limit=3, location="Austin, TX", query="coffee shop")
|
|
348
|
+
"""
|
|
349
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
350
|
+
"maps.contacts", dict(input), options
|
|
351
|
+
)
|
|
352
|
+
return RunResult[MapsContactsData].model_validate(raw)
|
|
353
|
+
|
|
354
|
+
async def place(
|
|
355
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[MapsPlaceInput]
|
|
356
|
+
) -> RunResult[MapsPlaceData]:
|
|
357
|
+
"""Google Maps Place Lookup
|
|
358
|
+
|
|
359
|
+
Look up a place on Google Maps by name or search query (optionally scoped to
|
|
360
|
+
a location) and get the best-matching place with full details - address,
|
|
361
|
+
phone, website, rating, hours, and coordinates - as normalized JSON priced
|
|
362
|
+
per request in USD.
|
|
363
|
+
|
|
364
|
+
Price: $0.003 per request plus $0.005 per result.
|
|
365
|
+
|
|
366
|
+
Example:
|
|
367
|
+
res = client.maps.place(location="San Francisco, CA", query="Blue Bottle Coffee")
|
|
368
|
+
"""
|
|
369
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
370
|
+
"maps.place", dict(input), options
|
|
371
|
+
)
|
|
372
|
+
return RunResult[MapsPlaceData].model_validate(raw)
|
|
373
|
+
|
|
374
|
+
async def reviews(
|
|
375
|
+
self,
|
|
376
|
+
*,
|
|
377
|
+
options: RequestOptions | None = None,
|
|
378
|
+
**input: Unpack[MapsReviewsInput],
|
|
379
|
+
) -> RunResult[MapsReviewsData]:
|
|
380
|
+
"""Google Maps Reviews
|
|
381
|
+
|
|
382
|
+
Fetch up to 100 Google Maps reviews for a place by place ID, sorted the way
|
|
383
|
+
you need, in one flat-priced normalized response.
|
|
384
|
+
|
|
385
|
+
Price: $0.00005 per request plus $0.0004 per result.
|
|
386
|
+
|
|
387
|
+
Example:
|
|
388
|
+
res = client.maps.reviews(limit=3, placeId="ChIJN1t_tDeuEmsRUsoyG83frY4")
|
|
389
|
+
"""
|
|
390
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
391
|
+
"maps.reviews", dict(input), options
|
|
392
|
+
)
|
|
393
|
+
return RunResult[MapsReviewsData].model_validate(raw)
|
|
394
|
+
|
|
395
|
+
async def search(
|
|
396
|
+
self, *, options: RequestOptions | None = None, **input: Unpack[MapsSearchInput]
|
|
397
|
+
) -> RunResult[MapsSearchData]:
|
|
398
|
+
"""Google Maps Search
|
|
399
|
+
|
|
400
|
+
Search Google Maps for places matching a query and location - up to 20
|
|
401
|
+
normalized place records with ratings, addresses, and contact basics per
|
|
402
|
+
request.
|
|
403
|
+
|
|
404
|
+
Price: $0.00005 per request plus $0.003 per result.
|
|
405
|
+
|
|
406
|
+
Example:
|
|
407
|
+
res = client.maps.search(limit=3, location="Austin, TX", query="coffee")
|
|
408
|
+
"""
|
|
409
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
410
|
+
"maps.search", dict(input), options
|
|
411
|
+
)
|
|
412
|
+
return RunResult[MapsSearchData].model_validate(raw)
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
# Generated - do not edit. Regenerate with: pnpm generate
|
|
2
|
+
"""Generated namespace module for the pandaexpress 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 PandaexpressLocationsInput(TypedDict, total=False):
|
|
19
|
+
"""Input for Panda Express Locations."""
|
|
20
|
+
|
|
21
|
+
latitude: Required[float]
|
|
22
|
+
"""Latitude of the search center. Range: -90 to 90."""
|
|
23
|
+
limit: NotRequired[int]
|
|
24
|
+
"""Maximum number of restaurants to return (1-50, default 10). Range: 1 to 50."""
|
|
25
|
+
longitude: Required[float]
|
|
26
|
+
"""Longitude of the search center. Range: -180 to 180."""
|
|
27
|
+
radius: NotRequired[int]
|
|
28
|
+
"""Search radius in miles (default 10). Range: 1 to 100."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class PandaexpressMenuInput(TypedDict, total=False):
|
|
32
|
+
"""Input for Panda Express Menu."""
|
|
33
|
+
|
|
34
|
+
restaurantId: Required[str]
|
|
35
|
+
"""Panda Express restaurant id (the `id` from Panda Express Locations)."""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class PandaexpressNutritionInput(TypedDict, total=False):
|
|
39
|
+
"""Input for Panda Express Nutrition."""
|
|
40
|
+
|
|
41
|
+
query: Required[str]
|
|
42
|
+
"""Menu item name (or substring) to look up, e.g. "orange chicken" or "chow mein"."""
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class PandaexpressLocationsData(BaseModel):
|
|
46
|
+
restaurants: list[PandaexpressLocationsRestaurant] = Field(
|
|
47
|
+
description="Nearby Panda Express restaurants, nearest first."
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class PandaexpressLocationsRestaurant(BaseModel):
|
|
52
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
53
|
+
|
|
54
|
+
address: str
|
|
55
|
+
can_deliver: bool = Field(alias="canDeliver")
|
|
56
|
+
can_pickup: bool = Field(alias="canPickup")
|
|
57
|
+
city: str
|
|
58
|
+
distance_miles: float = Field(alias="distanceMiles")
|
|
59
|
+
id: int
|
|
60
|
+
is_open: bool = Field(alias="isOpen")
|
|
61
|
+
latitude: float
|
|
62
|
+
longitude: float
|
|
63
|
+
name: str
|
|
64
|
+
phone: str
|
|
65
|
+
state: str
|
|
66
|
+
zip: str
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class PandaexpressMenuData(BaseModel):
|
|
70
|
+
categories: list[PandaexpressMenuCategorie] = Field(
|
|
71
|
+
description="Menu categories in display order."
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
class PandaexpressMenuCategorie(BaseModel):
|
|
76
|
+
model_config = ConfigDict(extra="allow")
|
|
77
|
+
|
|
78
|
+
items: list[PandaexpressMenuItem]
|
|
79
|
+
name: str
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class PandaexpressMenuItem(BaseModel):
|
|
83
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
84
|
+
|
|
85
|
+
calories: int = Field(
|
|
86
|
+
description="Base calories when published by the restaurant, else 0."
|
|
87
|
+
)
|
|
88
|
+
description: str
|
|
89
|
+
name: str
|
|
90
|
+
price_usd: float = Field(
|
|
91
|
+
alias="priceUsd",
|
|
92
|
+
description="Item price in USD (0 for items priced only via size/option selection).",
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class PandaexpressNutritionData(BaseModel):
|
|
97
|
+
items: list[PandaexpressNutritionItem] = Field(
|
|
98
|
+
description="Matching menu items with official nutrition facts."
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class PandaexpressNutritionItem(BaseModel):
|
|
103
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
104
|
+
|
|
105
|
+
calories: float
|
|
106
|
+
cholesterol_mg: float = Field(alias="cholesterolMg")
|
|
107
|
+
dietary_fiber_g: float = Field(alias="dietaryFiberG")
|
|
108
|
+
name: str
|
|
109
|
+
protein_g: float = Field(alias="proteinG")
|
|
110
|
+
saturated_fat_g: float = Field(alias="saturatedFatG")
|
|
111
|
+
serving_size_oz: float = Field(alias="servingSizeOz")
|
|
112
|
+
sodium_mg: float = Field(alias="sodiumMg")
|
|
113
|
+
sugars_g: float = Field(alias="sugarsG")
|
|
114
|
+
total_carb_g: float = Field(alias="totalCarbG")
|
|
115
|
+
total_fat_g: float = Field(alias="totalFatG")
|
|
116
|
+
trans_fat_g: float = Field(alias="transFatG")
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
class PandaexpressNamespace:
|
|
120
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
121
|
+
|
|
122
|
+
def __init__(self, client: "AnyAPI") -> None:
|
|
123
|
+
self._client = client
|
|
124
|
+
|
|
125
|
+
def locations(
|
|
126
|
+
self,
|
|
127
|
+
*,
|
|
128
|
+
options: RequestOptions | None = None,
|
|
129
|
+
**input: Unpack[PandaexpressLocationsInput],
|
|
130
|
+
) -> RunResult[PandaexpressLocationsData]:
|
|
131
|
+
"""Panda Express Locations
|
|
132
|
+
|
|
133
|
+
Find Panda Express restaurants near a latitude/longitude, sorted by
|
|
134
|
+
distance, with address, phone, hours availability, and pickup/delivery
|
|
135
|
+
support. One call, billed per request in real dollars.
|
|
136
|
+
|
|
137
|
+
Price: $0.0009 per request.
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
res = client.pandaexpress.locations(latitude=34.0522, limit=5, longitude=-118.2437)
|
|
141
|
+
"""
|
|
142
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
143
|
+
"pandaexpress.locations", dict(input), options
|
|
144
|
+
)
|
|
145
|
+
return RunResult[PandaexpressLocationsData].model_validate(raw)
|
|
146
|
+
|
|
147
|
+
def menu(
|
|
148
|
+
self,
|
|
149
|
+
*,
|
|
150
|
+
options: RequestOptions | None = None,
|
|
151
|
+
**input: Unpack[PandaexpressMenuInput],
|
|
152
|
+
) -> RunResult[PandaexpressMenuData]:
|
|
153
|
+
"""Panda Express Menu
|
|
154
|
+
|
|
155
|
+
Get the live menu for a Panda Express restaurant by id: categories with item
|
|
156
|
+
names, descriptions, and USD prices. Pair with Panda Express Locations to
|
|
157
|
+
resolve a restaurant id. One call, billed per request in real dollars.
|
|
158
|
+
|
|
159
|
+
Price: $0.0009 per request.
|
|
160
|
+
|
|
161
|
+
Example:
|
|
162
|
+
res = client.pandaexpress.menu(restaurantId="112551")
|
|
163
|
+
"""
|
|
164
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
165
|
+
"pandaexpress.menu", dict(input), options
|
|
166
|
+
)
|
|
167
|
+
return RunResult[PandaexpressMenuData].model_validate(raw)
|
|
168
|
+
|
|
169
|
+
def nutrition(
|
|
170
|
+
self,
|
|
171
|
+
*,
|
|
172
|
+
options: RequestOptions | None = None,
|
|
173
|
+
**input: Unpack[PandaexpressNutritionInput],
|
|
174
|
+
) -> RunResult[PandaexpressNutritionData]:
|
|
175
|
+
"""Panda Express Nutrition
|
|
176
|
+
|
|
177
|
+
Look up official Panda Express nutrition facts by item name: serving size,
|
|
178
|
+
calories, fat, cholesterol, sodium, carbs, fiber, sugars, and protein. One
|
|
179
|
+
call, billed per request in real dollars.
|
|
180
|
+
|
|
181
|
+
Price: $0.006 per request.
|
|
182
|
+
|
|
183
|
+
Example:
|
|
184
|
+
res = client.pandaexpress.nutrition(query="orange chicken")
|
|
185
|
+
"""
|
|
186
|
+
raw = self._client._run_raw( # pyright: ignore[reportPrivateUsage]
|
|
187
|
+
"pandaexpress.nutrition", dict(input), options
|
|
188
|
+
)
|
|
189
|
+
return RunResult[PandaexpressNutritionData].model_validate(raw)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
class AsyncPandaexpressNamespace:
|
|
193
|
+
"""Typed methods for this platform. Attached lazily to the client."""
|
|
194
|
+
|
|
195
|
+
def __init__(self, client: "AsyncAnyAPI") -> None:
|
|
196
|
+
self._client = client
|
|
197
|
+
|
|
198
|
+
async def locations(
|
|
199
|
+
self,
|
|
200
|
+
*,
|
|
201
|
+
options: RequestOptions | None = None,
|
|
202
|
+
**input: Unpack[PandaexpressLocationsInput],
|
|
203
|
+
) -> RunResult[PandaexpressLocationsData]:
|
|
204
|
+
"""Panda Express Locations
|
|
205
|
+
|
|
206
|
+
Find Panda Express restaurants near a latitude/longitude, sorted by
|
|
207
|
+
distance, with address, phone, hours availability, and pickup/delivery
|
|
208
|
+
support. One call, billed per request in real dollars.
|
|
209
|
+
|
|
210
|
+
Price: $0.0009 per request.
|
|
211
|
+
|
|
212
|
+
Example:
|
|
213
|
+
res = client.pandaexpress.locations(latitude=34.0522, limit=5, longitude=-118.2437)
|
|
214
|
+
"""
|
|
215
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
216
|
+
"pandaexpress.locations", dict(input), options
|
|
217
|
+
)
|
|
218
|
+
return RunResult[PandaexpressLocationsData].model_validate(raw)
|
|
219
|
+
|
|
220
|
+
async def menu(
|
|
221
|
+
self,
|
|
222
|
+
*,
|
|
223
|
+
options: RequestOptions | None = None,
|
|
224
|
+
**input: Unpack[PandaexpressMenuInput],
|
|
225
|
+
) -> RunResult[PandaexpressMenuData]:
|
|
226
|
+
"""Panda Express Menu
|
|
227
|
+
|
|
228
|
+
Get the live menu for a Panda Express restaurant by id: categories with item
|
|
229
|
+
names, descriptions, and USD prices. Pair with Panda Express Locations to
|
|
230
|
+
resolve a restaurant id. One call, billed per request in real dollars.
|
|
231
|
+
|
|
232
|
+
Price: $0.0009 per request.
|
|
233
|
+
|
|
234
|
+
Example:
|
|
235
|
+
res = client.pandaexpress.menu(restaurantId="112551")
|
|
236
|
+
"""
|
|
237
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
238
|
+
"pandaexpress.menu", dict(input), options
|
|
239
|
+
)
|
|
240
|
+
return RunResult[PandaexpressMenuData].model_validate(raw)
|
|
241
|
+
|
|
242
|
+
async def nutrition(
|
|
243
|
+
self,
|
|
244
|
+
*,
|
|
245
|
+
options: RequestOptions | None = None,
|
|
246
|
+
**input: Unpack[PandaexpressNutritionInput],
|
|
247
|
+
) -> RunResult[PandaexpressNutritionData]:
|
|
248
|
+
"""Panda Express Nutrition
|
|
249
|
+
|
|
250
|
+
Look up official Panda Express nutrition facts by item name: serving size,
|
|
251
|
+
calories, fat, cholesterol, sodium, carbs, fiber, sugars, and protein. One
|
|
252
|
+
call, billed per request in real dollars.
|
|
253
|
+
|
|
254
|
+
Price: $0.006 per request.
|
|
255
|
+
|
|
256
|
+
Example:
|
|
257
|
+
res = client.pandaexpress.nutrition(query="orange chicken")
|
|
258
|
+
"""
|
|
259
|
+
raw = await self._client._arun_raw( # pyright: ignore[reportPrivateUsage]
|
|
260
|
+
"pandaexpress.nutrition", dict(input), options
|
|
261
|
+
)
|
|
262
|
+
return RunResult[PandaexpressNutritionData].model_validate(raw)
|