@getanyapi/sdk 0.25.0 → 0.27.0
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/dist/index.cjs +73 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +573 -3
- package/dist/index.d.ts +573 -3
- package/dist/index.js +73 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -254,8 +254,9 @@ function parseOffer(value, path) {
|
|
|
254
254
|
const model = stringField(raw, "model", path);
|
|
255
255
|
const unit = stringField(raw, "unit", path);
|
|
256
256
|
const maxUsd = numberField(raw, "maxUsd", path);
|
|
257
|
+
const maxPer1kUsd = numberField(raw, "maxPer1kUsd", path);
|
|
257
258
|
if (model === "flat") {
|
|
258
|
-
return unit === "request" ? { model, unit, maxUsd } : malformed(path);
|
|
259
|
+
return unit === "request" ? { model, unit, maxUsd, maxPer1kUsd } : malformed(path);
|
|
259
260
|
}
|
|
260
261
|
if (model !== "linear") return malformed(`${path}.model`);
|
|
261
262
|
if (unit.length === 0) return malformed(`${path}.unit`);
|
|
@@ -264,14 +265,16 @@ function parseOffer(value, path) {
|
|
|
264
265
|
unit,
|
|
265
266
|
baseUsd: numberField(raw, "baseUsd", path),
|
|
266
267
|
perUnitUsd: numberField(raw, "perUnitUsd", path),
|
|
267
|
-
maxUsd
|
|
268
|
+
maxUsd,
|
|
269
|
+
maxPer1kUsd
|
|
268
270
|
};
|
|
269
271
|
}
|
|
270
272
|
function parsePricing(value, path) {
|
|
271
273
|
const raw = record(value, path);
|
|
272
274
|
return {
|
|
273
275
|
from: parseOffer(raw["from"], `${path}.from`),
|
|
274
|
-
failoverMaxUsd: numberField(raw, "failoverMaxUsd", path)
|
|
276
|
+
failoverMaxUsd: numberField(raw, "failoverMaxUsd", path),
|
|
277
|
+
failoverMaxPer1kUsd: numberField(raw, "failoverMaxPer1kUsd", path)
|
|
275
278
|
};
|
|
276
279
|
}
|
|
277
280
|
function parseExecution(value, path) {
|
|
@@ -5434,6 +5437,45 @@ var TiktokShopNamespace = class {
|
|
|
5434
5437
|
this._core = _core;
|
|
5435
5438
|
}
|
|
5436
5439
|
_core;
|
|
5440
|
+
/**
|
|
5441
|
+
* TikTok Shop Categories
|
|
5442
|
+
*
|
|
5443
|
+
* List the TikTok Shop category tree for a market: top-level categories with ids, slugs, and images, each with its child categories.
|
|
5444
|
+
*
|
|
5445
|
+
* Price: $0.0012 per request.
|
|
5446
|
+
*
|
|
5447
|
+
* @example
|
|
5448
|
+
* const res = await client.tiktokShop.categories({ region: "US" });
|
|
5449
|
+
*/
|
|
5450
|
+
categories(input, options) {
|
|
5451
|
+
return this._core.run("tiktok_shop.categories", input, options);
|
|
5452
|
+
}
|
|
5453
|
+
/**
|
|
5454
|
+
* TikTok Shop Category Products
|
|
5455
|
+
*
|
|
5456
|
+
* Browse TikTok Shop products inside a category by category id: price, discount, rating, sales count, seller, and product URL per product.
|
|
5457
|
+
*
|
|
5458
|
+
* Price: $0.0012 per request.
|
|
5459
|
+
*
|
|
5460
|
+
* @example
|
|
5461
|
+
* const res = await client.tiktokShop.categoryProducts({ categoryId: "700645", region: "US" });
|
|
5462
|
+
*/
|
|
5463
|
+
categoryProducts(input, options) {
|
|
5464
|
+
return this._core.run("tiktok_shop.category_products", input, options);
|
|
5465
|
+
}
|
|
5466
|
+
/**
|
|
5467
|
+
* TikTok Shop Creator
|
|
5468
|
+
*
|
|
5469
|
+
* TikTok Shop creator performance by handle: GMV range, promoted product count, brand collaborations, follower age/gender/location demographics, category GMV split, and video versus live engagement.
|
|
5470
|
+
*
|
|
5471
|
+
* Price: $0.00525 per request plus $0 per result (maximum $0.00525).
|
|
5472
|
+
*
|
|
5473
|
+
* @example
|
|
5474
|
+
* const res = await client.tiktokShop.creator({ handle: "golinutrition" });
|
|
5475
|
+
*/
|
|
5476
|
+
creator(input, options) {
|
|
5477
|
+
return this._core.run("tiktok_shop.creator", input, options);
|
|
5478
|
+
}
|
|
5437
5479
|
/**
|
|
5438
5480
|
* TikTok Shop Product
|
|
5439
5481
|
*
|
|
@@ -5447,6 +5489,19 @@ var TiktokShopNamespace = class {
|
|
|
5447
5489
|
product(input, options) {
|
|
5448
5490
|
return this._core.run("tiktok_shop.product", input, options);
|
|
5449
5491
|
}
|
|
5492
|
+
/**
|
|
5493
|
+
* TikTok Shop Product Full
|
|
5494
|
+
*
|
|
5495
|
+
* Deep TikTok Shop product record from a product URL: affiliate commission rate, units sold and GMV over the last 30 days and lifetime, stock, rating, review count, category tree, listing date, and the seller's own sales totals.
|
|
5496
|
+
*
|
|
5497
|
+
* Price: $0.021 per request plus $0 per result (maximum $0.021).
|
|
5498
|
+
*
|
|
5499
|
+
* @example
|
|
5500
|
+
* const res = await client.tiktokShop.productFull({ url: "https://www.tiktok.com/shop/pdp/1729527313880355335" });
|
|
5501
|
+
*/
|
|
5502
|
+
productFull(input, options) {
|
|
5503
|
+
return this._core.run("tiktok_shop.product_full", input, options);
|
|
5504
|
+
}
|
|
5450
5505
|
/**
|
|
5451
5506
|
* TikTok Shop Product Reviews
|
|
5452
5507
|
*
|
|
@@ -5465,7 +5520,7 @@ var TiktokShopNamespace = class {
|
|
|
5465
5520
|
*
|
|
5466
5521
|
* Search TikTok Shop products by keyword across 15 countries: price, sales, rating, and seller info per product, in one normalized response.
|
|
5467
5522
|
*
|
|
5468
|
-
* Price: $0.
|
|
5523
|
+
* Price: $0.0012 per request.
|
|
5469
5524
|
*
|
|
5470
5525
|
* @example
|
|
5471
5526
|
* const res = await client.tiktokShop.search({ query: "phone case", limit: 3 });
|
|
@@ -5473,12 +5528,25 @@ var TiktokShopNamespace = class {
|
|
|
5473
5528
|
search(input, options) {
|
|
5474
5529
|
return this._core.run("tiktok_shop.search", input, options);
|
|
5475
5530
|
}
|
|
5531
|
+
/**
|
|
5532
|
+
* TikTok Shop Search Suggestions
|
|
5533
|
+
*
|
|
5534
|
+
* Get TikTok Shop search autocomplete terms for a keyword: the long-tail queries shoppers actually type, for keyword and demand research.
|
|
5535
|
+
*
|
|
5536
|
+
* Price: $0.0012 per request.
|
|
5537
|
+
*
|
|
5538
|
+
* @example
|
|
5539
|
+
* const res = await client.tiktokShop.searchSuggestions({ query: "ashwagandha gummies", country: "US" });
|
|
5540
|
+
*/
|
|
5541
|
+
searchSuggestions(input, options) {
|
|
5542
|
+
return this._core.run("tiktok_shop.search_suggestions", input, options);
|
|
5543
|
+
}
|
|
5476
5544
|
/**
|
|
5477
5545
|
* TikTok Shop Store Products
|
|
5478
5546
|
*
|
|
5479
5547
|
* List every product of a TikTok Shop store by URL (title, price, sales, and rating per product plus shop-level stats) with cursor pagination.
|
|
5480
5548
|
*
|
|
5481
|
-
* Price: $0.
|
|
5549
|
+
* Price: $0.0012 per request.
|
|
5482
5550
|
*
|
|
5483
5551
|
* @example
|
|
5484
5552
|
* const res = await client.tiktokShop.shopProducts({ url: "https://www.tiktok.com/shop/store/goli-nutrition/7495794203056835079" });
|