watchlogdev 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.
- watchlog/__init__.py +59 -0
- watchlog/_endpoints.py +62 -0
- watchlog/_operations.py +509 -0
- watchlog/_response.py +91 -0
- watchlog/_serialization.py +122 -0
- watchlog/_version.py +1 -0
- watchlog/client.py +452 -0
- watchlog/errors.py +76 -0
- watchlog/models.py +81 -0
- watchlog/py.typed +1 -0
- watchlogdev-0.1.0.dist-info/METADATA +208 -0
- watchlogdev-0.1.0.dist-info/RECORD +14 -0
- watchlogdev-0.1.0.dist-info/WHEEL +4 -0
- watchlogdev-0.1.0.dist-info/licenses/LICENSE +21 -0
watchlog/__init__.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Official Python SDK for the Watchlog API."""
|
|
2
|
+
|
|
3
|
+
from ._endpoints import ENDPOINTS
|
|
4
|
+
from ._version import __version__
|
|
5
|
+
from .client import (
|
|
6
|
+
DEFAULT_BASE_URL,
|
|
7
|
+
DEFAULT_CONCURRENCY,
|
|
8
|
+
DEFAULT_RETRY_DELAY,
|
|
9
|
+
DEFAULT_TIMEOUT,
|
|
10
|
+
MAX_RETRIES,
|
|
11
|
+
RETRY_BACKOFF_FACTOR,
|
|
12
|
+
AsyncWatchlogClient,
|
|
13
|
+
WatchlogClient,
|
|
14
|
+
)
|
|
15
|
+
from .errors import (
|
|
16
|
+
WatchlogAPIError,
|
|
17
|
+
WatchlogConfigurationError,
|
|
18
|
+
WatchlogError,
|
|
19
|
+
WatchlogResponseDecodingError,
|
|
20
|
+
WatchlogSerializationError,
|
|
21
|
+
WatchlogTransportError,
|
|
22
|
+
)
|
|
23
|
+
from .models import (
|
|
24
|
+
APIResponse,
|
|
25
|
+
BatchResult,
|
|
26
|
+
BinaryResponse,
|
|
27
|
+
EndpointDefinition,
|
|
28
|
+
HTTPMethod,
|
|
29
|
+
JsonResponse,
|
|
30
|
+
RawResponse,
|
|
31
|
+
RequestOptions,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
__all__ = [
|
|
35
|
+
"APIResponse",
|
|
36
|
+
"AsyncWatchlogClient",
|
|
37
|
+
"BatchResult",
|
|
38
|
+
"BinaryResponse",
|
|
39
|
+
"DEFAULT_BASE_URL",
|
|
40
|
+
"DEFAULT_CONCURRENCY",
|
|
41
|
+
"DEFAULT_RETRY_DELAY",
|
|
42
|
+
"DEFAULT_TIMEOUT",
|
|
43
|
+
"MAX_RETRIES",
|
|
44
|
+
"RETRY_BACKOFF_FACTOR",
|
|
45
|
+
"ENDPOINTS",
|
|
46
|
+
"EndpointDefinition",
|
|
47
|
+
"HTTPMethod",
|
|
48
|
+
"JsonResponse",
|
|
49
|
+
"RawResponse",
|
|
50
|
+
"RequestOptions",
|
|
51
|
+
"WatchlogAPIError",
|
|
52
|
+
"WatchlogClient",
|
|
53
|
+
"WatchlogConfigurationError",
|
|
54
|
+
"WatchlogError",
|
|
55
|
+
"WatchlogResponseDecodingError",
|
|
56
|
+
"WatchlogSerializationError",
|
|
57
|
+
"WatchlogTransportError",
|
|
58
|
+
"__version__",
|
|
59
|
+
]
|
watchlog/_endpoints.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Generated from the Watchlog OpenAPI document. Do not edit by hand."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .models import EndpointDefinition
|
|
6
|
+
|
|
7
|
+
ENDPOINTS: dict[str, EndpointDefinition] = {
|
|
8
|
+
"check_product": EndpointDefinition(
|
|
9
|
+
path="/products/{id}/check",
|
|
10
|
+
methods=("POST",),
|
|
11
|
+
response="json",
|
|
12
|
+
required=("id",),
|
|
13
|
+
),
|
|
14
|
+
"delete_product": EndpointDefinition(
|
|
15
|
+
path="/products/{id}",
|
|
16
|
+
methods=("DELETE",),
|
|
17
|
+
response="json",
|
|
18
|
+
required=("id",),
|
|
19
|
+
),
|
|
20
|
+
"get_account": EndpointDefinition(
|
|
21
|
+
path="/account",
|
|
22
|
+
methods=("GET",),
|
|
23
|
+
response="json",
|
|
24
|
+
required=(),
|
|
25
|
+
),
|
|
26
|
+
"get_product": EndpointDefinition(
|
|
27
|
+
path="/products/{id}",
|
|
28
|
+
methods=("GET",),
|
|
29
|
+
response="json",
|
|
30
|
+
required=("id",),
|
|
31
|
+
),
|
|
32
|
+
"get_watch_history": EndpointDefinition(
|
|
33
|
+
path="/history",
|
|
34
|
+
methods=("GET",),
|
|
35
|
+
response="json",
|
|
36
|
+
required=("watch_id",),
|
|
37
|
+
),
|
|
38
|
+
"list_products": EndpointDefinition(
|
|
39
|
+
path="/products",
|
|
40
|
+
methods=("GET",),
|
|
41
|
+
response="json",
|
|
42
|
+
required=(),
|
|
43
|
+
),
|
|
44
|
+
"search_watches": EndpointDefinition(
|
|
45
|
+
path="/search",
|
|
46
|
+
methods=("GET",),
|
|
47
|
+
response="json",
|
|
48
|
+
required=("query",),
|
|
49
|
+
),
|
|
50
|
+
"track_product": EndpointDefinition(
|
|
51
|
+
path="/products",
|
|
52
|
+
methods=("POST",),
|
|
53
|
+
response="json",
|
|
54
|
+
required=("product",),
|
|
55
|
+
),
|
|
56
|
+
"update_product": EndpointDefinition(
|
|
57
|
+
path="/products/{id}",
|
|
58
|
+
methods=("PATCH",),
|
|
59
|
+
response="json",
|
|
60
|
+
required=("id",),
|
|
61
|
+
),
|
|
62
|
+
}
|
watchlog/_operations.py
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
"""Generated from the Watchlog OpenAPI document. Do not edit by hand."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, Literal, cast
|
|
6
|
+
|
|
7
|
+
from ._serialization import JSON_NULL
|
|
8
|
+
from .models import APIResponse, JsonResponse, RequestOptions
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class _SyncOperations:
|
|
12
|
+
"""Generated Watchlog endpoint methods."""
|
|
13
|
+
|
|
14
|
+
__slots__ = ()
|
|
15
|
+
|
|
16
|
+
def _call(
|
|
17
|
+
self, name: str, params: dict[str, Any], options: RequestOptions | None
|
|
18
|
+
) -> APIResponse:
|
|
19
|
+
raise NotImplementedError
|
|
20
|
+
|
|
21
|
+
def check_product(
|
|
22
|
+
self,
|
|
23
|
+
*,
|
|
24
|
+
id: str,
|
|
25
|
+
wait: bool | None = None,
|
|
26
|
+
request_options: RequestOptions | None = None,
|
|
27
|
+
) -> JsonResponse:
|
|
28
|
+
"""Check the price now. Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be resumed first. The check runs in the background; with wait=true the answer waits for it. Read last_e…
|
|
29
|
+
|
|
30
|
+
``POST /products/{id}/check``
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
id: product_id returned when the product was added
|
|
34
|
+
wait: Answer once the check is done (up to 45 seconds)
|
|
35
|
+
"""
|
|
36
|
+
return cast(
|
|
37
|
+
JsonResponse, self._call("check_product", {"id": id, "wait": wait}, request_options)
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
def delete_product(
|
|
41
|
+
self,
|
|
42
|
+
*,
|
|
43
|
+
id: str,
|
|
44
|
+
request_options: RequestOptions | None = None,
|
|
45
|
+
) -> JsonResponse:
|
|
46
|
+
"""Stop tracking a product. Removes the product and its price history.
|
|
47
|
+
|
|
48
|
+
``DELETE /products/{id}``
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
id: product_id returned when the product was added
|
|
52
|
+
"""
|
|
53
|
+
return cast(JsonResponse, self._call("delete_product", {"id": id}, request_options))
|
|
54
|
+
|
|
55
|
+
def get_account(
|
|
56
|
+
self,
|
|
57
|
+
*,
|
|
58
|
+
request_options: RequestOptions | None = None,
|
|
59
|
+
) -> JsonResponse:
|
|
60
|
+
"""Plan and remaining credits. Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month, the credits each alert email costs, the days of history you can read and, on the free plan, the API and MCP requests…
|
|
61
|
+
|
|
62
|
+
``GET /account``
|
|
63
|
+
"""
|
|
64
|
+
return cast(JsonResponse, self._call("get_account", {}, request_options))
|
|
65
|
+
|
|
66
|
+
def get_product(
|
|
67
|
+
self,
|
|
68
|
+
*,
|
|
69
|
+
id: str,
|
|
70
|
+
days: int | None = None,
|
|
71
|
+
request_options: RequestOptions | None = None,
|
|
72
|
+
) -> JsonResponse:
|
|
73
|
+
"""Get a product and its price history. The product's latest state and every price read of the period, oldest first. The history covers every read of this reference on this marketplace, including those made before you added it, so a product added today can come with months of pr…
|
|
74
|
+
|
|
75
|
+
``GET /products/{id}``
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
id: product_id returned when the product was added
|
|
79
|
+
days: History period in days. The free plan reads the last 30: history_days says which period was returned.
|
|
80
|
+
"""
|
|
81
|
+
return cast(
|
|
82
|
+
JsonResponse, self._call("get_product", {"id": id, "days": days}, request_options)
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
def get_watch_history(
|
|
86
|
+
self,
|
|
87
|
+
*,
|
|
88
|
+
watch_id: str,
|
|
89
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
90
|
+
days: int | None = None,
|
|
91
|
+
request_options: RequestOptions | None = None,
|
|
92
|
+
) -> JsonResponse:
|
|
93
|
+
"""Price history of any watch. Every price Watchlog read for a reference or listing id in a currency over the period, whoever tracks it, oldest first, with the lowest, highest and average of those prices. A model with filters (126610LN:used:europe) has its own history,…
|
|
94
|
+
|
|
95
|
+
``GET /history``
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
watch_id: watch reference number (126610LN), optionally narrowed to a condition and sellers' region (126610LN:used:europe), or listing id (id49860660)
|
|
99
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
100
|
+
days: History period in days. The free plan reads the last 30: history_days says which period was returned.
|
|
101
|
+
"""
|
|
102
|
+
return cast(
|
|
103
|
+
JsonResponse,
|
|
104
|
+
self._call(
|
|
105
|
+
"get_watch_history",
|
|
106
|
+
{"watch_id": watch_id, "marketplace": marketplace, "days": days},
|
|
107
|
+
request_options,
|
|
108
|
+
),
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
def list_products(
|
|
112
|
+
self,
|
|
113
|
+
*,
|
|
114
|
+
watch_id: str | None = None,
|
|
115
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
116
|
+
filter: Literal["all", "drops", "target", "out_of_stock", "attention", "paused"]
|
|
117
|
+
| str
|
|
118
|
+
| None = None,
|
|
119
|
+
page: int | None = None,
|
|
120
|
+
limit: int | None = None,
|
|
121
|
+
request_options: RequestOptions | None = None,
|
|
122
|
+
) -> JsonResponse:
|
|
123
|
+
"""List tracked products. Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with watch_id (and marketplace) to know if a product is tracked, or with filter to get the same lists as the app's tabs.
|
|
124
|
+
|
|
125
|
+
``GET /products``
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
watch_id: Only this reference
|
|
129
|
+
marketplace: Only watches priced in this currency
|
|
130
|
+
filter: Only the products of one of the app's watchlist filters. all: Every tracked product (default). drops: Cheaper now than when the product was added. target: At or below its target price. out_of_stock:…
|
|
131
|
+
page: Page number
|
|
132
|
+
limit: Products per page
|
|
133
|
+
"""
|
|
134
|
+
return cast(
|
|
135
|
+
JsonResponse,
|
|
136
|
+
self._call(
|
|
137
|
+
"list_products",
|
|
138
|
+
{
|
|
139
|
+
"watch_id": watch_id,
|
|
140
|
+
"marketplace": marketplace,
|
|
141
|
+
"filter": filter,
|
|
142
|
+
"page": page,
|
|
143
|
+
"limit": limit,
|
|
144
|
+
},
|
|
145
|
+
request_options,
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
def search_watches(
|
|
150
|
+
self,
|
|
151
|
+
*,
|
|
152
|
+
query: str,
|
|
153
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
154
|
+
request_options: RequestOptions | None = None,
|
|
155
|
+
) -> JsonResponse:
|
|
156
|
+
"""Search watches. Watch models matching the keywords first (watch_id is their reference number, price the lowest asking price last seen across the whole market), then current listings (watch_id is the listing id, price its asking price), to find what to tra…
|
|
157
|
+
|
|
158
|
+
``GET /search``
|
|
159
|
+
|
|
160
|
+
Args:
|
|
161
|
+
query: Keywords
|
|
162
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
163
|
+
"""
|
|
164
|
+
return cast(
|
|
165
|
+
JsonResponse,
|
|
166
|
+
self._call(
|
|
167
|
+
"search_watches", {"query": query, "marketplace": marketplace}, request_options
|
|
168
|
+
),
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
def track_product(
|
|
172
|
+
self,
|
|
173
|
+
*,
|
|
174
|
+
product: str,
|
|
175
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
176
|
+
target_price: int | float | None = None,
|
|
177
|
+
interval_minutes: int | None = None,
|
|
178
|
+
wait: bool | None = None,
|
|
179
|
+
request_options: RequestOptions | None = None,
|
|
180
|
+
) -> JsonResponse:
|
|
181
|
+
"""Track a watch. Adds a watch to your watchlist: a model by its reference number (126610LN), priced at the lowest asking price among the current listings that match its filters, with how many there are as stock; or one listing by its id (id49860660) or its…
|
|
182
|
+
|
|
183
|
+
``POST /products``
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
product: Reference number (126610LN), with its filters if any (126610LN:used:europe), listing id (id49860660) or listing link
|
|
187
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
188
|
+
target_price: Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
|
|
189
|
+
interval_minutes: Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 5 with Business.
|
|
190
|
+
wait: Answer once the first check is done (up to 45 seconds)
|
|
191
|
+
"""
|
|
192
|
+
return cast(
|
|
193
|
+
JsonResponse,
|
|
194
|
+
self._call(
|
|
195
|
+
"track_product",
|
|
196
|
+
{
|
|
197
|
+
"product": product,
|
|
198
|
+
"marketplace": marketplace,
|
|
199
|
+
"target_price": target_price,
|
|
200
|
+
"interval_minutes": interval_minutes,
|
|
201
|
+
"wait": wait,
|
|
202
|
+
},
|
|
203
|
+
request_options,
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
def update_product(
|
|
208
|
+
self,
|
|
209
|
+
*,
|
|
210
|
+
id: str,
|
|
211
|
+
target_price: int | float | None = None,
|
|
212
|
+
interval_minutes: int | None = None,
|
|
213
|
+
alert_on_drop: bool | None = None,
|
|
214
|
+
paused: bool | None = None,
|
|
215
|
+
request_options: RequestOptions | None = None,
|
|
216
|
+
) -> JsonResponse:
|
|
217
|
+
"""Change alerts and checks. Target price, drop alerts, check interval, or pause. Send only what changes. On the free plan, alerts (price drop, back on the market, target price) email for the first 5 products added among the active ones with an alert set; the others s…
|
|
218
|
+
|
|
219
|
+
``PATCH /products/{id}``
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
id: product_id returned when the product was added
|
|
223
|
+
target_price: Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
|
|
224
|
+
interval_minutes: Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 5 with Business.
|
|
225
|
+
alert_on_drop: Email when the price drops or the product is back in stock (on the free plan, for the first 5 products with an alert)
|
|
226
|
+
paused: Stop checking (and charging) for now; false resumes
|
|
227
|
+
"""
|
|
228
|
+
return cast(
|
|
229
|
+
JsonResponse,
|
|
230
|
+
self._call(
|
|
231
|
+
"update_product",
|
|
232
|
+
{
|
|
233
|
+
"id": id,
|
|
234
|
+
"target_price": target_price,
|
|
235
|
+
"interval_minutes": interval_minutes,
|
|
236
|
+
"alert_on_drop": alert_on_drop,
|
|
237
|
+
"paused": paused,
|
|
238
|
+
},
|
|
239
|
+
request_options,
|
|
240
|
+
),
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
def clear_target_price(
|
|
244
|
+
self, *, id: str, request_options: RequestOptions | None = None
|
|
245
|
+
) -> JsonResponse:
|
|
246
|
+
"""Remove the product's target price.
|
|
247
|
+
|
|
248
|
+
``PATCH /products/{id}`` with the body ``{"target_price": null}``. ``update_product(target_price=None)``
|
|
249
|
+
cannot do it, because ``None`` values are never sent.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
id: product_id returned when the product was added
|
|
253
|
+
"""
|
|
254
|
+
return cast(
|
|
255
|
+
JsonResponse,
|
|
256
|
+
self._call("update_product", {"id": id, "target_price": JSON_NULL}, request_options),
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
class _AsyncOperations:
|
|
261
|
+
"""Generated Watchlog endpoint methods."""
|
|
262
|
+
|
|
263
|
+
__slots__ = ()
|
|
264
|
+
|
|
265
|
+
async def _call(
|
|
266
|
+
self, name: str, params: dict[str, Any], options: RequestOptions | None
|
|
267
|
+
) -> APIResponse:
|
|
268
|
+
raise NotImplementedError
|
|
269
|
+
|
|
270
|
+
async def check_product(
|
|
271
|
+
self,
|
|
272
|
+
*,
|
|
273
|
+
id: str,
|
|
274
|
+
wait: bool | None = None,
|
|
275
|
+
request_options: RequestOptions | None = None,
|
|
276
|
+
) -> JsonResponse:
|
|
277
|
+
"""Check the price now. Asks for a check right away (1 credit), at most once per 5 minutes; earlier calls return the product unchanged. A paused product has to be resumed first. The check runs in the background; with wait=true the answer waits for it. Read last_e…
|
|
278
|
+
|
|
279
|
+
``POST /products/{id}/check``
|
|
280
|
+
|
|
281
|
+
Args:
|
|
282
|
+
id: product_id returned when the product was added
|
|
283
|
+
wait: Answer once the check is done (up to 45 seconds)
|
|
284
|
+
"""
|
|
285
|
+
return cast(
|
|
286
|
+
JsonResponse,
|
|
287
|
+
await self._call("check_product", {"id": id, "wait": wait}, request_options),
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
async def delete_product(
|
|
291
|
+
self,
|
|
292
|
+
*,
|
|
293
|
+
id: str,
|
|
294
|
+
request_options: RequestOptions | None = None,
|
|
295
|
+
) -> JsonResponse:
|
|
296
|
+
"""Stop tracking a product. Removes the product and its price history.
|
|
297
|
+
|
|
298
|
+
``DELETE /products/{id}``
|
|
299
|
+
|
|
300
|
+
Args:
|
|
301
|
+
id: product_id returned when the product was added
|
|
302
|
+
"""
|
|
303
|
+
return cast(JsonResponse, await self._call("delete_product", {"id": id}, request_options))
|
|
304
|
+
|
|
305
|
+
async def get_account(
|
|
306
|
+
self,
|
|
307
|
+
*,
|
|
308
|
+
request_options: RequestOptions | None = None,
|
|
309
|
+
) -> JsonResponse:
|
|
310
|
+
"""Plan and remaining credits. Your plan, the credits left (monthly allowance and packs), how many products you track and the credits they use per month, the credits each alert email costs, the days of history you can read and, on the free plan, the API and MCP requests…
|
|
311
|
+
|
|
312
|
+
``GET /account``
|
|
313
|
+
"""
|
|
314
|
+
return cast(JsonResponse, await self._call("get_account", {}, request_options))
|
|
315
|
+
|
|
316
|
+
async def get_product(
|
|
317
|
+
self,
|
|
318
|
+
*,
|
|
319
|
+
id: str,
|
|
320
|
+
days: int | None = None,
|
|
321
|
+
request_options: RequestOptions | None = None,
|
|
322
|
+
) -> JsonResponse:
|
|
323
|
+
"""Get a product and its price history. The product's latest state and every price read of the period, oldest first. The history covers every read of this reference on this marketplace, including those made before you added it, so a product added today can come with months of pr…
|
|
324
|
+
|
|
325
|
+
``GET /products/{id}``
|
|
326
|
+
|
|
327
|
+
Args:
|
|
328
|
+
id: product_id returned when the product was added
|
|
329
|
+
days: History period in days. The free plan reads the last 30: history_days says which period was returned.
|
|
330
|
+
"""
|
|
331
|
+
return cast(
|
|
332
|
+
JsonResponse, await self._call("get_product", {"id": id, "days": days}, request_options)
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def get_watch_history(
|
|
336
|
+
self,
|
|
337
|
+
*,
|
|
338
|
+
watch_id: str,
|
|
339
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
340
|
+
days: int | None = None,
|
|
341
|
+
request_options: RequestOptions | None = None,
|
|
342
|
+
) -> JsonResponse:
|
|
343
|
+
"""Price history of any watch. Every price Watchlog read for a reference or listing id in a currency over the period, whoever tracks it, oldest first, with the lowest, highest and average of those prices. A model with filters (126610LN:used:europe) has its own history,…
|
|
344
|
+
|
|
345
|
+
``GET /history``
|
|
346
|
+
|
|
347
|
+
Args:
|
|
348
|
+
watch_id: watch reference number (126610LN), optionally narrowed to a condition and sellers' region (126610LN:used:europe), or listing id (id49860660)
|
|
349
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
350
|
+
days: History period in days. The free plan reads the last 30: history_days says which period was returned.
|
|
351
|
+
"""
|
|
352
|
+
return cast(
|
|
353
|
+
JsonResponse,
|
|
354
|
+
await self._call(
|
|
355
|
+
"get_watch_history",
|
|
356
|
+
{"watch_id": watch_id, "marketplace": marketplace, "days": days},
|
|
357
|
+
request_options,
|
|
358
|
+
),
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
async def list_products(
|
|
362
|
+
self,
|
|
363
|
+
*,
|
|
364
|
+
watch_id: str | None = None,
|
|
365
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
366
|
+
filter: Literal["all", "drops", "target", "out_of_stock", "attention", "paused"]
|
|
367
|
+
| str
|
|
368
|
+
| None = None,
|
|
369
|
+
page: int | None = None,
|
|
370
|
+
limit: int | None = None,
|
|
371
|
+
request_options: RequestOptions | None = None,
|
|
372
|
+
) -> JsonResponse:
|
|
373
|
+
"""List tracked products. Your watchlist, newest first, with each product's latest state and its recent prices (trend). Filter with watch_id (and marketplace) to know if a product is tracked, or with filter to get the same lists as the app's tabs.
|
|
374
|
+
|
|
375
|
+
``GET /products``
|
|
376
|
+
|
|
377
|
+
Args:
|
|
378
|
+
watch_id: Only this reference
|
|
379
|
+
marketplace: Only watches priced in this currency
|
|
380
|
+
filter: Only the products of one of the app's watchlist filters. all: Every tracked product (default). drops: Cheaper now than when the product was added. target: At or below its target price. out_of_stock:…
|
|
381
|
+
page: Page number
|
|
382
|
+
limit: Products per page
|
|
383
|
+
"""
|
|
384
|
+
return cast(
|
|
385
|
+
JsonResponse,
|
|
386
|
+
await self._call(
|
|
387
|
+
"list_products",
|
|
388
|
+
{
|
|
389
|
+
"watch_id": watch_id,
|
|
390
|
+
"marketplace": marketplace,
|
|
391
|
+
"filter": filter,
|
|
392
|
+
"page": page,
|
|
393
|
+
"limit": limit,
|
|
394
|
+
},
|
|
395
|
+
request_options,
|
|
396
|
+
),
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
async def search_watches(
|
|
400
|
+
self,
|
|
401
|
+
*,
|
|
402
|
+
query: str,
|
|
403
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
404
|
+
request_options: RequestOptions | None = None,
|
|
405
|
+
) -> JsonResponse:
|
|
406
|
+
"""Search watches. Watch models matching the keywords first (watch_id is their reference number, price the lowest asking price last seen across the whole market), then current listings (watch_id is the listing id, price its asking price), to find what to tra…
|
|
407
|
+
|
|
408
|
+
``GET /search``
|
|
409
|
+
|
|
410
|
+
Args:
|
|
411
|
+
query: Keywords
|
|
412
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
413
|
+
"""
|
|
414
|
+
return cast(
|
|
415
|
+
JsonResponse,
|
|
416
|
+
await self._call(
|
|
417
|
+
"search_watches", {"query": query, "marketplace": marketplace}, request_options
|
|
418
|
+
),
|
|
419
|
+
)
|
|
420
|
+
|
|
421
|
+
async def track_product(
|
|
422
|
+
self,
|
|
423
|
+
*,
|
|
424
|
+
product: str,
|
|
425
|
+
marketplace: Literal["com", "eu", "co.uk"] | str | None = None,
|
|
426
|
+
target_price: int | float | None = None,
|
|
427
|
+
interval_minutes: int | None = None,
|
|
428
|
+
wait: bool | None = None,
|
|
429
|
+
request_options: RequestOptions | None = None,
|
|
430
|
+
) -> JsonResponse:
|
|
431
|
+
"""Track a watch. Adds a watch to your watchlist: a model by its reference number (126610LN), priced at the lowest asking price among the current listings that match its filters, with how many there are as stock; or one listing by its id (id49860660) or its…
|
|
432
|
+
|
|
433
|
+
``POST /products``
|
|
434
|
+
|
|
435
|
+
Args:
|
|
436
|
+
product: Reference number (126610LN), with its filters if any (126610LN:used:europe), listing id (id49860660) or listing link
|
|
437
|
+
marketplace: Currency of the prices: com (USD), eu (EUR), co.uk (GBP)
|
|
438
|
+
target_price: Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
|
|
439
|
+
interval_minutes: Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 5 with Business.
|
|
440
|
+
wait: Answer once the first check is done (up to 45 seconds)
|
|
441
|
+
"""
|
|
442
|
+
return cast(
|
|
443
|
+
JsonResponse,
|
|
444
|
+
await self._call(
|
|
445
|
+
"track_product",
|
|
446
|
+
{
|
|
447
|
+
"product": product,
|
|
448
|
+
"marketplace": marketplace,
|
|
449
|
+
"target_price": target_price,
|
|
450
|
+
"interval_minutes": interval_minutes,
|
|
451
|
+
"wait": wait,
|
|
452
|
+
},
|
|
453
|
+
request_options,
|
|
454
|
+
),
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
async def update_product(
|
|
458
|
+
self,
|
|
459
|
+
*,
|
|
460
|
+
id: str,
|
|
461
|
+
target_price: int | float | None = None,
|
|
462
|
+
interval_minutes: int | None = None,
|
|
463
|
+
alert_on_drop: bool | None = None,
|
|
464
|
+
paused: bool | None = None,
|
|
465
|
+
request_options: RequestOptions | None = None,
|
|
466
|
+
) -> JsonResponse:
|
|
467
|
+
"""Change alerts and checks. Target price, drop alerts, check interval, or pause. Send only what changes. On the free plan, alerts (price drop, back on the market, target price) email for the first 5 products added among the active ones with an alert set; the others s…
|
|
468
|
+
|
|
469
|
+
``PATCH /products/{id}``
|
|
470
|
+
|
|
471
|
+
Args:
|
|
472
|
+
id: product_id returned when the product was added
|
|
473
|
+
target_price: Email the owner when the price goes at or below this amount (on the free plan, for the first 5 products with an alert). null removes it.
|
|
474
|
+
interval_minutes: Minutes between two checks (1440 = daily). Checks faster than daily need a plan or a credit pack: every 60 minutes with a pack or Starter, 30 with Pro, 5 with Business.
|
|
475
|
+
alert_on_drop: Email when the price drops or the product is back in stock (on the free plan, for the first 5 products with an alert)
|
|
476
|
+
paused: Stop checking (and charging) for now; false resumes
|
|
477
|
+
"""
|
|
478
|
+
return cast(
|
|
479
|
+
JsonResponse,
|
|
480
|
+
await self._call(
|
|
481
|
+
"update_product",
|
|
482
|
+
{
|
|
483
|
+
"id": id,
|
|
484
|
+
"target_price": target_price,
|
|
485
|
+
"interval_minutes": interval_minutes,
|
|
486
|
+
"alert_on_drop": alert_on_drop,
|
|
487
|
+
"paused": paused,
|
|
488
|
+
},
|
|
489
|
+
request_options,
|
|
490
|
+
),
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
async def clear_target_price(
|
|
494
|
+
self, *, id: str, request_options: RequestOptions | None = None
|
|
495
|
+
) -> JsonResponse:
|
|
496
|
+
"""Remove the product's target price.
|
|
497
|
+
|
|
498
|
+
``PATCH /products/{id}`` with the body ``{"target_price": null}``. ``update_product(target_price=None)``
|
|
499
|
+
cannot do it, because ``None`` values are never sent.
|
|
500
|
+
|
|
501
|
+
Args:
|
|
502
|
+
id: product_id returned when the product was added
|
|
503
|
+
"""
|
|
504
|
+
return cast(
|
|
505
|
+
JsonResponse,
|
|
506
|
+
await self._call(
|
|
507
|
+
"update_product", {"id": id, "target_price": JSON_NULL}, request_options
|
|
508
|
+
),
|
|
509
|
+
)
|