scrapebadger 0.15.6 → 0.17.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 +2 -0
- package/dist/index.d.cts +1015 -120
- package/dist/index.d.ts +1015 -120
- package/dist/index.js +275 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +270 -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.16.0";
|
|
13
13
|
|
|
14
14
|
// src/internal/exceptions.ts
|
|
15
15
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -6104,6 +6104,268 @@ var ZillowClient = class {
|
|
|
6104
6104
|
}
|
|
6105
6105
|
};
|
|
6106
6106
|
|
|
6107
|
+
// src/immobiliare/client.ts
|
|
6108
|
+
var ImmobiliareClient = class {
|
|
6109
|
+
client;
|
|
6110
|
+
constructor(client) {
|
|
6111
|
+
this.client = client;
|
|
6112
|
+
}
|
|
6113
|
+
/**
|
|
6114
|
+
* Resolve a free-text place name into geography ids for search.
|
|
6115
|
+
*
|
|
6116
|
+
* @param query - Free-text place name, e.g. "Milano".
|
|
6117
|
+
* @param options - Optional parameters (market).
|
|
6118
|
+
* @returns Suggest response with region/province/city/zone id candidates.
|
|
6119
|
+
*/
|
|
6120
|
+
async autocomplete(query, options = {}) {
|
|
6121
|
+
return this.client.request("/v1/immobiliare/autocomplete", {
|
|
6122
|
+
params: { query, market: options.market }
|
|
6123
|
+
});
|
|
6124
|
+
}
|
|
6125
|
+
/**
|
|
6126
|
+
* Search Immobiliare-group listings.
|
|
6127
|
+
*
|
|
6128
|
+
* Scope the search by `location` (free text, auto-resolved) OR explicit
|
|
6129
|
+
* `region_id` / `province_id` / `city_id` from {@link autocomplete}.
|
|
6130
|
+
*
|
|
6131
|
+
* @param options - Search parameters (market, location/ids, contract,
|
|
6132
|
+
* category, price/surface/room/bathroom filters, sort, page).
|
|
6133
|
+
* @returns Search response with `listings` and pagination metadata.
|
|
6134
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
6135
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
6136
|
+
*/
|
|
6137
|
+
async search(options = {}) {
|
|
6138
|
+
return this.client.request("/v1/immobiliare/search", {
|
|
6139
|
+
params: {
|
|
6140
|
+
market: options.market,
|
|
6141
|
+
location: options.location,
|
|
6142
|
+
region_id: options.region_id,
|
|
6143
|
+
province_id: options.province_id,
|
|
6144
|
+
city_id: options.city_id,
|
|
6145
|
+
contract: options.contract,
|
|
6146
|
+
category: options.category,
|
|
6147
|
+
price_min: options.price_min,
|
|
6148
|
+
price_max: options.price_max,
|
|
6149
|
+
surface_min: options.surface_min,
|
|
6150
|
+
surface_max: options.surface_max,
|
|
6151
|
+
rooms_min: options.rooms_min,
|
|
6152
|
+
rooms_max: options.rooms_max,
|
|
6153
|
+
bathrooms_min: options.bathrooms_min,
|
|
6154
|
+
sort: options.sort,
|
|
6155
|
+
page: options.page
|
|
6156
|
+
}
|
|
6157
|
+
});
|
|
6158
|
+
}
|
|
6159
|
+
/**
|
|
6160
|
+
* Get the full detail for a single Immobiliare listing.
|
|
6161
|
+
*
|
|
6162
|
+
* @param listingId - The Immobiliare listing id.
|
|
6163
|
+
* @param options - Optional parameters (market).
|
|
6164
|
+
* @returns The full listing detail.
|
|
6165
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
6166
|
+
*/
|
|
6167
|
+
async getListing(listingId, options = {}) {
|
|
6168
|
+
return this.client.request(`/v1/immobiliare/listings/${listingId}`, {
|
|
6169
|
+
params: { market: options.market }
|
|
6170
|
+
});
|
|
6171
|
+
}
|
|
6172
|
+
/**
|
|
6173
|
+
* Get an agency/advertiser profile.
|
|
6174
|
+
*
|
|
6175
|
+
* @param agencyId - The Immobiliare agency id.
|
|
6176
|
+
* @param options - Optional parameters (market).
|
|
6177
|
+
* @returns The full agency profile.
|
|
6178
|
+
* @throws NotFoundError - If the agency doesn't exist.
|
|
6179
|
+
*/
|
|
6180
|
+
async getAgency(agencyId, options = {}) {
|
|
6181
|
+
return this.client.request(`/v1/immobiliare/agencies/${agencyId}`, {
|
|
6182
|
+
params: { market: options.market }
|
|
6183
|
+
});
|
|
6184
|
+
}
|
|
6185
|
+
/**
|
|
6186
|
+
* Get an agency's active listings (25 per page).
|
|
6187
|
+
*
|
|
6188
|
+
* @param agencyId - The Immobiliare agency id.
|
|
6189
|
+
* @param options - Optional parameters (market, page).
|
|
6190
|
+
* @returns Agency-listings response with `listings` and pagination.
|
|
6191
|
+
*/
|
|
6192
|
+
async getAgencyListings(agencyId, options = {}) {
|
|
6193
|
+
return this.client.request(
|
|
6194
|
+
`/v1/immobiliare/agencies/${agencyId}/listings`,
|
|
6195
|
+
{
|
|
6196
|
+
params: { market: options.market, page: options.page }
|
|
6197
|
+
}
|
|
6198
|
+
);
|
|
6199
|
+
}
|
|
6200
|
+
/**
|
|
6201
|
+
* Get the historical average €/m² time series for an area.
|
|
6202
|
+
*
|
|
6203
|
+
* @param regionId - Region id, e.g. "lom" (required).
|
|
6204
|
+
* @param options - Optional parameters (province_id, city_id, market, contract).
|
|
6205
|
+
* @returns Price-stats response with monthly `points` (label + EUR/m² value).
|
|
6206
|
+
*/
|
|
6207
|
+
async priceStats(regionId, options = {}) {
|
|
6208
|
+
return this.client.request("/v1/immobiliare/market-insights/prices", {
|
|
6209
|
+
params: {
|
|
6210
|
+
market: options.market,
|
|
6211
|
+
region_id: regionId,
|
|
6212
|
+
province_id: options.province_id,
|
|
6213
|
+
city_id: options.city_id,
|
|
6214
|
+
contract: options.contract
|
|
6215
|
+
}
|
|
6216
|
+
});
|
|
6217
|
+
}
|
|
6218
|
+
/**
|
|
6219
|
+
* Get all supported Immobiliare-group markets (it, es, gr, lu).
|
|
6220
|
+
*
|
|
6221
|
+
* @returns A bare array of supported markets (code, domain, country,
|
|
6222
|
+
* locale, currency, name).
|
|
6223
|
+
*/
|
|
6224
|
+
async markets() {
|
|
6225
|
+
return this.client.request("/v1/immobiliare/markets");
|
|
6226
|
+
}
|
|
6227
|
+
/**
|
|
6228
|
+
* Get the filter enums accepted by {@link search}.
|
|
6229
|
+
*
|
|
6230
|
+
* @returns Reference response with `contracts`, `categories`, and `sorts`.
|
|
6231
|
+
*/
|
|
6232
|
+
async reference() {
|
|
6233
|
+
return this.client.request("/v1/immobiliare/reference");
|
|
6234
|
+
}
|
|
6235
|
+
};
|
|
6236
|
+
|
|
6237
|
+
// src/loopnet/search.ts
|
|
6238
|
+
var SearchClient12 = class {
|
|
6239
|
+
client;
|
|
6240
|
+
constructor(client) {
|
|
6241
|
+
this.client = client;
|
|
6242
|
+
}
|
|
6243
|
+
/**
|
|
6244
|
+
* Search LoopNet for for-lease / for-sale / auction commercial listings.
|
|
6245
|
+
*
|
|
6246
|
+
* Costs 10 credits.
|
|
6247
|
+
*
|
|
6248
|
+
* @param params - Search parameters including location, filters, and pagination.
|
|
6249
|
+
* @returns Search results with listing cards and pagination metadata.
|
|
6250
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
6251
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
6252
|
+
*/
|
|
6253
|
+
async search(params) {
|
|
6254
|
+
return this.client.request("/v1/loopnet/search", {
|
|
6255
|
+
params: {
|
|
6256
|
+
location: params.location,
|
|
6257
|
+
market: params.market,
|
|
6258
|
+
listing_type: params.listing_type,
|
|
6259
|
+
property_type: params.property_type,
|
|
6260
|
+
page: params.page,
|
|
6261
|
+
min_price: params.min_price,
|
|
6262
|
+
max_price: params.max_price,
|
|
6263
|
+
price_type: params.price_type,
|
|
6264
|
+
min_size: params.min_size,
|
|
6265
|
+
max_size: params.max_size
|
|
6266
|
+
}
|
|
6267
|
+
});
|
|
6268
|
+
}
|
|
6269
|
+
};
|
|
6270
|
+
|
|
6271
|
+
// src/loopnet/listings.ts
|
|
6272
|
+
var ListingsClient2 = class {
|
|
6273
|
+
client;
|
|
6274
|
+
constructor(client) {
|
|
6275
|
+
this.client = client;
|
|
6276
|
+
}
|
|
6277
|
+
/**
|
|
6278
|
+
* Get a single LoopNet listing's full detail by listing id.
|
|
6279
|
+
*
|
|
6280
|
+
* Costs 12 credits.
|
|
6281
|
+
*
|
|
6282
|
+
* @param listingId - The LoopNet listing id.
|
|
6283
|
+
* @param params - Optional market selector.
|
|
6284
|
+
* @returns Listing detail response.
|
|
6285
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
6286
|
+
*/
|
|
6287
|
+
async get(listingId, params = {}) {
|
|
6288
|
+
return this.client.request(`/v1/loopnet/listings/${listingId}`, {
|
|
6289
|
+
params: { market: params.market }
|
|
6290
|
+
});
|
|
6291
|
+
}
|
|
6292
|
+
};
|
|
6293
|
+
|
|
6294
|
+
// src/loopnet/brokers.ts
|
|
6295
|
+
var BrokersClient = class {
|
|
6296
|
+
client;
|
|
6297
|
+
constructor(client) {
|
|
6298
|
+
this.client = client;
|
|
6299
|
+
}
|
|
6300
|
+
/**
|
|
6301
|
+
* Get a LoopNet broker's profile and their active listings.
|
|
6302
|
+
*
|
|
6303
|
+
* Costs 8 credits.
|
|
6304
|
+
*
|
|
6305
|
+
* @param slug - The broker's profile URL slug.
|
|
6306
|
+
* @param brokerId - The LoopNet broker id.
|
|
6307
|
+
* @param params - Optional market selector.
|
|
6308
|
+
* @returns Broker profile response with the broker and their listings.
|
|
6309
|
+
* @throws NotFoundError - If the broker doesn't exist.
|
|
6310
|
+
*/
|
|
6311
|
+
async get(slug, brokerId, params = {}) {
|
|
6312
|
+
return this.client.request(`/v1/loopnet/brokers/${slug}/${brokerId}`, {
|
|
6313
|
+
params: { market: params.market }
|
|
6314
|
+
});
|
|
6315
|
+
}
|
|
6316
|
+
};
|
|
6317
|
+
|
|
6318
|
+
// src/loopnet/reference.ts
|
|
6319
|
+
var ReferenceClient10 = class {
|
|
6320
|
+
client;
|
|
6321
|
+
constructor(client) {
|
|
6322
|
+
this.client = client;
|
|
6323
|
+
}
|
|
6324
|
+
/**
|
|
6325
|
+
* List LoopNet coverage markets (us, ca, uk, fr, es).
|
|
6326
|
+
*
|
|
6327
|
+
* Free — costs 0 credits.
|
|
6328
|
+
*
|
|
6329
|
+
* @returns Markets response with all supported coverage markets.
|
|
6330
|
+
*/
|
|
6331
|
+
async markets() {
|
|
6332
|
+
return this.client.request("/v1/loopnet/markets");
|
|
6333
|
+
}
|
|
6334
|
+
/**
|
|
6335
|
+
* List LoopNet property-type facets (Office, Retail, Industrial, …).
|
|
6336
|
+
*
|
|
6337
|
+
* Free — costs 0 credits.
|
|
6338
|
+
*
|
|
6339
|
+
* @returns Property-types response with all searchable property-type slugs.
|
|
6340
|
+
*/
|
|
6341
|
+
async propertyTypes() {
|
|
6342
|
+
return this.client.request("/v1/loopnet/property-types");
|
|
6343
|
+
}
|
|
6344
|
+
};
|
|
6345
|
+
|
|
6346
|
+
// src/loopnet/client.ts
|
|
6347
|
+
var LoopNetClient = class {
|
|
6348
|
+
/** Client for for-lease / for-sale / auction commercial-listing search */
|
|
6349
|
+
search;
|
|
6350
|
+
/** Client for listing detail (by listing id) */
|
|
6351
|
+
listings;
|
|
6352
|
+
/** Client for broker profile and their active listings */
|
|
6353
|
+
brokers;
|
|
6354
|
+
/** Client for reference data (markets, property types) */
|
|
6355
|
+
reference;
|
|
6356
|
+
/**
|
|
6357
|
+
* Create a new LoopNet client.
|
|
6358
|
+
*
|
|
6359
|
+
* @param client - The base HTTP client for making requests.
|
|
6360
|
+
*/
|
|
6361
|
+
constructor(client) {
|
|
6362
|
+
this.search = new SearchClient12(client);
|
|
6363
|
+
this.listings = new ListingsClient2(client);
|
|
6364
|
+
this.brokers = new BrokersClient(client);
|
|
6365
|
+
this.reference = new ReferenceClient10(client);
|
|
6366
|
+
}
|
|
6367
|
+
};
|
|
6368
|
+
|
|
6107
6369
|
// src/client.ts
|
|
6108
6370
|
var ScrapeBadger = class {
|
|
6109
6371
|
baseClient;
|
|
@@ -6133,6 +6395,10 @@ var ScrapeBadger = class {
|
|
|
6133
6395
|
leboncoin;
|
|
6134
6396
|
/** Zillow scraper API client — 5 endpoints (search, property, agent, autocomplete, markets) */
|
|
6135
6397
|
zillow;
|
|
6398
|
+
/** Immobiliare scraper API client — 8 endpoints across 4 markets (it, es, gr, lu) */
|
|
6399
|
+
immobiliare;
|
|
6400
|
+
/** LoopNet scraper API client — commercial real estate across US/CA/UK/FR/ES (search, listing, broker, markets, property types) */
|
|
6401
|
+
loopnet;
|
|
6136
6402
|
/**
|
|
6137
6403
|
* Create a new ScrapeBadger client.
|
|
6138
6404
|
*
|
|
@@ -6180,6 +6446,8 @@ var ScrapeBadger = class {
|
|
|
6180
6446
|
this.realtor = new RealtorClient(this.baseClient);
|
|
6181
6447
|
this.leboncoin = new LeboncoinClient(this.baseClient);
|
|
6182
6448
|
this.zillow = new ZillowClient(this.baseClient);
|
|
6449
|
+
this.immobiliare = new ImmobiliareClient(this.baseClient);
|
|
6450
|
+
this.loopnet = new LoopNetClient(this.baseClient);
|
|
6183
6451
|
}
|
|
6184
6452
|
};
|
|
6185
6453
|
|
|
@@ -6219,6 +6487,7 @@ exports.GoogleShoppingClient = ShoppingClient;
|
|
|
6219
6487
|
exports.GoogleShortsClient = ShortsClient;
|
|
6220
6488
|
exports.GoogleTrendsClient = TrendsClient2;
|
|
6221
6489
|
exports.GoogleVideosClient = VideosClient;
|
|
6490
|
+
exports.ImmobiliareClient = ImmobiliareClient;
|
|
6222
6491
|
exports.InsufficientCreditsError = InsufficientCreditsError;
|
|
6223
6492
|
exports.LeboncoinAdsClient = AdsClient2;
|
|
6224
6493
|
exports.LeboncoinClient = LeboncoinClient;
|
|
@@ -6226,6 +6495,11 @@ exports.LeboncoinReferenceClient = ReferenceClient8;
|
|
|
6226
6495
|
exports.LeboncoinSearchClient = SearchClient10;
|
|
6227
6496
|
exports.LeboncoinSellersClient = SellersClient3;
|
|
6228
6497
|
exports.ListsClient = ListsClient;
|
|
6498
|
+
exports.LoopNetBrokersClient = BrokersClient;
|
|
6499
|
+
exports.LoopNetClient = LoopNetClient;
|
|
6500
|
+
exports.LoopNetListingsClient = ListingsClient2;
|
|
6501
|
+
exports.LoopNetReferenceClient = ReferenceClient10;
|
|
6502
|
+
exports.LoopNetSearchClient = SearchClient12;
|
|
6229
6503
|
exports.NotFoundError = NotFoundError;
|
|
6230
6504
|
exports.RateLimitError = RateLimitError;
|
|
6231
6505
|
exports.RealtorClient = RealtorClient;
|