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
57 changes: 57 additions & 0 deletions crawlora/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10895,6 +10895,21 @@ ModelBooksyTreatmentHintsResponse = TypedDict('ModelBooksyTreatmentHintsResponse
'treatment_count': NotRequired[int],
}, total=False)

ModelBooksyTreatmentRecord = TypedDict('ModelBooksyTreatmentRecord', {
'id': NotRequired[int],
'name': NotRequired[str],
'slug': NotRequired[str],
}, total=False)

ModelBooksyTreatmentsResponse = TypedDict('ModelBooksyTreatmentsResponse', {
'category': NotRequired[int],
'count': NotRequired[int],
'country': NotRequired[str],
'limit': NotRequired[int],
'treatments': NotRequired[list[ModelBooksyTreatmentRecord]],
'truncated': NotRequired[bool],
}, total=False)

ModelBooksyBusinessResponseDoc = TypedDict('ModelBooksyBusinessResponseDoc', {
'code': NotRequired[int],
'data': NotRequired[ModelBooksyBusinessResponse],
Expand Down Expand Up @@ -10931,6 +10946,12 @@ ModelBooksyTreatmentHintsResponseDoc = TypedDict('ModelBooksyTreatmentHintsRespo
'msg': NotRequired[str],
}, total=False)

ModelBooksyTreatmentsResponseDoc = TypedDict('ModelBooksyTreatmentsResponseDoc', {
'code': NotRequired[int],
'data': NotRequired[ModelBooksyTreatmentsResponse],
'msg': NotRequired[str],
}, total=False)

ModelBootsFacet = TypedDict('ModelBootsFacet', {
'key': NotRequired[str],
'maximum': NotRequired[float],
Expand Down Expand Up @@ -118300,6 +118321,16 @@ BooksyTreatmentHintsParams = TypedDict('BooksyTreatmentHintsParams', {
'country': NotRequired[Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']],
}, total=False)

BooksyTreatmentsResponse = ModelBooksyTreatmentsResponseDoc
BooksyTreatmentsParams = TypedDict('BooksyTreatmentsParams', {
'_response_type': NotRequired[ResponseType],
'_timeout': NotRequired[float],
'_headers': NotRequired[Mapping[str, str]],
'category': NotRequired[int],
'limit': NotRequired[int],
'country': NotRequired[Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']],
}, total=False)

BootsSearchResponse = ModelBootsSearchResponseDoc
BootsSearchParams = TypedDict('BootsSearchParams', {
'_response_type': NotRequired[ResponseType],
Expand Down Expand Up @@ -168645,6 +168676,7 @@ class BooksyGroup:
def businesses(self, **params: Unpack[BooksyBusinessesParams]) -> BooksyBusinessesResponse: ...
def categories(self, **params: Unpack[BooksyCategoriesParams]) -> BooksyCategoriesResponse: ...
def treatment_hints(self, **params: Unpack[BooksyTreatmentHintsParams]) -> BooksyTreatmentHintsResponse: ...
def treatments(self, **params: Unpack[BooksyTreatmentsParams]) -> BooksyTreatmentsResponse: ...

class BootsGroup:
def search(self, **params: Unpack[BootsSearchParams]) -> BootsSearchResponse: ...
Expand Down Expand Up @@ -175287,6 +175319,7 @@ OperationId = Literal[
'booksy-businesses',
'booksy-categories',
'booksy-treatment-hints',
'booksy-treatments',
'boots-search',
'boots-suggest',
'bostonglobe-news',
Expand Down Expand Up @@ -186294,6 +186327,18 @@ class CrawloraClient:
retry_predicate: Callable[[int, BaseException | None], bool] | None = ...,
) -> BooksyTreatmentHintsResponse: ...
@overload
def operation(
self,
operation_id: Literal['booksy-treatments'],
params: BooksyTreatmentsParams = ...,
*,
response_type: ResponseType = ...,
timeout: float | None = ...,
headers: Mapping[str, str] | None = ...,
retries: int | None = ...,
retry_predicate: Callable[[int, BaseException | None], bool] | None = ...,
) -> BooksyTreatmentsResponse: ...
@overload
def operation(
self,
operation_id: Literal['boots-search'],
Expand Down Expand Up @@ -253386,6 +253431,18 @@ class CrawloraClient:
retry_predicate: Callable[[int, BaseException | None], bool] | None = ...,
) -> BooksyTreatmentHintsResponse: ...
@overload
def request(
self,
operation_id: Literal['booksy-treatments'],
params: BooksyTreatmentsParams = ...,
*,
response_type: ResponseType = ...,
timeout: float | None = ...,
headers: Mapping[str, str] | None = ...,
retries: int | None = ...,
retry_predicate: Callable[[int, BaseException | None], bool] | None = ...,
) -> BooksyTreatmentsResponse: ...
@overload
def request(
self,
operation_id: Literal['boots-search'],
Expand Down
39 changes: 37 additions & 2 deletions crawlora/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7331,6 +7331,39 @@
'name': 'country',
'type': 'string'}],
'security': ['ApiKeyAuth']},
'booksy-treatments': {'bodyParam': None,
'bodyRequired': False,
'consumes': ['application/json'],
'formParams': [],
'id': 'booksy-treatments',
'method': 'GET',
'path': '/booksy/treatments',
'pathParams': [],
'produces': ['application/json'],
'queryParams': [{'in': 'query', 'name': 'category', 'type': 'integer'},
{'in': 'query', 'name': 'limit', 'type': 'integer'},
{'enum': ['ar',
'au',
'br',
'ca',
'cl',
'co',
'de',
'es',
'fr',
'gb',
'ie',
'it',
'mx',
'nl',
'pl',
'pt',
'us',
'za'],
'in': 'query',
'name': 'country',
'type': 'string'}],
'security': ['ApiKeyAuth']},
'boots-search': {'bodyParam': None,
'bodyRequired': False,
'consumes': [],
Expand Down Expand Up @@ -105226,7 +105259,8 @@
'business_reviews': 'booksy-business-reviews',
'businesses': 'booksy-businesses',
'categories': 'booksy-categories',
'treatment_hints': 'booksy-treatment-hints'},
'treatment_hints': 'booksy-treatment-hints',
'treatments': 'booksy-treatments'},
'boots': {'search': 'boots-search', 'suggest': 'boots-suggest'},
'boston_globe': {'bostonglobe_news': 'bostonglobe-news'},
'box_office_mojo': {'boxofficemojo_brand': 'boxofficemojo-brand',
Expand Down Expand Up @@ -110342,7 +110376,7 @@
'restaurant_menu': 'zomato-restaurant-menu',
'search': 'zomato-search'}}

OPERATION_COUNT = 5590
OPERATION_COUNT = 5591

class OperationId:
ABC_NEWS_ABCNEWS_ARTICLE = 'abcnews-article'
Expand Down Expand Up @@ -110755,6 +110789,7 @@ class OperationId:
BOOKSY_BUSINESSES = 'booksy-businesses'
BOOKSY_CATEGORIES = 'booksy-categories'
BOOKSY_TREATMENT_HINTS = 'booksy-treatment-hints'
BOOKSY_TREATMENTS = 'booksy-treatments'
BOOTS_SEARCH = 'boots-search'
BOOTS_SUGGEST = 'boots-suggest'
BOSTON_GLOBE_BOSTONGLOBE_NEWS = 'bostonglobe-news'
Expand Down
3 changes: 2 additions & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generated from `openapi/public.json`. Deprecated, admin, and internal operations are excluded from this SDK contract.

Total operations: `5590`
Total operations: `5591`

| Group | SDK method | Operation ID | HTTP | Params | Auth | Response | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
Expand Down Expand Up @@ -438,6 +438,7 @@ Total operations: `5590`
| booksy | `booksy.businesses` | `booksy-businesses` | `GET /booksy/businesses` | `country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za'])<br>`page` (query int)<br>`page_size` (query int)<br>`category` (query int)<br>`treatment` (query int)<br>`query` (query str)<br>`location_id` (query int)<br>`location_name` (query str)<br>`sort_order` (query Literal['distance', 'score', 'top_rated', 'by_ids'])<br>`gender` (query Literal['M', 'F', 'R'])<br>`open_now` (query bool)<br>`has_special_offers` (query bool)<br>`has_online_services` (query bool)<br>`accept_booksy_pay` (query bool)<br>`accept_booksy_gift_cards` (query bool)<br>`has_traveling_services` (query bool)<br>`business_ids` (query str) | `ApiKeyAuth` | `BooksyBusinessesResponse` | |
| booksy | `booksy.categories` | `booksy-categories` | `GET /booksy/categories` | `country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyCategoriesResponse` | |
| booksy | `booksy.treatment_hints` | `booksy-treatment-hints` | `GET /booksy/treatment-hints` | `query` (query str required)<br>`country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyTreatmentHintsResponse` | |
| booksy | `booksy.treatments` | `booksy-treatments` | `GET /booksy/treatments` | `category` (query int)<br>`limit` (query int)<br>`country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyTreatmentsResponse` | |
| boots | `boots.search` | `boots-search` | `GET /boots/search` | `q` (query str)<br>`category` (query list[str])<br>`filter` (query list[str])<br>`price_min` (query float)<br>`price_max` (query float)<br>`in_stock` (query bool)<br>`page` (query int)<br>`page_size` (query int)<br>`sort` (query Literal['relevance', 'price_low_to_high', 'price_high_to_low', 'top_rated', 'best_seller', 'newest']) | `ApiKeyAuth` | `BootsSearchResponse` | |
| boots | `boots.suggest` | `boots-suggest` | `GET /boots/suggest` | `q` (query str required) | `ApiKeyAuth` | `BootsSuggestResponse` | |
| boston_globe | `boston_globe.bostonglobe_news` | `bostonglobe-news` | `GET /bostonglobe/news` | none | `ApiKeyAuth` | `BostonGlobeBostonglobeNewsResponse` | |
Expand Down
158 changes: 158 additions & 0 deletions openapi/public.json
Original file line number Diff line number Diff line change
Expand Up @@ -34726,6 +34726,58 @@
},
"type": "object"
},
"booksy.TreatmentRecord": {
"properties": {
"id": {
"example": 363,
"type": "integer"
},
"name": {
"example": "Male Haircut",
"type": "string"
},
"slug": {
"example": "male-haircut",
"type": "string"
}
},
"type": "object"
},
"booksy.TreatmentsResponse": {
"properties": {
"category": {
"description": "Category is the requested category id, absent on the unscoped list.",
"type": "integer"
},
"count": {
"description": "Count is how many treatments this response carries.",
"example": 18,
"type": "integer"
},
"country": {
"example": "us",
"type": "string"
},
"limit": {
"description": "Limit is the effective limit sent upstream.",
"example": 40,
"type": "integer"
},
"treatments": {
"description": "Treatments in the upstream's own ranking order.",
"items": {
"$ref": "#/definitions/booksy.TreatmentRecord"
},
"type": "array"
},
"truncated": {
"description": "Truncated is true when the upstream returned exactly the requested limit,\nwhich is the only \"there may be more\" signal this route offers: it has no\npage, offset or cursor parameter. A category with a smaller set than the\nlimit cannot be truncated.",
"example": false,
"type": "boolean"
}
},
"type": "object"
},
"booksy.businessResponseDoc": {
"properties": {
"code": {
Expand Down Expand Up @@ -34822,6 +34874,22 @@
},
"type": "object"
},
"booksy.treatmentsResponseDoc": {
"properties": {
"code": {
"example": 200,
"type": "integer"
},
"data": {
"$ref": "#/definitions/booksy.TreatmentsResponse"
},
"msg": {
"example": "OK",
"type": "string"
}
},
"type": "object"
},
"boots.Facet": {
"properties": {
"key": {
Expand Down Expand Up @@ -394567,6 +394635,96 @@
]
}
},
"/booksy/treatments": {
"get": {
"consumes": [
"application/json"
],
"description": "Returns the treatment ids Booksy's (booksy.com) Android app lists for one top-level category, in the upstream's own ranking order, with each treatment's integer id, name and slug. This is the category-scoped discovery step for the treatment parameter of booksy-businesses: combine the category with one of these treatments to filter a listing, and category 6 with treatment 363 returns the Male Haircut subset of the Barber marketplace. Pass a category id from booksy-categories; omit it for the upstream's unscoped popular list, which mixes categories. limit is 1 to 40, the upstream's own cap. The route has no page, offset or cursor parameter, so a category that publishes more treatments than the limit cannot be read past it: truncated=true means the upstream returned exactly the limit, which is the only signal that more may exist (Hair and Health and fitness both sit at 40). A category with no treatments or an unknown category id answers an honest empty list, not an error. For query-driven discovery by free text use booksy-treatment-hints instead.",
"operationId": "booksy-treatments",
"parameters": [
{
"description": "Top-level category id from booksy-categories (integer, not a slug)",
"in": "query",
"name": "category",
"type": "integer",
"x-example": 6
},
{
"description": "Treatments to return, 1 to 40; defaults to 40, the upstream cap",
"in": "query",
"name": "limit",
"type": "integer",
"x-example": 40
},
{
"description": "Market host",
"enum": [
"ar",
"au",
"br",
"ca",
"cl",
"co",
"de",
"es",
"fr",
"gb",
"ie",
"it",
"mx",
"nl",
"pl",
"pt",
"us",
"za"
],
"in": "query",
"name": "country",
"type": "string",
"x-example": "us"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/booksy.treatmentsResponseDoc"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/app.Response"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/app.Response"
}
}
},
"security": [
{
"ApiKeyAuth": []
}
],
"summary": "Discover Booksy treatment ids for one category",
"tags": [
"Booksy"
]
}
},
"/boots/search": {
"get": {
"description": "Returns one page of Boots UK's public product catalog, including product cards and live facets. Supply `q`, one or more hierarchical `category` keys, or both. Use repeatable `filter=facet_key:option_key` values from that response's dynamic facets, plus the dedicated price and stock controls. `sort` accepts `relevance`, `price_low_to_high`, `price_high_to_low`, `top_rated`, `best_seller`, or `newest`.",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def transport(_request, _timeout):

def test_operation_metadata_count(self) -> None:
self.assertEqual(len(OPERATIONS), OPERATION_COUNT)
self.assertEqual(OPERATION_COUNT, 5590)
self.assertEqual(OPERATION_COUNT, 5591)

def test_deprecated_endpoints_are_not_generated(self) -> None:
self.assertFalse(hasattr(CrawloraClient(api_key="api_test", base_url=self.base_url).google, "lens"))
Expand Down Expand Up @@ -301,7 +301,7 @@ def test_docs_cover_operations_and_recipes(self):
recipes_doc = root.joinpath("docs", "recipes.md").read_text()

for expected in [
"Total operations: `5590`",
"Total operations: `5591`",
"`bing-search`",
"`GET /bing/search`",
"`bing.search`",
Expand Down
Loading