scrapebadger 0.16.0 → 0.18.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 +1026 -107
- package/dist/index.d.ts +1026 -107
- package/dist/index.js +239 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +234 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3943,6 +3943,101 @@ var RedditClient = class {
|
|
|
3943
3943
|
}
|
|
3944
3944
|
};
|
|
3945
3945
|
|
|
3946
|
+
// src/redfin/client.ts
|
|
3947
|
+
var RedfinClient = class {
|
|
3948
|
+
client;
|
|
3949
|
+
constructor(client) {
|
|
3950
|
+
this.client = client;
|
|
3951
|
+
}
|
|
3952
|
+
/**
|
|
3953
|
+
* Search Redfin for for-sale properties.
|
|
3954
|
+
*
|
|
3955
|
+
* @param location - City/state, ZIP, address or neighborhood (required).
|
|
3956
|
+
* @param options - Optional parameters (page, sort, price/beds/baths/sqft/lot
|
|
3957
|
+
* filters, year built, max days on market, bbox override).
|
|
3958
|
+
* @returns Search response with matching listings, map bounds, and pagination.
|
|
3959
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
3960
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
3961
|
+
*/
|
|
3962
|
+
async search(location, options = {}) {
|
|
3963
|
+
return this.client.request("/v1/redfin/search", {
|
|
3964
|
+
params: {
|
|
3965
|
+
location,
|
|
3966
|
+
page: options.page,
|
|
3967
|
+
sort: options.sort,
|
|
3968
|
+
price_min: options.price_min,
|
|
3969
|
+
price_max: options.price_max,
|
|
3970
|
+
beds_min: options.beds_min,
|
|
3971
|
+
baths_min: options.baths_min,
|
|
3972
|
+
home_type: options.home_type,
|
|
3973
|
+
sqft_min: options.sqft_min,
|
|
3974
|
+
sqft_max: options.sqft_max,
|
|
3975
|
+
lot_min: options.lot_min,
|
|
3976
|
+
lot_max: options.lot_max,
|
|
3977
|
+
year_built_min: options.year_built_min,
|
|
3978
|
+
year_built_max: options.year_built_max,
|
|
3979
|
+
max_days_on_market: options.max_days_on_market,
|
|
3980
|
+
north: options.north,
|
|
3981
|
+
south: options.south,
|
|
3982
|
+
east: options.east,
|
|
3983
|
+
west: options.west
|
|
3984
|
+
}
|
|
3985
|
+
});
|
|
3986
|
+
}
|
|
3987
|
+
/**
|
|
3988
|
+
* Get a single Redfin property's full detail by id or URL.
|
|
3989
|
+
*
|
|
3990
|
+
* Provide either `propertyId` or `options.url`.
|
|
3991
|
+
*
|
|
3992
|
+
* @param propertyId - The Redfin property id.
|
|
3993
|
+
* @param options - Optional parameters (url).
|
|
3994
|
+
* @returns Property detail response.
|
|
3995
|
+
* @throws NotFoundError - If the property doesn't exist.
|
|
3996
|
+
*/
|
|
3997
|
+
async getProperty(propertyId, options = {}) {
|
|
3998
|
+
if (options.url) {
|
|
3999
|
+
return this.client.request("/v1/redfin/property", {
|
|
4000
|
+
params: { url: options.url }
|
|
4001
|
+
});
|
|
4002
|
+
}
|
|
4003
|
+
return this.client.request(`/v1/redfin/property/${propertyId}`);
|
|
4004
|
+
}
|
|
4005
|
+
/**
|
|
4006
|
+
* Get a Redfin agent's profile and their active listings.
|
|
4007
|
+
*
|
|
4008
|
+
* Provide either `agentId` or `options.url`.
|
|
4009
|
+
*
|
|
4010
|
+
* @param agentId - The Redfin agent slug.
|
|
4011
|
+
* @param options - Optional parameters (url).
|
|
4012
|
+
* @returns Agent profile response with the agent and their listings.
|
|
4013
|
+
* @throws NotFoundError - If the agent doesn't exist.
|
|
4014
|
+
*/
|
|
4015
|
+
async getAgent(agentId, options = {}) {
|
|
4016
|
+
return this.client.request("/v1/redfin/agent", {
|
|
4017
|
+
params: { agent_id: agentId, url: options.url }
|
|
4018
|
+
});
|
|
4019
|
+
}
|
|
4020
|
+
/**
|
|
4021
|
+
* Resolve a search term to Redfin locations.
|
|
4022
|
+
*
|
|
4023
|
+
* @param query - Partial location — city, ZIP, address, or neighborhood.
|
|
4024
|
+
* @returns Autocomplete response with location suggestions.
|
|
4025
|
+
*/
|
|
4026
|
+
async autocomplete(query) {
|
|
4027
|
+
return this.client.request("/v1/redfin/autocomplete", {
|
|
4028
|
+
params: { query }
|
|
4029
|
+
});
|
|
4030
|
+
}
|
|
4031
|
+
/**
|
|
4032
|
+
* Get all supported Redfin coverage markets.
|
|
4033
|
+
*
|
|
4034
|
+
* @returns Markets response with all supported markets.
|
|
4035
|
+
*/
|
|
4036
|
+
async listMarkets() {
|
|
4037
|
+
return this.client.request("/v1/redfin/markets");
|
|
4038
|
+
}
|
|
4039
|
+
};
|
|
4040
|
+
|
|
3946
4041
|
// src/amazon/search.ts
|
|
3947
4042
|
var SearchClient4 = class {
|
|
3948
4043
|
client;
|
|
@@ -6234,6 +6329,138 @@ var ImmobiliareClient = class {
|
|
|
6234
6329
|
}
|
|
6235
6330
|
};
|
|
6236
6331
|
|
|
6332
|
+
// src/loopnet/search.ts
|
|
6333
|
+
var SearchClient12 = class {
|
|
6334
|
+
client;
|
|
6335
|
+
constructor(client) {
|
|
6336
|
+
this.client = client;
|
|
6337
|
+
}
|
|
6338
|
+
/**
|
|
6339
|
+
* Search LoopNet for for-lease / for-sale / auction commercial listings.
|
|
6340
|
+
*
|
|
6341
|
+
* Costs 10 credits.
|
|
6342
|
+
*
|
|
6343
|
+
* @param params - Search parameters including location, filters, and pagination.
|
|
6344
|
+
* @returns Search results with listing cards and pagination metadata.
|
|
6345
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
6346
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
6347
|
+
*/
|
|
6348
|
+
async search(params) {
|
|
6349
|
+
return this.client.request("/v1/loopnet/search", {
|
|
6350
|
+
params: {
|
|
6351
|
+
location: params.location,
|
|
6352
|
+
market: params.market,
|
|
6353
|
+
listing_type: params.listing_type,
|
|
6354
|
+
property_type: params.property_type,
|
|
6355
|
+
page: params.page,
|
|
6356
|
+
min_price: params.min_price,
|
|
6357
|
+
max_price: params.max_price,
|
|
6358
|
+
price_type: params.price_type,
|
|
6359
|
+
min_size: params.min_size,
|
|
6360
|
+
max_size: params.max_size
|
|
6361
|
+
}
|
|
6362
|
+
});
|
|
6363
|
+
}
|
|
6364
|
+
};
|
|
6365
|
+
|
|
6366
|
+
// src/loopnet/listings.ts
|
|
6367
|
+
var ListingsClient2 = class {
|
|
6368
|
+
client;
|
|
6369
|
+
constructor(client) {
|
|
6370
|
+
this.client = client;
|
|
6371
|
+
}
|
|
6372
|
+
/**
|
|
6373
|
+
* Get a single LoopNet listing's full detail by listing id.
|
|
6374
|
+
*
|
|
6375
|
+
* Costs 12 credits.
|
|
6376
|
+
*
|
|
6377
|
+
* @param listingId - The LoopNet listing id.
|
|
6378
|
+
* @param params - Optional market selector.
|
|
6379
|
+
* @returns Listing detail response.
|
|
6380
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
6381
|
+
*/
|
|
6382
|
+
async get(listingId, params = {}) {
|
|
6383
|
+
return this.client.request(`/v1/loopnet/listings/${listingId}`, {
|
|
6384
|
+
params: { market: params.market }
|
|
6385
|
+
});
|
|
6386
|
+
}
|
|
6387
|
+
};
|
|
6388
|
+
|
|
6389
|
+
// src/loopnet/brokers.ts
|
|
6390
|
+
var BrokersClient = class {
|
|
6391
|
+
client;
|
|
6392
|
+
constructor(client) {
|
|
6393
|
+
this.client = client;
|
|
6394
|
+
}
|
|
6395
|
+
/**
|
|
6396
|
+
* Get a LoopNet broker's profile and their active listings.
|
|
6397
|
+
*
|
|
6398
|
+
* Costs 8 credits.
|
|
6399
|
+
*
|
|
6400
|
+
* @param slug - The broker's profile URL slug.
|
|
6401
|
+
* @param brokerId - The LoopNet broker id.
|
|
6402
|
+
* @param params - Optional market selector.
|
|
6403
|
+
* @returns Broker profile response with the broker and their listings.
|
|
6404
|
+
* @throws NotFoundError - If the broker doesn't exist.
|
|
6405
|
+
*/
|
|
6406
|
+
async get(slug, brokerId, params = {}) {
|
|
6407
|
+
return this.client.request(`/v1/loopnet/brokers/${slug}/${brokerId}`, {
|
|
6408
|
+
params: { market: params.market }
|
|
6409
|
+
});
|
|
6410
|
+
}
|
|
6411
|
+
};
|
|
6412
|
+
|
|
6413
|
+
// src/loopnet/reference.ts
|
|
6414
|
+
var ReferenceClient10 = class {
|
|
6415
|
+
client;
|
|
6416
|
+
constructor(client) {
|
|
6417
|
+
this.client = client;
|
|
6418
|
+
}
|
|
6419
|
+
/**
|
|
6420
|
+
* List LoopNet coverage markets (us, ca, uk, fr, es).
|
|
6421
|
+
*
|
|
6422
|
+
* Free — costs 0 credits.
|
|
6423
|
+
*
|
|
6424
|
+
* @returns Markets response with all supported coverage markets.
|
|
6425
|
+
*/
|
|
6426
|
+
async markets() {
|
|
6427
|
+
return this.client.request("/v1/loopnet/markets");
|
|
6428
|
+
}
|
|
6429
|
+
/**
|
|
6430
|
+
* List LoopNet property-type facets (Office, Retail, Industrial, …).
|
|
6431
|
+
*
|
|
6432
|
+
* Free — costs 0 credits.
|
|
6433
|
+
*
|
|
6434
|
+
* @returns Property-types response with all searchable property-type slugs.
|
|
6435
|
+
*/
|
|
6436
|
+
async propertyTypes() {
|
|
6437
|
+
return this.client.request("/v1/loopnet/property-types");
|
|
6438
|
+
}
|
|
6439
|
+
};
|
|
6440
|
+
|
|
6441
|
+
// src/loopnet/client.ts
|
|
6442
|
+
var LoopNetClient = class {
|
|
6443
|
+
/** Client for for-lease / for-sale / auction commercial-listing search */
|
|
6444
|
+
search;
|
|
6445
|
+
/** Client for listing detail (by listing id) */
|
|
6446
|
+
listings;
|
|
6447
|
+
/** Client for broker profile and their active listings */
|
|
6448
|
+
brokers;
|
|
6449
|
+
/** Client for reference data (markets, property types) */
|
|
6450
|
+
reference;
|
|
6451
|
+
/**
|
|
6452
|
+
* Create a new LoopNet client.
|
|
6453
|
+
*
|
|
6454
|
+
* @param client - The base HTTP client for making requests.
|
|
6455
|
+
*/
|
|
6456
|
+
constructor(client) {
|
|
6457
|
+
this.search = new SearchClient12(client);
|
|
6458
|
+
this.listings = new ListingsClient2(client);
|
|
6459
|
+
this.brokers = new BrokersClient(client);
|
|
6460
|
+
this.reference = new ReferenceClient10(client);
|
|
6461
|
+
}
|
|
6462
|
+
};
|
|
6463
|
+
|
|
6237
6464
|
// src/client.ts
|
|
6238
6465
|
var ScrapeBadger = class {
|
|
6239
6466
|
baseClient;
|
|
@@ -6247,6 +6474,8 @@ var ScrapeBadger = class {
|
|
|
6247
6474
|
google;
|
|
6248
6475
|
/** Reddit scraper API client */
|
|
6249
6476
|
reddit;
|
|
6477
|
+
/** Redfin scraper API client — search, property, agent, autocomplete, markets (redfin.com, US) */
|
|
6478
|
+
redfin;
|
|
6250
6479
|
/** Amazon scraper API client — 14 endpoints */
|
|
6251
6480
|
amazon;
|
|
6252
6481
|
/** Shopee scraper API client — 6 endpoints across 11 markets */
|
|
@@ -6265,6 +6494,8 @@ var ScrapeBadger = class {
|
|
|
6265
6494
|
zillow;
|
|
6266
6495
|
/** Immobiliare scraper API client — 8 endpoints across 4 markets (it, es, gr, lu) */
|
|
6267
6496
|
immobiliare;
|
|
6497
|
+
/** LoopNet scraper API client — commercial real estate across US/CA/UK/FR/ES (search, listing, broker, markets, property types) */
|
|
6498
|
+
loopnet;
|
|
6268
6499
|
/**
|
|
6269
6500
|
* Create a new ScrapeBadger client.
|
|
6270
6501
|
*
|
|
@@ -6304,6 +6535,7 @@ var ScrapeBadger = class {
|
|
|
6304
6535
|
this.vinted = new VintedClient(this.baseClient);
|
|
6305
6536
|
this.google = new GoogleClient(this.baseClient);
|
|
6306
6537
|
this.reddit = new RedditClient(this.baseClient);
|
|
6538
|
+
this.redfin = new RedfinClient(this.baseClient);
|
|
6307
6539
|
this.amazon = new AmazonClient(this.baseClient);
|
|
6308
6540
|
this.shopee = new ShopeeClient(this.baseClient);
|
|
6309
6541
|
this.tiktok = new TikTokClient(this.baseClient);
|
|
@@ -6313,6 +6545,7 @@ var ScrapeBadger = class {
|
|
|
6313
6545
|
this.leboncoin = new LeboncoinClient(this.baseClient);
|
|
6314
6546
|
this.zillow = new ZillowClient(this.baseClient);
|
|
6315
6547
|
this.immobiliare = new ImmobiliareClient(this.baseClient);
|
|
6548
|
+
this.loopnet = new LoopNetClient(this.baseClient);
|
|
6316
6549
|
}
|
|
6317
6550
|
};
|
|
6318
6551
|
|
|
@@ -6360,6 +6593,11 @@ exports.LeboncoinReferenceClient = ReferenceClient8;
|
|
|
6360
6593
|
exports.LeboncoinSearchClient = SearchClient10;
|
|
6361
6594
|
exports.LeboncoinSellersClient = SellersClient3;
|
|
6362
6595
|
exports.ListsClient = ListsClient;
|
|
6596
|
+
exports.LoopNetBrokersClient = BrokersClient;
|
|
6597
|
+
exports.LoopNetClient = LoopNetClient;
|
|
6598
|
+
exports.LoopNetListingsClient = ListingsClient2;
|
|
6599
|
+
exports.LoopNetReferenceClient = ReferenceClient10;
|
|
6600
|
+
exports.LoopNetSearchClient = SearchClient12;
|
|
6363
6601
|
exports.NotFoundError = NotFoundError;
|
|
6364
6602
|
exports.RateLimitError = RateLimitError;
|
|
6365
6603
|
exports.RealtorClient = RealtorClient;
|
|
@@ -6371,6 +6609,7 @@ exports.RedditPostsClient = PostsClient;
|
|
|
6371
6609
|
exports.RedditSearchClient = SearchClient3;
|
|
6372
6610
|
exports.RedditSubredditsClient = SubredditsClient;
|
|
6373
6611
|
exports.RedditUsersClient = UsersClient3;
|
|
6612
|
+
exports.RedfinClient = RedfinClient;
|
|
6374
6613
|
exports.ScrapeBadger = ScrapeBadger;
|
|
6375
6614
|
exports.ScrapeBadgerError = ScrapeBadgerError;
|
|
6376
6615
|
exports.ServerError = ServerError;
|