scrapebadger 0.57.0 → 0.58.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/README.md +1 -0
- package/dist/index.d.cts +737 -1
- package/dist/index.d.ts +737 -1
- package/dist/index.js +203 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +203 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
9
9
|
var WebSocket__default = /*#__PURE__*/_interopDefault(WebSocket);
|
|
10
10
|
|
|
11
11
|
// src/internal/version.ts
|
|
12
|
-
var SDK_VERSION = "0.
|
|
12
|
+
var SDK_VERSION = "0.58.0";
|
|
13
13
|
|
|
14
14
|
// src/internal/exceptions.ts
|
|
15
15
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -9339,6 +9339,204 @@ var DepopClient = class {
|
|
|
9339
9339
|
// --- END generated by sdk/codegen/facade ---
|
|
9340
9340
|
};
|
|
9341
9341
|
|
|
9342
|
+
// src/wallapop/client.ts
|
|
9343
|
+
var onlyTrue = (value) => value ? true : void 0;
|
|
9344
|
+
var WallapopClient = class {
|
|
9345
|
+
client;
|
|
9346
|
+
constructor(client) {
|
|
9347
|
+
this.client = client;
|
|
9348
|
+
}
|
|
9349
|
+
/**
|
|
9350
|
+
* Search Wallapop listings (40 per page).
|
|
9351
|
+
*
|
|
9352
|
+
* Needs a query, a `categoryId`, or both — unless `nextPage` is given, in
|
|
9353
|
+
* which case every other parameter is ignored.
|
|
9354
|
+
*
|
|
9355
|
+
* Costs 5 credits.
|
|
9356
|
+
*
|
|
9357
|
+
* @param query - Search text, e.g. "iphone 14" (optional with `categoryId` or `nextPage`).
|
|
9358
|
+
* @param options - Optional parameters (market, location/radius, category,
|
|
9359
|
+
* price, condition, brand/model/colour, cars filters, sort, cursor).
|
|
9360
|
+
* @returns Search response with matching listings and the next-page cursor.
|
|
9361
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
9362
|
+
* @throws ValidationError - If neither a query nor a category is given.
|
|
9363
|
+
*/
|
|
9364
|
+
async search(query, options = {}) {
|
|
9365
|
+
return this.client.request("/v1/wallapop/search", {
|
|
9366
|
+
params: {
|
|
9367
|
+
query,
|
|
9368
|
+
market: options.market,
|
|
9369
|
+
latitude: options.latitude,
|
|
9370
|
+
longitude: options.longitude,
|
|
9371
|
+
distance_km: options.distanceKm,
|
|
9372
|
+
category_id: options.categoryId,
|
|
9373
|
+
min_price: options.minPrice,
|
|
9374
|
+
max_price: options.maxPrice,
|
|
9375
|
+
condition: options.condition,
|
|
9376
|
+
brand: options.brand,
|
|
9377
|
+
model: options.model,
|
|
9378
|
+
color: options.color,
|
|
9379
|
+
time_filter: options.timeFilter,
|
|
9380
|
+
shippable: onlyTrue(options.shippable),
|
|
9381
|
+
has_warranty: onlyTrue(options.hasWarranty),
|
|
9382
|
+
refurbished: onlyTrue(options.refurbished),
|
|
9383
|
+
min_year: options.minYear,
|
|
9384
|
+
max_year: options.maxYear,
|
|
9385
|
+
min_km: options.minKm,
|
|
9386
|
+
max_km: options.maxKm,
|
|
9387
|
+
gearbox: options.gearbox,
|
|
9388
|
+
min_horsepower: options.minHorsepower,
|
|
9389
|
+
max_horsepower: options.maxHorsepower,
|
|
9390
|
+
order_by: options.orderBy,
|
|
9391
|
+
next_page: options.nextPage
|
|
9392
|
+
}
|
|
9393
|
+
});
|
|
9394
|
+
}
|
|
9395
|
+
/**
|
|
9396
|
+
* Get a single listing's full detail.
|
|
9397
|
+
*
|
|
9398
|
+
* Costs 5 credits.
|
|
9399
|
+
*
|
|
9400
|
+
* @param itemId - Listing id (e.g. "nzxeknm5x562") or listing slug.
|
|
9401
|
+
* @param options - Optional parameters (market).
|
|
9402
|
+
* @returns Full listing detail with attributes, counters and location.
|
|
9403
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
9404
|
+
*/
|
|
9405
|
+
async getItem(itemId, options = {}) {
|
|
9406
|
+
return this.client.request(
|
|
9407
|
+
`/v1/wallapop/items/${encodeURIComponent(itemId)}`,
|
|
9408
|
+
{ params: { market: options.market } }
|
|
9409
|
+
);
|
|
9410
|
+
}
|
|
9411
|
+
/**
|
|
9412
|
+
* Get a seller's profile with ratings, sales counters, response rate and
|
|
9413
|
+
* verifications.
|
|
9414
|
+
*
|
|
9415
|
+
* Costs 5 credits.
|
|
9416
|
+
*
|
|
9417
|
+
* @param userId - User id (e.g. "dqjwdd53wwzo") or profile slug (e.g. "alexc-25115753").
|
|
9418
|
+
* @param options - Optional parameters (market).
|
|
9419
|
+
* @returns User profile.
|
|
9420
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
9421
|
+
*/
|
|
9422
|
+
async getUser(userId, options = {}) {
|
|
9423
|
+
return this.client.request(
|
|
9424
|
+
`/v1/wallapop/users/${encodeURIComponent(userId)}`,
|
|
9425
|
+
{ params: { market: options.market } }
|
|
9426
|
+
);
|
|
9427
|
+
}
|
|
9428
|
+
/**
|
|
9429
|
+
* Get a seller's live listings (40 per page).
|
|
9430
|
+
*
|
|
9431
|
+
* Costs 5 credits.
|
|
9432
|
+
*
|
|
9433
|
+
* @param userId - User id or profile slug.
|
|
9434
|
+
* @param options - Optional parameters (market, nextPage).
|
|
9435
|
+
* @returns The seller's listings and the next-page cursor.
|
|
9436
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
9437
|
+
*/
|
|
9438
|
+
async getUserItems(userId, options = {}) {
|
|
9439
|
+
return this.client.request(
|
|
9440
|
+
`/v1/wallapop/users/${encodeURIComponent(userId)}/items`,
|
|
9441
|
+
{ params: { market: options.market, next_page: options.nextPage } }
|
|
9442
|
+
);
|
|
9443
|
+
}
|
|
9444
|
+
/**
|
|
9445
|
+
* Get the reviews a seller received, newest first (40 per page).
|
|
9446
|
+
*
|
|
9447
|
+
* Costs 5 credits.
|
|
9448
|
+
*
|
|
9449
|
+
* @param userId - User id or profile slug.
|
|
9450
|
+
* @param options - Optional parameters (market, nextPage).
|
|
9451
|
+
* @returns Reviews and the next-page cursor.
|
|
9452
|
+
* @throws NotFoundError - If the user doesn't exist.
|
|
9453
|
+
*/
|
|
9454
|
+
async getUserReviews(userId, options = {}) {
|
|
9455
|
+
return this.client.request(
|
|
9456
|
+
`/v1/wallapop/users/${encodeURIComponent(userId)}/reviews`,
|
|
9457
|
+
{ params: { market: options.market, next_page: options.nextPage } }
|
|
9458
|
+
);
|
|
9459
|
+
}
|
|
9460
|
+
/**
|
|
9461
|
+
* Get Wallapop's search-box suggestions for a partial query.
|
|
9462
|
+
*
|
|
9463
|
+
* Costs 1 credit.
|
|
9464
|
+
*
|
|
9465
|
+
* @param query - Partial search text, e.g. "bici".
|
|
9466
|
+
* @param options - Optional parameters (market).
|
|
9467
|
+
* @returns Autocomplete suggestions.
|
|
9468
|
+
*/
|
|
9469
|
+
async autocomplete(query, options = {}) {
|
|
9470
|
+
return this.client.request("/v1/wallapop/autocomplete", {
|
|
9471
|
+
params: { query, market: options.market }
|
|
9472
|
+
});
|
|
9473
|
+
}
|
|
9474
|
+
/**
|
|
9475
|
+
* Get the full category tree; ids are usable as the search `categoryId`.
|
|
9476
|
+
*
|
|
9477
|
+
* Costs 1 credit.
|
|
9478
|
+
*
|
|
9479
|
+
* @param options - Optional parameters (market — localises names).
|
|
9480
|
+
* @returns Category tree.
|
|
9481
|
+
*/
|
|
9482
|
+
async listCategories(options = {}) {
|
|
9483
|
+
return this.client.request("/v1/wallapop/categories", {
|
|
9484
|
+
params: { market: options.market }
|
|
9485
|
+
});
|
|
9486
|
+
}
|
|
9487
|
+
/**
|
|
9488
|
+
* Get the search filters Wallapop offers for a category and/or query,
|
|
9489
|
+
* with their option ids.
|
|
9490
|
+
*
|
|
9491
|
+
* Costs 2 credits.
|
|
9492
|
+
*
|
|
9493
|
+
* @param options - Optional parameters (categoryId, query, market).
|
|
9494
|
+
* @returns Available filters.
|
|
9495
|
+
*/
|
|
9496
|
+
async listFilters(options = {}) {
|
|
9497
|
+
return this.client.request("/v1/wallapop/filters", {
|
|
9498
|
+
params: {
|
|
9499
|
+
category_id: options.categoryId,
|
|
9500
|
+
query: options.query,
|
|
9501
|
+
market: options.market
|
|
9502
|
+
}
|
|
9503
|
+
});
|
|
9504
|
+
}
|
|
9505
|
+
/**
|
|
9506
|
+
* Get a filter's long option list (brands, models) that Wallapop serves
|
|
9507
|
+
* separately — filters flagged `options_endpoint` in `listFilters`.
|
|
9508
|
+
*
|
|
9509
|
+
* Costs 2 credits.
|
|
9510
|
+
*
|
|
9511
|
+
* @param filterId - Filter id, e.g. "brand".
|
|
9512
|
+
* @param options - Optional parameters (categoryId, query, market).
|
|
9513
|
+
* @returns The filter's options.
|
|
9514
|
+
* @throws ValidationError - If the filter id is invalid.
|
|
9515
|
+
*/
|
|
9516
|
+
async listFilterOptions(filterId, options = {}) {
|
|
9517
|
+
return this.client.request(
|
|
9518
|
+
`/v1/wallapop/filters/${encodeURIComponent(filterId)}/options`,
|
|
9519
|
+
{
|
|
9520
|
+
params: {
|
|
9521
|
+
category_id: options.categoryId,
|
|
9522
|
+
query: options.query,
|
|
9523
|
+
market: options.market
|
|
9524
|
+
}
|
|
9525
|
+
}
|
|
9526
|
+
);
|
|
9527
|
+
}
|
|
9528
|
+
/**
|
|
9529
|
+
* Get all supported Wallapop markets and their default search location.
|
|
9530
|
+
*
|
|
9531
|
+
* Free — this endpoint costs no credits.
|
|
9532
|
+
*
|
|
9533
|
+
* @returns Markets response with all supported markets.
|
|
9534
|
+
*/
|
|
9535
|
+
async listMarkets() {
|
|
9536
|
+
return this.client.request("/v1/wallapop/markets");
|
|
9537
|
+
}
|
|
9538
|
+
};
|
|
9539
|
+
|
|
9342
9540
|
// src/linkedin/client.ts
|
|
9343
9541
|
var LinkedInClient = class {
|
|
9344
9542
|
client;
|
|
@@ -9861,6 +10059,8 @@ var ScrapeBadger = class {
|
|
|
9861
10059
|
perplexity;
|
|
9862
10060
|
/** Depop scraper API client — search, product, user, user products, markets (www.depop.com, 10 markets) */
|
|
9863
10061
|
depop;
|
|
10062
|
+
/** Wallapop scraper API client — search, item, user, user items/reviews, autocomplete, categories, filters, markets (es, it, pt) */
|
|
10063
|
+
wallapop;
|
|
9864
10064
|
/** LinkedIn scraper API client — 11 no-auth endpoints (jobs, company, school, profile, post, article, learning, geo) */
|
|
9865
10065
|
linkedin;
|
|
9866
10066
|
/** ChatGPT scraper API client — ask, brand visibility, models (the real chatgpt.com, anonymous) */
|
|
@@ -9935,6 +10135,7 @@ var ScrapeBadger = class {
|
|
|
9935
10135
|
this.loopnet = new LoopNetClient(this.baseClient);
|
|
9936
10136
|
this.perplexity = new PerplexityClient(this.baseClient);
|
|
9937
10137
|
this.depop = new DepopClient(this.baseClient);
|
|
10138
|
+
this.wallapop = new WallapopClient(this.baseClient);
|
|
9938
10139
|
this.linkedin = new LinkedInClient(this.baseClient);
|
|
9939
10140
|
this.chatgpt = new ChatGPTClient(this.baseClient);
|
|
9940
10141
|
this.gemini = new GeminiClient(this.baseClient);
|
|
@@ -10071,6 +10272,7 @@ exports.VintedItemsClient = ItemsClient;
|
|
|
10071
10272
|
exports.VintedReferenceClient = ReferenceClient;
|
|
10072
10273
|
exports.VintedSearchClient = SearchClient;
|
|
10073
10274
|
exports.VintedUsersClient = UsersClient2;
|
|
10275
|
+
exports.WallapopClient = WallapopClient;
|
|
10074
10276
|
exports.WalmartClient = WalmartClient;
|
|
10075
10277
|
exports.WalmartProductsClient = ProductsClient4;
|
|
10076
10278
|
exports.WalmartReferenceClient = ReferenceClient6;
|