diff --git a/src/scrapebadger/account/__init__.py b/src/scrapebadger/account/__init__.py new file mode 100644 index 0000000..a1c1764 --- /dev/null +++ b/src/scrapebadger/account/__init__.py @@ -0,0 +1,5 @@ +"""account API client.""" + +from scrapebadger.account.client import AccountClient + +__all__ = ["AccountClient"] diff --git a/src/scrapebadger/account/client.py b/src/scrapebadger/account/client.py new file mode 100644 index 0000000..db1bfdb --- /dev/null +++ b/src/scrapebadger/account/client.py @@ -0,0 +1,22 @@ +"""Account API client. # --- generated by sdk/codegen/facade — do not edit ---""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from scrapebadger._internal.client import BaseClient + + +class AccountClient: + """Client for all Account API operations. (Generated from the OpenAPI spec.)""" + + def __init__(self, client: BaseClient) -> None: + self._client = client + + async def get_account_info(self) -> dict[str, Any]: + """Get account info. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get("/v1/account/me") diff --git a/src/scrapebadger/apartments/client.py b/src/scrapebadger/apartments/client.py index 72488b5..9011499 100644 --- a/src/scrapebadger/apartments/client.py +++ b/src/scrapebadger/apartments/client.py @@ -108,3 +108,12 @@ async def get_property( else: raise ValueError("Provide either url, or both slug and property_id") return Property.model_validate(response) + + # --- generated by sdk/codegen/facade — do not edit --- + + async def get_property_detail_by_slug_id(self, slug: str, property_id: str) -> dict[str, Any]: + """Get property detail by slug + id. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/apartments/properties/{slug}/{property_id}") diff --git a/src/scrapebadger/chatgpt/client.py b/src/scrapebadger/chatgpt/client.py index d8460d5..baf3871 100644 --- a/src/scrapebadger/chatgpt/client.py +++ b/src/scrapebadger/chatgpt/client.py @@ -6,7 +6,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.chatgpt.ask import AskClient from scrapebadger.chatgpt.brand import BrandClient @@ -113,3 +113,23 @@ def reference(self) -> ReferenceClient: ``` """ return self._reference + + # --- generated by sdk/codegen/facade — do not edit --- + + async def ask_chatgpt_a_question_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Ask ChatGPT a question (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/chatgpt/ask", params=params, json=payload) + + async def measure_a_brand_s_visibility_in_a_chatgpt_answer_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Measure a brand's visibility in a ChatGPT answer (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/chatgpt/brand-visibility", params=params, json=payload) diff --git a/src/scrapebadger/client.py b/src/scrapebadger/client.py index b619e1e..36d65f2 100644 --- a/src/scrapebadger/client.py +++ b/src/scrapebadger/client.py @@ -9,6 +9,7 @@ from scrapebadger._internal.client import BaseClient from scrapebadger._internal.config import ClientConfig +from scrapebadger.account.client import AccountClient from scrapebadger.amazon.client import AmazonClient from scrapebadger.apartments.client import ApartmentsClient from scrapebadger.baidu.client import BaiduClient @@ -17,13 +18,16 @@ from scrapebadger.depop.client import DepopClient from scrapebadger.duckduckgo.client import DuckDuckGoClient from scrapebadger.ebay.client import EbayClient +from scrapebadger.facebook.client import FacebookClient from scrapebadger.gemini.client import GeminiClient from scrapebadger.google.client import GoogleClient +from scrapebadger.idealista.client import IdealistaClient from scrapebadger.immobiliare.client import ImmobiliareClient from scrapebadger.instagram.client import InstagramClient from scrapebadger.leboncoin.client import LeboncoinClient from scrapebadger.linkedin.client import LinkedInClient from scrapebadger.loopnet.client import LoopNetClient +from scrapebadger.perplexity.client import PerplexityClient from scrapebadger.realtor.client import RealtorClient from scrapebadger.reddit.client import RedditClient from scrapebadger.redfin.client import RedfinClient @@ -137,13 +141,16 @@ def __init__( self._vinted: VintedClient | None = None self._web: WebClient | None = None self._google: GoogleClient | None = None + self._idealista: IdealistaClient | None = None self._reddit: RedditClient | None = None self._redfin: RedfinClient | None = None self._apartments: ApartmentsClient | None = None self._depop: DepopClient | None = None self._linkedin: LinkedInClient | None = None + self._account: AccountClient | None = None self._amazon: AmazonClient | None = None self._ebay: EbayClient | None = None + self._facebook: FacebookClient | None = None self._youtube: YoutubeClient | None = None self._tiktok: TikTokClient | None = None self._realtor: RealtorClient | None = None @@ -151,6 +158,7 @@ def __init__( self._leboncoin: LeboncoinClient | None = None self._immobiliare: ImmobiliareClient | None = None self._loopnet: LoopNetClient | None = None + self._perplexity: PerplexityClient | None = None self._chatgpt: ChatGPTClient | None = None self._gemini: GeminiClient | None = None self._instagram: InstagramClient | None = None @@ -847,3 +855,31 @@ async def __aexit__( def __repr__(self) -> str: """Return string representation.""" return f"ScrapeBadger(base_url={self._config.base_url!r})" + + @property + def account(self) -> AccountClient: + """Access Account API operations. (Generated from the OpenAPI spec.)""" + if self._account is None: + self._account = AccountClient(self._base_client) + return self._account + + @property + def facebook(self) -> FacebookClient: + """Access Facebook API operations. (Generated from the OpenAPI spec.)""" + if self._facebook is None: + self._facebook = FacebookClient(self._base_client) + return self._facebook + + @property + def idealista(self) -> IdealistaClient: + """Access Idealista API operations. (Generated from the OpenAPI spec.)""" + if self._idealista is None: + self._idealista = IdealistaClient(self._base_client) + return self._idealista + + @property + def perplexity(self) -> PerplexityClient: + """Access Perplexity API operations. (Generated from the OpenAPI spec.)""" + if self._perplexity is None: + self._perplexity = PerplexityClient(self._base_client) + return self._perplexity diff --git a/src/scrapebadger/depop/client.py b/src/scrapebadger/depop/client.py index 753c5b0..257b9bf 100644 --- a/src/scrapebadger/depop/client.py +++ b/src/scrapebadger/depop/client.py @@ -244,3 +244,13 @@ async def list_markets(self) -> MarketsResponse: """ response = await self._client.get("/v1/depop/markets") return MarketsResponse.model_validate(response) + + # --- generated by sdk/codegen/facade — do not edit --- + + async def get_product_detail(self, product_id: str, *, market: str = "us") -> dict[str, Any]: + """Get product detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"market": market}.items() if v is not None} + return await self._client.get(f"/v1/depop/products/{product_id}", params=params) diff --git a/src/scrapebadger/facebook/__init__.py b/src/scrapebadger/facebook/__init__.py new file mode 100644 index 0000000..c9bd52c --- /dev/null +++ b/src/scrapebadger/facebook/__init__.py @@ -0,0 +1,5 @@ +"""facebook API client.""" + +from scrapebadger.facebook.client import FacebookClient + +__all__ = ["FacebookClient"] diff --git a/src/scrapebadger/facebook/client.py b/src/scrapebadger/facebook/client.py new file mode 100644 index 0000000..540cb91 --- /dev/null +++ b/src/scrapebadger/facebook/client.py @@ -0,0 +1,252 @@ +"""Facebook API client. # --- generated by sdk/codegen/facade — do not edit ---""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from scrapebadger._internal.client import BaseClient + + +class FacebookClient: + """Client for all Facebook API operations. (Generated from the OpenAPI spec.)""" + + def __init__(self, client: BaseClient) -> None: + self._client = client + + async def search_the_ad_library( + self, + *, + query: str, + country: str = "US", + ad_type: str = "all", + active_status: str = "active", + after: str | None = None, + ) -> dict[str, Any]: + """Search the Ad Library. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "query": query, + "country": country, + "ad_type": ad_type, + "active_status": active_status, + "after": after, + }.items() + if v is not None + } + return await self._client.get("/v1/facebook/ads/search", params=params) + + async def get_an_ad(self, ad_archive_id: str) -> dict[str, Any]: + """Get an ad. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/ads/{ad_archive_id}") + + async def get_group_detail(self, group_id: str) -> dict[str, Any]: + """Get group detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/groups/{group_id}") + + async def get_group_posts(self, group_id: str, *, after: str | None = None) -> dict[str, Any]: + """Get group posts. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"after": after}.items() if v is not None} + return await self._client.get(f"/v1/facebook/groups/{group_id}/posts", params=params) + + async def list_categories(self) -> dict[str, Any]: + """List categories. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get("/v1/facebook/marketplace/categories") + + async def browse_a_marketplace_category( + self, + category: str, + *, + location: str = "nyc", + min_price: str | None = None, + max_price: str | None = None, + sort_by: str | None = None, + after: str | None = None, + ) -> dict[str, Any]: + """Browse a Marketplace category. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "location": location, + "min_price": min_price, + "max_price": max_price, + "sort_by": sort_by, + "after": after, + }.items() + if v is not None + } + return await self._client.get( + f"/v1/facebook/marketplace/category/{category}", params=params + ) + + async def get_a_marketplace_item(self, item_id: str) -> dict[str, Any]: + """Get a Marketplace item. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/marketplace/item/{item_id}") + + async def list_locations(self) -> dict[str, Any]: + """List locations. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get("/v1/facebook/marketplace/locations") + + async def search_marketplace( + self, + *, + query: str, + location: str = "nyc", + min_price: str | None = None, + max_price: str | None = None, + days_since_listed: str | None = None, + sort_by: str | None = None, + item_condition: str | None = None, + delivery_method: str | None = None, + after: str | None = None, + ) -> dict[str, Any]: + """Search Marketplace. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "query": query, + "location": location, + "min_price": min_price, + "max_price": max_price, + "days_since_listed": days_since_listed, + "sort_by": sort_by, + "item_condition": item_condition, + "delivery_method": delivery_method, + "after": after, + }.items() + if v is not None + } + return await self._client.get("/v1/facebook/marketplace/search", params=params) + + async def get_page_detail(self, identifier: str) -> dict[str, Any]: + """Get page detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/pages/{identifier}") + + async def get_page_posts(self, identifier: str, *, after: str | None = None) -> dict[str, Any]: + """Get page posts. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"after": after}.items() if v is not None} + return await self._client.get(f"/v1/facebook/pages/{identifier}/posts", params=params) + + async def get_post_detail(self, post_id: str) -> dict[str, Any]: + """Get post detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/posts/{post_id}") + + async def get_post_comments( + self, post_id: str, *, after: str | None = None, sort: str = "relevance" + ) -> dict[str, Any]: + """Get post comments. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"after": after, "sort": sort}.items() if v is not None} + return await self._client.get(f"/v1/facebook/posts/{post_id}/comments", params=params) + + async def get_profile_detail(self, identifier: str) -> dict[str, Any]: + """Get profile detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/facebook/profiles/{identifier}") + + async def get_profile_posts( + self, identifier: str, *, after: str | None = None + ) -> dict[str, Any]: + """Get profile posts. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"after": after}.items() if v is not None} + return await self._client.get(f"/v1/facebook/profiles/{identifier}/posts", params=params) + + async def search_everything(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search everything. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search", params=params) + + async def search_events(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search events. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/events", params=params) + + async def search_groups(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search groups. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/groups", params=params) + + async def search_pages(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search Pages. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/pages", params=params) + + async def search_people(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search people. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/people", params=params) + + async def search_places(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search places. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/places", params=params) + + async def search_posts(self, *, q: str, after: str | None = None) -> dict[str, Any]: + """Search posts. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "after": after}.items() if v is not None} + return await self._client.get("/v1/facebook/search/posts", params=params) diff --git a/src/scrapebadger/gemini/client.py b/src/scrapebadger/gemini/client.py index b13ff7a..3a8d900 100644 --- a/src/scrapebadger/gemini/client.py +++ b/src/scrapebadger/gemini/client.py @@ -6,7 +6,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.gemini.ask import AskClient from scrapebadger.gemini.brand import BrandClient @@ -91,3 +91,23 @@ def brand(self) -> BrandClient: ``` """ return self._brand + + # --- generated by sdk/codegen/facade — do not edit --- + + async def ask_gemini_a_question_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Ask Gemini a question (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/gemini/ask", params=params, json=payload) + + async def measure_a_brand_s_visibility_in_a_gemini_answer_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Measure a brand's visibility in a Gemini answer (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/gemini/brand-visibility", params=params, json=payload) diff --git a/src/scrapebadger/google/client.py b/src/scrapebadger/google/client.py index 5269248..ed1a27b 100644 --- a/src/scrapebadger/google/client.py +++ b/src/scrapebadger/google/client.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.google.ai_mode import AiModeClient from scrapebadger.google.autocomplete import AutocompleteClient @@ -226,3 +226,63 @@ def products(self) -> ProductsClient: if self._products is None: self._products = ProductsClient(self._client) return self._products + + # --- generated by sdk/codegen/facade — do not edit --- + + async def google_ai_overview_inline_serp_block( + self, *, q: str, gl: str = "us", hl: str = "en" + ) -> dict[str, Any]: + """Google AI Overview (inline SERP block). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"q": q, "gl": gl, "hl": hl}.items() if v is not None} + return await self._client.get("/v1/google/ai-overview", params=params) + + async def google_flights_calendar_cheapest_fare_per_date( + self, + *, + departure_id: str, + arrival_id: str, + outbound_date_from: str, + outbound_date_to: str, + trip_type: str = "one_way", + trip_length_days: str | None = None, + return_date_from: str | None = None, + return_date_to: str | None = None, + adults: int = 1, + children: int = 0, + infants_in_seat: int = 0, + infants_on_lap: int = 0, + travel_class: str = "economy", + currency: str = "USD", + gl: str = "us", + hl: str = "en", + ) -> dict[str, Any]: + """Google Flights calendar — cheapest fare per date. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "departure_id": departure_id, + "arrival_id": arrival_id, + "outbound_date_from": outbound_date_from, + "outbound_date_to": outbound_date_to, + "trip_type": trip_type, + "trip_length_days": trip_length_days, + "return_date_from": return_date_from, + "return_date_to": return_date_to, + "adults": adults, + "children": children, + "infants_in_seat": infants_in_seat, + "infants_on_lap": infants_on_lap, + "travel_class": travel_class, + "currency": currency, + "gl": gl, + "hl": hl, + }.items() + if v is not None + } + return await self._client.get("/v1/google/flights/calendar", params=params) diff --git a/src/scrapebadger/idealista/__init__.py b/src/scrapebadger/idealista/__init__.py new file mode 100644 index 0000000..c3667fe --- /dev/null +++ b/src/scrapebadger/idealista/__init__.py @@ -0,0 +1,5 @@ +"""idealista API client.""" + +from scrapebadger.idealista.client import IdealistaClient + +__all__ = ["IdealistaClient"] diff --git a/src/scrapebadger/idealista/client.py b/src/scrapebadger/idealista/client.py new file mode 100644 index 0000000..5ac22aa --- /dev/null +++ b/src/scrapebadger/idealista/client.py @@ -0,0 +1,214 @@ +"""Idealista API client. # --- generated by sdk/codegen/facade — do not edit ---""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from scrapebadger._internal.client import BaseClient + + +class IdealistaClient: + """Client for all Idealista API operations. (Generated from the OpenAPI spec.)""" + + def __init__(self, client: BaseClient) -> None: + self._client = client + + async def agency_by_phone( + self, + phone: str, + *, + market: str = "es", + operation: str | None = None, + property_type: str | None = None, + page: int = 1, + max_items: int = 30, + include_listings: bool = True, + ) -> dict[str, Any]: + """Agency by phone. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "market": market, + "operation": operation, + "property_type": property_type, + "page": page, + "max_items": max_items, + "include_listings": include_listings, + }.items() + if v is not None + } + return await self._client.get(f"/v1/idealista/agency/by-phone/{phone}", params=params) + + async def agency_profile_listings( + self, + short_name: str, + *, + market: str = "es", + operation: str | None = None, + property_type: str | None = None, + page: int = 1, + max_items: int = 30, + include_listings: bool = True, + ) -> dict[str, Any]: + """Agency profile + listings. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "market": market, + "operation": operation, + "property_type": property_type, + "page": page, + "max_items": max_items, + "include_listings": include_listings, + }.items() + if v is not None + } + return await self._client.get(f"/v1/idealista/agency/{short_name}", params=params) + + async def list_markets(self) -> dict[str, Any]: + """List markets. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get("/v1/idealista/markets") + + async def get_property_detail( + self, property_code: str, *, market: str = "es", locale: str = "en" + ) -> dict[str, Any]: + """Get property detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"market": market, "locale": locale}.items() if v is not None} + return await self._client.get(f"/v1/idealista/properties/{property_code}", params=params) + + async def get_listing_engagement_stats( + self, property_code: str, *, market: str = "es", locale: str = "en" + ) -> dict[str, Any]: + """Get listing engagement stats. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"market": market, "locale": locale}.items() if v is not None} + return await self._client.get( + f"/v1/idealista/properties/{property_code}/stats", params=params + ) + + async def search_listings( + self, + *, + location: str, + operation: str = "sale", + property_type: str = "homes", + market: str = "es", + page: int = 1, + max_items: int = 30, + sort_by: str | None = None, + sort_order: str = "desc", + min_price: str | None = None, + max_price: str | None = None, + min_size: str | None = None, + max_size: str | None = None, + min_rooms: str | None = None, + max_rooms: str | None = None, + locale: str | None = None, + ) -> dict[str, Any]: + """Search listings. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "location": location, + "operation": operation, + "property_type": property_type, + "market": market, + "page": page, + "max_items": max_items, + "sort_by": sort_by, + "sort_order": sort_order, + "min_price": min_price, + "max_price": max_price, + "min_size": min_size, + "max_size": max_size, + "min_rooms": min_rooms, + "max_rooms": max_rooms, + "locale": locale, + }.items() + if v is not None + } + return await self._client.get("/v1/idealista/search", params=params) + + async def search_all_beats_result_cap( + self, + *, + location: str, + operation: str = "sale", + property_type: str = "homes", + market: str = "es", + max_results: int = 500, + min_price: str | None = None, + max_price: str | None = None, + min_size: str | None = None, + max_size: str | None = None, + min_rooms: str | None = None, + max_rooms: str | None = None, + locale: str | None = None, + ) -> dict[str, Any]: + """Search all (beats result cap). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "location": location, + "operation": operation, + "property_type": property_type, + "market": market, + "max_results": max_results, + "min_price": min_price, + "max_price": max_price, + "min_size": min_size, + "max_size": max_size, + "min_rooms": min_rooms, + "max_rooms": max_rooms, + "locale": locale, + }.items() + if v is not None + } + return await self._client.get("/v1/idealista/search/all", params=params) + + async def resolve_locations( + self, + *, + query: str, + operation: str = "sale", + property_type: str = "homes", + market: str = "es", + locale: str | None = None, + ) -> dict[str, Any]: + """Resolve locations. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "query": query, + "operation": operation, + "property_type": property_type, + "market": market, + "locale": locale, + }.items() + if v is not None + } + return await self._client.get("/v1/idealista/suggest", params=params) diff --git a/src/scrapebadger/instagram/client.py b/src/scrapebadger/instagram/client.py index 74aad14..4fa60c5 100644 --- a/src/scrapebadger/instagram/client.py +++ b/src/scrapebadger/instagram/client.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.instagram.media import MediaClient from scrapebadger.instagram.reference import ( @@ -84,3 +84,12 @@ def locations(self) -> LocationsClient: def audio(self) -> AudioClient: """Access audio endpoints.""" return self._audio + + # --- generated by sdk/codegen/facade — do not edit --- + + async def get_location(self, location_pk: str) -> dict[str, Any]: + """Get location. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/instagram/locations/{location_pk}") diff --git a/src/scrapebadger/perplexity/__init__.py b/src/scrapebadger/perplexity/__init__.py new file mode 100644 index 0000000..c557245 --- /dev/null +++ b/src/scrapebadger/perplexity/__init__.py @@ -0,0 +1,5 @@ +"""perplexity API client.""" + +from scrapebadger.perplexity.client import PerplexityClient + +__all__ = ["PerplexityClient"] diff --git a/src/scrapebadger/perplexity/client.py b/src/scrapebadger/perplexity/client.py new file mode 100644 index 0000000..1b5a094 --- /dev/null +++ b/src/scrapebadger/perplexity/client.py @@ -0,0 +1,73 @@ +"""Perplexity API client. # --- generated by sdk/codegen/facade — do not edit ---""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Any + +if TYPE_CHECKING: + from scrapebadger._internal.client import BaseClient + + +class PerplexityClient: + """Client for all Perplexity API operations. (Generated from the OpenAPI spec.)""" + + def __init__(self, client: BaseClient) -> None: + self._client = client + + async def ask_perplexity_a_question( + self, *, prompt: str, country: str | None = None + ) -> dict[str, Any]: + """Ask Perplexity a question. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"prompt": prompt, "country": country}.items() if v is not None} + return await self._client.get("/v1/perplexity/ask", params=params) + + async def ask_perplexity_a_question_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Ask Perplexity a question (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/perplexity/ask", params=params, json=payload) + + async def measure_a_brand_s_visibility_in_a_perplexity_answer( + self, + *, + prompt: str, + brand: str, + domain: str | None = None, + aliases: str | None = None, + competitors: str | None = None, + country: str | None = None, + ) -> dict[str, Any]: + """Measure a brand's visibility in a Perplexity answer. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = { + k: v + for k, v in { + "prompt": prompt, + "brand": brand, + "domain": domain, + "aliases": aliases, + "competitors": competitors, + "country": country, + }.items() + if v is not None + } + return await self._client.get("/v1/perplexity/brand-visibility", params=params) + + async def measure_a_brand_s_visibility_in_a_perplexity_answer_post( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Measure a brand's visibility in a Perplexity answer (POST). + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post( + "/v1/perplexity/brand-visibility", params=params, json=payload + ) diff --git a/src/scrapebadger/redfin/client.py b/src/scrapebadger/redfin/client.py index 0b0ada2..182aaa8 100644 --- a/src/scrapebadger/redfin/client.py +++ b/src/scrapebadger/redfin/client.py @@ -255,3 +255,12 @@ async def list_markets(self) -> MarketsResponse: """ response = await self._client.get("/v1/redfin/markets") return MarketsResponse.model_validate(response) + + # --- generated by sdk/codegen/facade — do not edit --- + + async def get_property_detail(self, property_id: str) -> dict[str, Any]: + """Get property detail. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/redfin/property/{property_id}") diff --git a/src/scrapebadger/twitter/client.py b/src/scrapebadger/twitter/client.py index 12da4ea..22e0961 100644 --- a/src/scrapebadger/twitter/client.py +++ b/src/scrapebadger/twitter/client.py @@ -6,7 +6,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.twitter.communities import CommunitiesClient from scrapebadger.twitter.geo import GeoClient @@ -261,3 +261,108 @@ def stream(self) -> StreamClient: ``` """ return self._stream + + # --- generated by sdk/codegen/facade — do not edit --- + + async def delete_filter_rule( + self, + rule_id: str, + *, + payload: dict[str, Any] | None = None, + params: dict[str, Any] | None = None, + ) -> dict[str, Any]: + """Delete filter rule. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client._request( + "DELETE", f"/v1/twitter/stream/filter-rules/{rule_id}", params=params, json=payload + ) + + async def update_filter_rule( + self, + rule_id: str, + *, + payload: dict[str, Any] | None = None, + params: dict[str, Any] | None = None, + ) -> dict[str, Any]: + """Update filter rule. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client._request( + "PATCH", f"/v1/twitter/stream/filter-rules/{rule_id}", params=params, json=payload + ) + + async def delete_stream_monitor( + self, + monitor_id: str, + *, + payload: dict[str, Any] | None = None, + params: dict[str, Any] | None = None, + ) -> dict[str, Any]: + """Delete stream monitor. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client._request( + "DELETE", f"/v1/twitter/stream/monitors/{monitor_id}", params=params, json=payload + ) + + async def update_stream_monitor( + self, + monitor_id: str, + *, + payload: dict[str, Any] | None = None, + params: dict[str, Any] | None = None, + ) -> dict[str, Any]: + """Update stream monitor. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client._request( + "PATCH", f"/v1/twitter/stream/monitors/{monitor_id}", params=params, json=payload + ) + + async def list_webhooks(self, *, monitor_id: str | None = None) -> dict[str, Any]: + """List webhooks. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"monitor_id": monitor_id}.items() if v is not None} + return await self._client.get("/v1/twitter/stream/webhooks", params=params) + + async def configure_webhook_on_a_monitor( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Configure webhook on a monitor. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/twitter/stream/webhooks", params=params, json=payload) + + async def test_webhook_delivery( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Test webhook delivery. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post( + "/v1/twitter/stream/webhooks/test", params=params, json=payload + ) + + async def remove_webhook_from_monitor( + self, + webhook_id: str, + *, + payload: dict[str, Any] | None = None, + params: dict[str, Any] | None = None, + ) -> dict[str, Any]: + """Remove webhook from monitor. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client._request( + "DELETE", f"/v1/twitter/stream/webhooks/{webhook_id}", params=params, json=payload + ) diff --git a/src/scrapebadger/web/client.py b/src/scrapebadger/web/client.py index 80aac2f..40970dc 100644 --- a/src/scrapebadger/web/client.py +++ b/src/scrapebadger/web/client.py @@ -304,3 +304,46 @@ async def detect( response = await self._client.post("/v1/web/detect", json=body) return DetectResult.model_validate(response) + + # --- generated by sdk/codegen/facade — do not edit --- + + async def submit_batch_scraping_job( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Submit batch scraping job. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/web/batch", params=params, json=payload) + + async def get_batch_job_status(self, job_id: str) -> dict[str, Any]: + """Get batch job status. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/web/batch/{job_id}") + + async def extract_structured_data( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Extract structured data. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/web/extract", params=params, json=payload) + + async def take_a_screenshot( + self, *, payload: dict[str, Any] | None = None, params: dict[str, Any] | None = None + ) -> dict[str, Any]: + """Take a screenshot. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.post("/v1/web/screenshot", params=params, json=payload) + + async def poll_an_auto_unblock_discovery_job(self, job_id: str) -> dict[str, Any]: + """Poll an auto-unblock discovery job. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + return await self._client.get(f"/v1/web/unblock/{job_id}") diff --git a/src/scrapebadger/zillow/client.py b/src/scrapebadger/zillow/client.py index ffed16a..a5ac13e 100644 --- a/src/scrapebadger/zillow/client.py +++ b/src/scrapebadger/zillow/client.py @@ -6,7 +6,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any from scrapebadger.zillow.agent import AgentClient from scrapebadger.zillow.properties import PropertiesClient @@ -129,3 +129,13 @@ def reference(self) -> ReferenceClient: ``` """ return self._reference + + # --- generated by sdk/codegen/facade — do not edit --- + + async def get_property_detail_by_url(self, *, url: str) -> dict[str, Any]: + """Get property detail by URL. + + Generated from the OpenAPI spec; returns the raw response dict. + """ + params = {k: v for k, v in {"url": url}.items() if v is not None} + return await self._client.get("/v1/zillow/property", params=params)