scavio 0.16.0 → 0.18.1
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.
- package/README.md +109 -20
- package/dist/index.cjs +177 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +364 -4
- package/dist/index.d.ts +364 -4
- package/dist/index.js +176 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Scavio
|
|
2
2
|
|
|
3
|
-
TypeScript SDK for the [Scavio API](https://scavio.dev) — real-time web scraping
|
|
4
|
-
and data extraction across
|
|
3
|
+
TypeScript SDK for the [Scavio API](https://scavio.dev?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) — real-time web scraping
|
|
4
|
+
and data extraction across 32 platforms on one API key, plus `extract()` to read
|
|
5
5
|
any URL as clean Markdown.
|
|
6
6
|
|
|
7
7
|
Structured JSON in, structured JSON out. No proxies, no headless browsers, no
|
|
8
8
|
per-site parsers to maintain.
|
|
9
9
|
|
|
10
10
|
- **Search and SERP** — Google (organic, news, maps, shopping, flights, hotels, trends, AI Mode)
|
|
11
|
-
- **E-commerce** — Amazon, Walmart, eBay, Target, Home Depot, TikTok Shop
|
|
11
|
+
- **E-commerce** — Amazon, Walmart, Costco, eBay, Target, Home Depot, TikTok Shop
|
|
12
12
|
- **Real estate and travel** — Zillow, Redfin, Booking, Airbnb, Tripadvisor
|
|
13
13
|
- **Reviews and local** — Yelp, G2, Capterra, Glassdoor, App Store, Google Play
|
|
14
14
|
- **Jobs and companies** — Indeed, Glassdoor, SEC EDGAR, Companies House
|
|
@@ -66,6 +66,10 @@ limit on simultaneous in-flight requests: 1 on free and pay-as-you-go, 5 on
|
|
|
66
66
|
Project, 10 on Bootstrap, 15 on Startup, 50 on Growth, and unlimited on
|
|
67
67
|
Enterprise.
|
|
68
68
|
|
|
69
|
+
Every request carries `X-Client-Source: scavio-js`. From Node.js (and other
|
|
70
|
+
server runtimes) it also sends `User-Agent: scavio-js/<version>` (since 0.18.1);
|
|
71
|
+
browsers do not allow a script to set `User-Agent`, so it is omitted there.
|
|
72
|
+
|
|
69
73
|
## API Reference
|
|
70
74
|
|
|
71
75
|
### Extract (any URL)
|
|
@@ -178,8 +182,8 @@ instead of the previous raw provider payload.
|
|
|
178
182
|
|
|
179
183
|
### Walmart
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
Eight endpoints. `stores` and store targeting on `search` / `product` are new in
|
|
186
|
+
0.17.0.
|
|
183
187
|
|
|
184
188
|
```typescript
|
|
185
189
|
await client.walmart.search({
|
|
@@ -197,18 +201,49 @@ await client.walmart.category({ category_id: "3944_133251_1095191" });
|
|
|
197
201
|
await client.walmart.offers({ product_id: "13544111159" });
|
|
198
202
|
await client.walmart.seller({ seller_id: "101138578" });
|
|
199
203
|
await client.walmart.sellerProducts({ seller_id: "101138578" });
|
|
204
|
+
|
|
205
|
+
// Store targeting: find stores for a ZIP, then pass one with the ZIP.
|
|
206
|
+
const { data } = await client.walmart.stores({ zipcode: "50036" });
|
|
207
|
+
await client.walmart.search({
|
|
208
|
+
query: "whole milk",
|
|
209
|
+
delivery_zip: "50036",
|
|
210
|
+
store_id: data.stores[0].store_id!, // "1389", Boone Supercenter
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// walmart.ca works the same way with a postal code and domain "ca".
|
|
214
|
+
await client.walmart.stores({ zipcode: "M5V 2T6", domain: "ca" });
|
|
215
|
+
await client.walmart.product({
|
|
216
|
+
product_id: "10220526",
|
|
217
|
+
domain: "ca",
|
|
218
|
+
delivery_zip: "M5V 2T6",
|
|
219
|
+
store_id: "3106",
|
|
220
|
+
});
|
|
200
221
|
```
|
|
201
222
|
|
|
202
|
-
Credits are a function of the body
|
|
203
|
-
"ca"
|
|
223
|
+
Credits are a function of the body: `search` and `category` cost 1 credit on
|
|
224
|
+
`domain` "com" or "ca" and 2 on "com.mx"; a store-targeted `search` or `product`
|
|
225
|
+
costs 2. `stores` and the other endpoints cost 1.
|
|
226
|
+
|
|
227
|
+
#### Walmart store targeting (0.17.0)
|
|
228
|
+
|
|
229
|
+
- `delivery_zip` and `store_id` must be sent **together**, on `search` or
|
|
230
|
+
`product`. They work on walmart.com and walmart.ca (`domain: "ca"` with a
|
|
231
|
+
Canadian postal code); walmart.com.mx does not support store targeting.
|
|
232
|
+
- Get `store_id` from `stores()` on the same domain. `store_id` decides the
|
|
233
|
+
store; `data.location` in the response confirms which store was used.
|
|
234
|
+
- Store-targeted calls take 10-60 seconds — set a generous timeout. A
|
|
235
|
+
`store_id` that does not exist returns 400, and a product the store does not
|
|
236
|
+
carry returns 404.
|
|
237
|
+
- `product` accepts `domain: "ca"` only together with a store target.
|
|
204
238
|
|
|
205
239
|
#### Walmart changed in 0.15.0 (breaking)
|
|
206
240
|
|
|
207
|
-
- `device
|
|
208
|
-
|
|
241
|
+
- `device` is retired. Sending it still returns 200, with a top-level `warnings`
|
|
242
|
+
array naming what was ignored. (`delivery_zip` and `store_id` were retired in
|
|
243
|
+
0.15.0 and came back in 0.17.0 as store targeting.)
|
|
209
244
|
- `domain` is **not** retired — it is the price-bearing param, and it is accepted
|
|
210
|
-
on `search` and `category
|
|
211
|
-
|
|
245
|
+
on `search` and `category`. Product-keyed endpoints are walmart.com only,
|
|
246
|
+
except `product` with a store target (0.17.0).
|
|
212
247
|
- `page` (1-indexed) is the paging param; `start_page` remains a deprecated alias.
|
|
213
248
|
- `sort_by` gained `rating_high` and `new`.
|
|
214
249
|
- `fulfillment_speed` is `today` or `tomorrow` only. There is deliberately no
|
|
@@ -219,6 +254,60 @@ Credits are a function of the body on `search` and `category`: `domain` "com" an
|
|
|
219
254
|
- `sellerProducts` has **no pagination** — roughly the first 40 server-rendered
|
|
220
255
|
items. `total_count` reports the seller's real catalog size.
|
|
221
256
|
|
|
257
|
+
### Costco
|
|
258
|
+
|
|
259
|
+
Thirteen endpoints, new in 0.18.0. `country` is `"us"` (costco.com, default) or
|
|
260
|
+
`"ca"` (costco.ca); `search`, `product` and `warehouses` also take `"uk"`,
|
|
261
|
+
`"au"`, `"mx"`, `"jp"`, `"kr"` and `"tw"` (keyword, sort and paging only).
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
// Warehouse numbers come from warehouses().
|
|
265
|
+
await client.costco.warehouses({ zip: "10025", limit: 3 });
|
|
266
|
+
|
|
267
|
+
// warehouse_id adds that warehouse's in-store price, stock and price code to
|
|
268
|
+
// every result on search, category and deals.
|
|
269
|
+
await client.costco.search({ query: "olive oil", warehouse_id: "1062", page_size: 5 });
|
|
270
|
+
await client.costco.category({ category: "televisions", sort_by: "price_low" });
|
|
271
|
+
await client.costco.categories(); // departments
|
|
272
|
+
await client.costco.categories({ category_id: "30001" }); // one department's tree
|
|
273
|
+
await client.costco.product({ item_ids: ["100334960", "1492456"] }); // up to 20
|
|
274
|
+
await client.costco.reviews({ product_id: "100334960", sort_by: "most_helpful" });
|
|
275
|
+
await client.costco.autocomplete({ query: "kirk" });
|
|
276
|
+
|
|
277
|
+
// Online vs in-warehouse price at up to 10 warehouses, with discount, final
|
|
278
|
+
// price, promotion dates and price code.
|
|
279
|
+
await client.costco.prices({ item_id: "1492456", warehouse_ids: ["1062", "1107"] });
|
|
280
|
+
|
|
281
|
+
// In-warehouse stock status (never a quantity), pickup and same-day delivery.
|
|
282
|
+
await client.costco.availability({ item_number: "1492456", warehouse_ids: ["1062"] });
|
|
283
|
+
|
|
284
|
+
// Regular, premium and diesel prices near a location, or at given warehouses.
|
|
285
|
+
await client.costco.gas({ zip: "90001" });
|
|
286
|
+
await client.costco.gas({ warehouse_ids: ["1062", "1107"] });
|
|
287
|
+
|
|
288
|
+
// The current member coupon book (US only, no parameters).
|
|
289
|
+
await client.costco.coupons();
|
|
290
|
+
|
|
291
|
+
// Deal feeds: new, while_supplies_last, treasure_hunt, member_favorites,
|
|
292
|
+
// online_only, on_sale.
|
|
293
|
+
await client.costco.deals({ type: "treasure_hunt", warehouse_id: "1062" });
|
|
294
|
+
|
|
295
|
+
// Markdown finder at one warehouse: .97 clearance and .00/.88 manager
|
|
296
|
+
// markdowns by default; add special_buy for .49/.79/.89 endings.
|
|
297
|
+
await client.costco.clearance({
|
|
298
|
+
warehouse_id: "1062",
|
|
299
|
+
query: "snacks",
|
|
300
|
+
price_codes: ["clearance", "manager_markdown", "special_buy"],
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
1 credit per call except where the body scales the work: `prices` costs 2 at 10
|
|
305
|
+
warehouses, `availability` 1 per 5 warehouses, `warehouses` 2 with
|
|
306
|
+
`country: "ca"`, and `gas` 2 by location on ca (by `warehouse_ids`, 1 per 5
|
|
307
|
+
warehouses on us and 2 per warehouse on ca). The clearance price codes are the
|
|
308
|
+
member-community decode of Costco shelf prices; Costco does not publish them,
|
|
309
|
+
and only items Costco lists online are covered.
|
|
310
|
+
|
|
222
311
|
### YouTube
|
|
223
312
|
|
|
224
313
|
Credit cost varies by endpoint: `transcript` costs 8; `streams` costs 3;
|
|
@@ -951,24 +1040,24 @@ MIT
|
|
|
951
1040
|
|
|
952
1041
|
## About Scavio
|
|
953
1042
|
|
|
954
|
-
[Scavio](https://scavio.dev) is a unified web data and
|
|
955
|
-
[search API for AI agents](https://scavio.dev/search-api-for-ai-agents) — one API
|
|
1043
|
+
[Scavio](https://scavio.dev?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) is a unified web data and
|
|
1044
|
+
[search API for AI agents](https://scavio.dev/search-api-for-ai-agents?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) — one API
|
|
956
1045
|
key, structured JSON, no proxies or browser farms to run. It is a real-time
|
|
957
|
-
[Tavily alternative](https://scavio.dev/alternatives/tavily) and
|
|
958
|
-
[SerpAPI alternative](https://scavio.dev/alternatives/serpapi), and with
|
|
1046
|
+
[Tavily alternative](https://scavio.dev/alternatives/tavily?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) and
|
|
1047
|
+
[SerpAPI alternative](https://scavio.dev/alternatives/serpapi?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), and with
|
|
959
1048
|
`extract()` it also covers the read-any-URL job people reach for Firecrawl to do.
|
|
960
1049
|
|
|
961
1050
|
What teams build on it:
|
|
962
1051
|
|
|
963
|
-
- **SERP and answer engines** — [Google Search API](https://scavio.dev/google-search-api) for organic results, news, images, maps and the knowledge graph
|
|
964
|
-
- **Price and catalog monitoring** — [Amazon Product API](https://scavio.dev/amazon-product-api), [Walmart Product API](https://scavio.dev/walmart-product-api), eBay, Target and Home Depot product, review and seller data
|
|
1052
|
+
- **SERP and answer engines** — [Google Search API](https://scavio.dev/google-search-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) for organic results, news, images, maps and the knowledge graph
|
|
1053
|
+
- **Price and catalog monitoring** — [Amazon Product API](https://scavio.dev/amazon-product-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [Walmart Product API](https://scavio.dev/walmart-product-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), eBay, Target and Home Depot product, review and seller data
|
|
965
1054
|
- **Real estate and travel pipelines** — Zillow and Redfin listings and market stats, Booking, Airbnb and Tripadvisor rates and reviews
|
|
966
1055
|
- **Review mining and competitive research** — Yelp, G2, Capterra, Glassdoor, App Store and Google Play reviews on one shape
|
|
967
1056
|
- **Recruiting and company intelligence** — Indeed jobs, Glassdoor salaries, SEC EDGAR filings and XBRL facts, UK Companies House officers and filing history
|
|
968
1057
|
- **Ad and creative intelligence** — Google Ads Transparency Center and Meta Ad Library creatives
|
|
969
|
-
- **Social listening** — [YouTube API](https://scavio.dev/youtube-transcript-api), [TikTok API](https://scavio.dev/tiktok-api), [Instagram API](https://scavio.dev/instagram-api), [Reddit API](https://scavio.dev/reddit-api), [X API](https://scavio.dev/docs/x-search), [LinkedIn API](https://scavio.dev/docs/linkedin-person), Threads and Kuaishou
|
|
1058
|
+
- **Social listening** — [YouTube API](https://scavio.dev/youtube-transcript-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [TikTok API](https://scavio.dev/tiktok-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [Instagram API](https://scavio.dev/instagram-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [Reddit API](https://scavio.dev/reddit-api?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [X API](https://scavio.dev/docs/x-search?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), [LinkedIn API](https://scavio.dev/docs/linkedin-person?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme), Threads and Kuaishou
|
|
970
1059
|
- **RAG ingestion** — `extract()` reads any URL and hands back readability Markdown ready to chunk and embed
|
|
971
1060
|
|
|
972
|
-
Teams choosing between providers can [compare Scavio vs alternatives](https://scavio.dev/compare) side by side.
|
|
1061
|
+
Teams choosing between providers can [compare Scavio vs alternatives](https://scavio.dev/compare?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) side by side.
|
|
973
1062
|
|
|
974
|
-
Get a free [API key](https://dashboard.scavio.dev/sign-up) and explore the [documentation](https://scavio.dev/docs/introduction).
|
|
1063
|
+
Get a free [API key](https://dashboard.scavio.dev/sign-up?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme) and explore the [documentation](https://scavio.dev/docs/introduction?utm_source=npm-scavio-js&utm_medium=package&utm_campaign=readme).
|
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
BookingNamespace: () => BookingNamespace,
|
|
28
28
|
CapterraNamespace: () => CapterraNamespace,
|
|
29
29
|
CompaniesHouseNamespace: () => CompaniesHouseNamespace,
|
|
30
|
+
CostcoNamespace: () => CostcoNamespace,
|
|
30
31
|
DEFAULT_MAX_REQUESTS_PER_SECOND: () => DEFAULT_MAX_REQUESTS_PER_SECOND,
|
|
31
32
|
EbayNamespace: () => EbayNamespace,
|
|
32
33
|
G2Namespace: () => G2Namespace,
|
|
@@ -198,12 +199,25 @@ function parseRetryAfter(header) {
|
|
|
198
199
|
var BASE_URL = "https://api.scavio.dev";
|
|
199
200
|
var DEFAULT_TIMEOUT = 3e4;
|
|
200
201
|
var DEFAULT_MAX_RETRIES = 2;
|
|
202
|
+
var SDK_VERSION = true ? "0.18.1" : "0.0.0";
|
|
203
|
+
var USER_AGENT = `scavio-js/${SDK_VERSION}`;
|
|
204
|
+
function isServerRuntime() {
|
|
205
|
+
const g = globalThis;
|
|
206
|
+
if (typeof g.window !== "undefined" && typeof g.document !== "undefined") {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
return typeof g.process?.versions?.node === "string";
|
|
210
|
+
}
|
|
201
211
|
function buildHeaders(apiKey) {
|
|
202
|
-
|
|
212
|
+
const headers = {
|
|
203
213
|
Authorization: `Bearer ${apiKey}`,
|
|
204
214
|
"Content-Type": "application/json",
|
|
205
215
|
"X-Client-Source": "scavio-js"
|
|
206
216
|
};
|
|
217
|
+
if (isServerRuntime()) {
|
|
218
|
+
headers["User-Agent"] = USER_AGENT;
|
|
219
|
+
}
|
|
220
|
+
return headers;
|
|
207
221
|
}
|
|
208
222
|
function stripUndefined(obj) {
|
|
209
223
|
const result = {};
|
|
@@ -680,7 +694,11 @@ var WalmartNamespace = class {
|
|
|
680
694
|
* Structured Walmart search results: `products[]`, `products_count` and the
|
|
681
695
|
* resolved `location`. Page through with `page` (1-indexed).
|
|
682
696
|
*
|
|
683
|
-
*
|
|
697
|
+
* Pass `delivery_zip` + `store_id` to get one store's results (walmart.com
|
|
698
|
+
* and walmart.ca); `data.location` confirms the store.
|
|
699
|
+
*
|
|
700
|
+
* Costs 1 credit for `domain` "com" or "ca", 2 credits for "com.mx", and 2
|
|
701
|
+
* credits when store-targeted.
|
|
684
702
|
*/
|
|
685
703
|
async search(options) {
|
|
686
704
|
return this.client._post("/api/v1/walmart/search", options);
|
|
@@ -689,8 +707,11 @@ var WalmartNamespace = class {
|
|
|
689
707
|
* Full product detail: price, rating, images, specifications, availability
|
|
690
708
|
* and seller.
|
|
691
709
|
*
|
|
692
|
-
*
|
|
693
|
-
*
|
|
710
|
+
* Pass `delivery_zip` + `store_id` for one store's price and availability.
|
|
711
|
+
* `domain: "ca"` is available only together with a store target.
|
|
712
|
+
*
|
|
713
|
+
* Costs 1 credit, or 2 when store-targeted. A store that does not carry the
|
|
714
|
+
* item returns 404.
|
|
694
715
|
*/
|
|
695
716
|
async product(options) {
|
|
696
717
|
return this.client._post("/api/v1/walmart/product", options);
|
|
@@ -741,6 +762,20 @@ var WalmartNamespace = class {
|
|
|
741
762
|
async sellerProducts(options) {
|
|
742
763
|
return this.client._post("/api/v1/walmart/seller-products", options);
|
|
743
764
|
}
|
|
765
|
+
/**
|
|
766
|
+
* Walmart stores near a US ZIP (or a Canadian postal code with `domain: "ca"`),
|
|
767
|
+
* nearest first, with `store_id`, address, distance, coordinates and hours.
|
|
768
|
+
* Use a `store_id` with `delivery_zip` on `search()` or `product()`, on the
|
|
769
|
+
* same domain, to target that store.
|
|
770
|
+
*
|
|
771
|
+
* Costs 1 credit.
|
|
772
|
+
*/
|
|
773
|
+
async stores(options) {
|
|
774
|
+
return await this.client._post(
|
|
775
|
+
"/api/v1/walmart/stores",
|
|
776
|
+
options
|
|
777
|
+
);
|
|
778
|
+
}
|
|
744
779
|
};
|
|
745
780
|
|
|
746
781
|
// src/namespaces/youtube.ts
|
|
@@ -2305,6 +2340,141 @@ var MetaAdsNamespace = class {
|
|
|
2305
2340
|
}
|
|
2306
2341
|
};
|
|
2307
2342
|
|
|
2343
|
+
// src/namespaces/costco.ts
|
|
2344
|
+
var CostcoNamespace = class {
|
|
2345
|
+
constructor(client) {
|
|
2346
|
+
this.client = client;
|
|
2347
|
+
}
|
|
2348
|
+
client;
|
|
2349
|
+
/**
|
|
2350
|
+
* Search Costco by keyword or item number: online price and original price,
|
|
2351
|
+
* ratings, member-only and stock flags, promotions and facets. Pass
|
|
2352
|
+
* `warehouse_id` to add that warehouse's in-store price and stock to every
|
|
2353
|
+
* result.
|
|
2354
|
+
*
|
|
2355
|
+
* Costs 1 credit.
|
|
2356
|
+
*/
|
|
2357
|
+
async search(options) {
|
|
2358
|
+
return this.client._post("/api/v1/costco/search", options);
|
|
2359
|
+
}
|
|
2360
|
+
/**
|
|
2361
|
+
* Products in a Costco category, with the same sort, filters and
|
|
2362
|
+
* per-warehouse pricing as search().
|
|
2363
|
+
*
|
|
2364
|
+
* Costs 1 credit.
|
|
2365
|
+
*/
|
|
2366
|
+
async category(options) {
|
|
2367
|
+
return this.client._post("/api/v1/costco/category", options);
|
|
2368
|
+
}
|
|
2369
|
+
/**
|
|
2370
|
+
* The Costco department list, or the full subcategory tree under one
|
|
2371
|
+
* department when `category_id` is set.
|
|
2372
|
+
*
|
|
2373
|
+
* Costs 1 credit.
|
|
2374
|
+
*/
|
|
2375
|
+
async categories(options = {}) {
|
|
2376
|
+
return this.client._post("/api/v1/costco/categories", options);
|
|
2377
|
+
}
|
|
2378
|
+
/**
|
|
2379
|
+
* Full details for up to 20 items: description, features, specifications,
|
|
2380
|
+
* variants, member-only and purchase limits, delivery fee, and promotions
|
|
2381
|
+
* with start and end dates. Pass `item_id` or `item_ids`.
|
|
2382
|
+
*
|
|
2383
|
+
* Costs 1 credit.
|
|
2384
|
+
*/
|
|
2385
|
+
async product(options) {
|
|
2386
|
+
return this.client._post("/api/v1/costco/product", options);
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Online price versus in-warehouse price for up to 20 items across up to 10
|
|
2390
|
+
* warehouses, with each location's discount, final price, promotion dates
|
|
2391
|
+
* and price code.
|
|
2392
|
+
*
|
|
2393
|
+
* Costs 1 credit for up to 9 warehouses and 2 credits for 10.
|
|
2394
|
+
*/
|
|
2395
|
+
async prices(options) {
|
|
2396
|
+
return this.client._post("/api/v1/costco/prices", options);
|
|
2397
|
+
}
|
|
2398
|
+
/**
|
|
2399
|
+
* In-warehouse stock status for one item at up to 10 warehouses, plus
|
|
2400
|
+
* pickup and same-day delivery availability. A status, never a quantity.
|
|
2401
|
+
*
|
|
2402
|
+
* Costs 1 credit per 5 warehouses.
|
|
2403
|
+
*/
|
|
2404
|
+
async availability(options) {
|
|
2405
|
+
return this.client._post("/api/v1/costco/availability", options);
|
|
2406
|
+
}
|
|
2407
|
+
/**
|
|
2408
|
+
* Customer reviews for a Costco product with the rating distribution and
|
|
2409
|
+
* recommend count; sort, star filter and up to 100 reviews per page.
|
|
2410
|
+
*
|
|
2411
|
+
* Costs 1 credit.
|
|
2412
|
+
*/
|
|
2413
|
+
async reviews(options) {
|
|
2414
|
+
return this.client._post("/api/v1/costco/reviews", options);
|
|
2415
|
+
}
|
|
2416
|
+
/**
|
|
2417
|
+
* Costco warehouses near a US zip code or coordinates, nearest first:
|
|
2418
|
+
* warehouse_id, address, hours, departments, services, and gas station hours
|
|
2419
|
+
* and prices.
|
|
2420
|
+
*
|
|
2421
|
+
* Costs 1 credit, or 2 with country "ca".
|
|
2422
|
+
*/
|
|
2423
|
+
async warehouses(options) {
|
|
2424
|
+
return this.client._post("/api/v1/costco/warehouses", options);
|
|
2425
|
+
}
|
|
2426
|
+
/**
|
|
2427
|
+
* Current regular, premium and diesel prices at Costco gas stations near a
|
|
2428
|
+
* location, or at specific warehouses.
|
|
2429
|
+
*
|
|
2430
|
+
* Costs 1 credit by location (2 with country "ca"); by `warehouse_ids`,
|
|
2431
|
+
* 1 credit per 5 warehouses on us and 2 credits per warehouse on ca.
|
|
2432
|
+
*/
|
|
2433
|
+
async gas(options) {
|
|
2434
|
+
return this.client._post("/api/v1/costco/gas", options);
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* The current Costco member coupon book (US): every offer with its item
|
|
2438
|
+
* number, discount, final price, warehouse/online scope, limits and the
|
|
2439
|
+
* book's valid dates. Takes no parameters.
|
|
2440
|
+
*
|
|
2441
|
+
* Costs 1 credit.
|
|
2442
|
+
*/
|
|
2443
|
+
async coupons(options = {}) {
|
|
2444
|
+
return this.client._post("/api/v1/costco/coupons", options);
|
|
2445
|
+
}
|
|
2446
|
+
/**
|
|
2447
|
+
* Costco deal feeds: new items, while supplies last, treasure hunt, member
|
|
2448
|
+
* favorites, online-only and everything on sale, with the same filters and
|
|
2449
|
+
* optional per-warehouse pricing as search().
|
|
2450
|
+
*
|
|
2451
|
+
* Costs 1 credit.
|
|
2452
|
+
*/
|
|
2453
|
+
async deals(options) {
|
|
2454
|
+
return this.client._post("/api/v1/costco/deals", options);
|
|
2455
|
+
}
|
|
2456
|
+
/**
|
|
2457
|
+
* Markdown finder for one warehouse: scans a query or category and keeps
|
|
2458
|
+
* the items whose in-warehouse price ends in a markdown code - .97
|
|
2459
|
+
* clearance and .00/.88 manager markdown by default, .49/.79/.89 special
|
|
2460
|
+
* buys on request. The codes are the member-community decode; Costco does
|
|
2461
|
+
* not publish them. Only items Costco lists online are covered.
|
|
2462
|
+
*
|
|
2463
|
+
* Costs 1 credit.
|
|
2464
|
+
*/
|
|
2465
|
+
async clearance(options) {
|
|
2466
|
+
return this.client._post("/api/v1/costco/clearance", options);
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* Costco search-box suggestions for a partial query.
|
|
2470
|
+
*
|
|
2471
|
+
* Costs 1 credit.
|
|
2472
|
+
*/
|
|
2473
|
+
async autocomplete(options) {
|
|
2474
|
+
return this.client._post("/api/v1/costco/autocomplete", options);
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2477
|
+
|
|
2308
2478
|
// src/client.ts
|
|
2309
2479
|
var DEFAULT_MAX_REQUESTS_PER_SECOND = 1;
|
|
2310
2480
|
var MAX_REQUESTS_PER_SECOND = 50;
|
|
@@ -2340,6 +2510,7 @@ var Scavio = class {
|
|
|
2340
2510
|
companiesHouse;
|
|
2341
2511
|
googleAds;
|
|
2342
2512
|
metaAds;
|
|
2513
|
+
costco;
|
|
2343
2514
|
apiKey;
|
|
2344
2515
|
baseUrl;
|
|
2345
2516
|
timeout;
|
|
@@ -2391,6 +2562,7 @@ var Scavio = class {
|
|
|
2391
2562
|
this.companiesHouse = new CompaniesHouseNamespace(this);
|
|
2392
2563
|
this.googleAds = new GoogleAdsNamespace(this);
|
|
2393
2564
|
this.metaAds = new MetaAdsNamespace(this);
|
|
2565
|
+
this.costco = new CostcoNamespace(this);
|
|
2394
2566
|
}
|
|
2395
2567
|
/** @internal */
|
|
2396
2568
|
async _post(path, body) {
|
|
@@ -2456,6 +2628,7 @@ var Scavio = class {
|
|
|
2456
2628
|
BookingNamespace,
|
|
2457
2629
|
CapterraNamespace,
|
|
2458
2630
|
CompaniesHouseNamespace,
|
|
2631
|
+
CostcoNamespace,
|
|
2459
2632
|
DEFAULT_MAX_REQUESTS_PER_SECOND,
|
|
2460
2633
|
EbayNamespace,
|
|
2461
2634
|
G2Namespace,
|