Skip to content

Commit a13eaed

Browse files
0xGhostCasperscrapebadger-bot
andauthored
chore: regenerate SDK from OpenAPI spec (#36)
Co-authored-by: scrapebadger-bot <bot@scrapebadger.com>
1 parent ed08bda commit a13eaed

3 files changed

Lines changed: 109 additions & 4 deletions

File tree

src/scrapebadger/facebook/client.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ async def search_marketplace(
142142
sort_by: str | None = None,
143143
item_condition: str | None = None,
144144
delivery_method: str | None = None,
145+
radius: str | None = None,
145146
after: str | None = None,
146147
) -> dict[str, Any]:
147148
"""Search Marketplace.
@@ -159,6 +160,7 @@ async def search_marketplace(
159160
"sort_by": sort_by,
160161
"item_condition": item_condition,
161162
"delivery_method": delivery_method,
163+
"radius": radius,
162164
"after": after,
163165
}.items()
164166
if v is not None
@@ -180,21 +182,29 @@ async def get_page_posts(self, identifier: str, *, after: str | None = None) ->
180182
params = {k: v for k, v in {"after": after}.items() if v is not None}
181183
return await self._client.get(f"/v1/facebook/pages/{identifier}/posts", params=params)
182184

183-
async def get_post_detail(self, post_id: str) -> dict[str, Any]:
185+
async def get_post_detail(self, post_id: str, *, url: str | None = None) -> dict[str, Any]:
184186
"""Get post detail.
185187
186188
Generated from the OpenAPI spec; returns the raw response dict.
187189
"""
188-
return await self._client.get(f"/v1/facebook/posts/{post_id}")
190+
params = {k: v for k, v in {"url": url}.items() if v is not None}
191+
return await self._client.get(f"/v1/facebook/posts/{post_id}", params=params)
189192

190193
async def get_post_comments(
191-
self, post_id: str, *, after: str | None = None, sort: str = "relevance"
194+
self,
195+
post_id: str,
196+
*,
197+
url: str | None = None,
198+
after: str | None = None,
199+
sort: str = "relevance",
192200
) -> dict[str, Any]:
193201
"""Get post comments.
194202
195203
Generated from the OpenAPI spec; returns the raw response dict.
196204
"""
197-
params = {k: v for k, v in {"after": after, "sort": sort}.items() if v is not None}
205+
params = {
206+
k: v for k, v in {"url": url, "after": after, "sort": sort}.items() if v is not None
207+
}
198208
return await self._client.get(f"/v1/facebook/posts/{post_id}/comments", params=params)
199209

200210
async def get_profile_detail(self, identifier: str) -> dict[str, Any]:

src/scrapebadger/tiktok/client.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,4 +225,91 @@ async def get_tiktok_ad_detail(self, ad_id: str, *, region: str = "DE") -> dict[
225225
params = {k: v for k, v in {"region": region}.items() if v is not None}
226226
return await self._client.get(f"/v1/tiktok/ads/{ad_id}", params=params)
227227

228+
async def tiktok_shop_root_categories(self, *, region: str = "US") -> dict[str, Any]:
229+
"""TikTok Shop root categories.
230+
231+
Generated from the OpenAPI spec; returns the raw response dict.
232+
"""
233+
params = {k: v for k, v in {"region": region}.items() if v is not None}
234+
return await self._client.get("/v1/tiktok/shop/categories", params=params)
235+
236+
async def tiktok_shop_category_subcategories_top_products(
237+
self, category_id: str, *, region: str = "US"
238+
) -> dict[str, Any]:
239+
"""TikTok Shop category: subcategories + top products.
240+
241+
Generated from the OpenAPI spec; returns the raw response dict.
242+
"""
243+
params = {k: v for k, v in {"region": region}.items() if v is not None}
244+
return await self._client.get(f"/v1/tiktok/shop/categories/{category_id}", params=params)
245+
246+
async def tiktok_shop_product_detail(
247+
self, product_id: str, *, region: str = "US"
248+
) -> dict[str, Any]:
249+
"""TikTok Shop product detail.
250+
251+
Generated from the OpenAPI spec; returns the raw response dict.
252+
"""
253+
params = {k: v for k, v in {"region": region}.items() if v is not None}
254+
return await self._client.get(f"/v1/tiktok/shop/products/{product_id}", params=params)
255+
256+
async def tiktok_shop_product_reviews(
257+
self,
258+
product_id: str,
259+
*,
260+
region: str = "US",
261+
page: int = 1,
262+
count: int = 20,
263+
sort: str = "recommended",
264+
rating: str | None = None,
265+
with_media: bool = False,
266+
verified: bool = False,
267+
) -> dict[str, Any]:
268+
"""TikTok Shop product reviews.
269+
270+
Generated from the OpenAPI spec; returns the raw response dict.
271+
"""
272+
params = {
273+
k: v
274+
for k, v in {
275+
"region": region,
276+
"page": page,
277+
"count": count,
278+
"sort": sort,
279+
"rating": rating,
280+
"with_media": with_media,
281+
"verified": verified,
282+
}.items()
283+
if v is not None
284+
}
285+
return await self._client.get(
286+
f"/v1/tiktok/shop/products/{product_id}/reviews", params=params
287+
)
288+
289+
async def search_tiktok_shop_products(
290+
self, *, q: str, region: str = "US", offset: int = 0
291+
) -> dict[str, Any]:
292+
"""Search TikTok Shop products.
293+
294+
Generated from the OpenAPI spec; returns the raw response dict.
295+
"""
296+
params = {
297+
k: v for k, v in {"q": q, "region": region, "offset": offset}.items() if v is not None
298+
}
299+
return await self._client.get("/v1/tiktok/shop/search", params=params)
300+
301+
async def tiktok_shop_store_products(
302+
self, seller_id: str, *, region: str = "US", cursor: str = "", count: int = 20
303+
) -> dict[str, Any]:
304+
"""TikTok Shop store + products.
305+
306+
Generated from the OpenAPI spec; returns the raw response dict.
307+
"""
308+
params = {
309+
k: v
310+
for k, v in {"region": region, "cursor": cursor, "count": count}.items()
311+
if v is not None
312+
}
313+
return await self._client.get(f"/v1/tiktok/shop/stores/{seller_id}", params=params)
314+
228315
# --- END generated by sdk/codegen/facade ---

src/scrapebadger/zillow/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ def reference(self) -> ReferenceClient:
139139

140140
# --- BEGIN generated by sdk/codegen/facade — do not edit ---
141141

142+
async def get_multifamily_building(self, *, url: str) -> dict[str, Any]:
143+
"""Get multifamily building.
144+
145+
Generated from the OpenAPI spec; returns the raw response dict.
146+
"""
147+
params = {k: v for k, v in {"url": url}.items() if v is not None}
148+
return await self._client.get("/v1/zillow/building", params=params)
149+
142150
async def get_property_detail_by_url(self, *, url: str) -> dict[str, Any]:
143151
"""Get property detail by URL.
144152

0 commit comments

Comments
 (0)