Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/scrapebadger/account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""account API client."""

from scrapebadger.account.client import AccountClient

__all__ = ["AccountClient"]
22 changes: 22 additions & 0 deletions src/scrapebadger/account/client.py
Original file line number Diff line number Diff line change
@@ -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")
9 changes: 9 additions & 0 deletions src/scrapebadger/apartments/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
22 changes: 21 additions & 1 deletion src/scrapebadger/chatgpt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
36 changes: 36 additions & 0 deletions src/scrapebadger/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -137,20 +141,24 @@ 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
self._zillow: ZillowClient | None = None
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
Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions src/scrapebadger/depop/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions src/scrapebadger/facebook/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""facebook API client."""

from scrapebadger.facebook.client import FacebookClient

__all__ = ["FacebookClient"]
Loading
Loading