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.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { EventEmitter } from 'events';
|
|
|
3
3
|
import WebSocket from 'ws';
|
|
4
4
|
|
|
5
5
|
// src/internal/version.ts
|
|
6
|
-
var SDK_VERSION = "0.
|
|
6
|
+
var SDK_VERSION = "0.16.0";
|
|
7
7
|
|
|
8
8
|
// src/internal/exceptions.ts
|
|
9
9
|
var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
|
|
@@ -6098,6 +6098,268 @@ var ZillowClient = class {
|
|
|
6098
6098
|
}
|
|
6099
6099
|
};
|
|
6100
6100
|
|
|
6101
|
+
// src/immobiliare/client.ts
|
|
6102
|
+
var ImmobiliareClient = class {
|
|
6103
|
+
client;
|
|
6104
|
+
constructor(client) {
|
|
6105
|
+
this.client = client;
|
|
6106
|
+
}
|
|
6107
|
+
/**
|
|
6108
|
+
* Resolve a free-text place name into geography ids for search.
|
|
6109
|
+
*
|
|
6110
|
+
* @param query - Free-text place name, e.g. "Milano".
|
|
6111
|
+
* @param options - Optional parameters (market).
|
|
6112
|
+
* @returns Suggest response with region/province/city/zone id candidates.
|
|
6113
|
+
*/
|
|
6114
|
+
async autocomplete(query, options = {}) {
|
|
6115
|
+
return this.client.request("/v1/immobiliare/autocomplete", {
|
|
6116
|
+
params: { query, market: options.market }
|
|
6117
|
+
});
|
|
6118
|
+
}
|
|
6119
|
+
/**
|
|
6120
|
+
* Search Immobiliare-group listings.
|
|
6121
|
+
*
|
|
6122
|
+
* Scope the search by `location` (free text, auto-resolved) OR explicit
|
|
6123
|
+
* `region_id` / `province_id` / `city_id` from {@link autocomplete}.
|
|
6124
|
+
*
|
|
6125
|
+
* @param options - Search parameters (market, location/ids, contract,
|
|
6126
|
+
* category, price/surface/room/bathroom filters, sort, page).
|
|
6127
|
+
* @returns Search response with `listings` and pagination metadata.
|
|
6128
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
6129
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
6130
|
+
*/
|
|
6131
|
+
async search(options = {}) {
|
|
6132
|
+
return this.client.request("/v1/immobiliare/search", {
|
|
6133
|
+
params: {
|
|
6134
|
+
market: options.market,
|
|
6135
|
+
location: options.location,
|
|
6136
|
+
region_id: options.region_id,
|
|
6137
|
+
province_id: options.province_id,
|
|
6138
|
+
city_id: options.city_id,
|
|
6139
|
+
contract: options.contract,
|
|
6140
|
+
category: options.category,
|
|
6141
|
+
price_min: options.price_min,
|
|
6142
|
+
price_max: options.price_max,
|
|
6143
|
+
surface_min: options.surface_min,
|
|
6144
|
+
surface_max: options.surface_max,
|
|
6145
|
+
rooms_min: options.rooms_min,
|
|
6146
|
+
rooms_max: options.rooms_max,
|
|
6147
|
+
bathrooms_min: options.bathrooms_min,
|
|
6148
|
+
sort: options.sort,
|
|
6149
|
+
page: options.page
|
|
6150
|
+
}
|
|
6151
|
+
});
|
|
6152
|
+
}
|
|
6153
|
+
/**
|
|
6154
|
+
* Get the full detail for a single Immobiliare listing.
|
|
6155
|
+
*
|
|
6156
|
+
* @param listingId - The Immobiliare listing id.
|
|
6157
|
+
* @param options - Optional parameters (market).
|
|
6158
|
+
* @returns The full listing detail.
|
|
6159
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
6160
|
+
*/
|
|
6161
|
+
async getListing(listingId, options = {}) {
|
|
6162
|
+
return this.client.request(`/v1/immobiliare/listings/${listingId}`, {
|
|
6163
|
+
params: { market: options.market }
|
|
6164
|
+
});
|
|
6165
|
+
}
|
|
6166
|
+
/**
|
|
6167
|
+
* Get an agency/advertiser profile.
|
|
6168
|
+
*
|
|
6169
|
+
* @param agencyId - The Immobiliare agency id.
|
|
6170
|
+
* @param options - Optional parameters (market).
|
|
6171
|
+
* @returns The full agency profile.
|
|
6172
|
+
* @throws NotFoundError - If the agency doesn't exist.
|
|
6173
|
+
*/
|
|
6174
|
+
async getAgency(agencyId, options = {}) {
|
|
6175
|
+
return this.client.request(`/v1/immobiliare/agencies/${agencyId}`, {
|
|
6176
|
+
params: { market: options.market }
|
|
6177
|
+
});
|
|
6178
|
+
}
|
|
6179
|
+
/**
|
|
6180
|
+
* Get an agency's active listings (25 per page).
|
|
6181
|
+
*
|
|
6182
|
+
* @param agencyId - The Immobiliare agency id.
|
|
6183
|
+
* @param options - Optional parameters (market, page).
|
|
6184
|
+
* @returns Agency-listings response with `listings` and pagination.
|
|
6185
|
+
*/
|
|
6186
|
+
async getAgencyListings(agencyId, options = {}) {
|
|
6187
|
+
return this.client.request(
|
|
6188
|
+
`/v1/immobiliare/agencies/${agencyId}/listings`,
|
|
6189
|
+
{
|
|
6190
|
+
params: { market: options.market, page: options.page }
|
|
6191
|
+
}
|
|
6192
|
+
);
|
|
6193
|
+
}
|
|
6194
|
+
/**
|
|
6195
|
+
* Get the historical average €/m² time series for an area.
|
|
6196
|
+
*
|
|
6197
|
+
* @param regionId - Region id, e.g. "lom" (required).
|
|
6198
|
+
* @param options - Optional parameters (province_id, city_id, market, contract).
|
|
6199
|
+
* @returns Price-stats response with monthly `points` (label + EUR/m² value).
|
|
6200
|
+
*/
|
|
6201
|
+
async priceStats(regionId, options = {}) {
|
|
6202
|
+
return this.client.request("/v1/immobiliare/market-insights/prices", {
|
|
6203
|
+
params: {
|
|
6204
|
+
market: options.market,
|
|
6205
|
+
region_id: regionId,
|
|
6206
|
+
province_id: options.province_id,
|
|
6207
|
+
city_id: options.city_id,
|
|
6208
|
+
contract: options.contract
|
|
6209
|
+
}
|
|
6210
|
+
});
|
|
6211
|
+
}
|
|
6212
|
+
/**
|
|
6213
|
+
* Get all supported Immobiliare-group markets (it, es, gr, lu).
|
|
6214
|
+
*
|
|
6215
|
+
* @returns A bare array of supported markets (code, domain, country,
|
|
6216
|
+
* locale, currency, name).
|
|
6217
|
+
*/
|
|
6218
|
+
async markets() {
|
|
6219
|
+
return this.client.request("/v1/immobiliare/markets");
|
|
6220
|
+
}
|
|
6221
|
+
/**
|
|
6222
|
+
* Get the filter enums accepted by {@link search}.
|
|
6223
|
+
*
|
|
6224
|
+
* @returns Reference response with `contracts`, `categories`, and `sorts`.
|
|
6225
|
+
*/
|
|
6226
|
+
async reference() {
|
|
6227
|
+
return this.client.request("/v1/immobiliare/reference");
|
|
6228
|
+
}
|
|
6229
|
+
};
|
|
6230
|
+
|
|
6231
|
+
// src/loopnet/search.ts
|
|
6232
|
+
var SearchClient12 = class {
|
|
6233
|
+
client;
|
|
6234
|
+
constructor(client) {
|
|
6235
|
+
this.client = client;
|
|
6236
|
+
}
|
|
6237
|
+
/**
|
|
6238
|
+
* Search LoopNet for for-lease / for-sale / auction commercial listings.
|
|
6239
|
+
*
|
|
6240
|
+
* Costs 10 credits.
|
|
6241
|
+
*
|
|
6242
|
+
* @param params - Search parameters including location, filters, and pagination.
|
|
6243
|
+
* @returns Search results with listing cards and pagination metadata.
|
|
6244
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
6245
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
6246
|
+
*/
|
|
6247
|
+
async search(params) {
|
|
6248
|
+
return this.client.request("/v1/loopnet/search", {
|
|
6249
|
+
params: {
|
|
6250
|
+
location: params.location,
|
|
6251
|
+
market: params.market,
|
|
6252
|
+
listing_type: params.listing_type,
|
|
6253
|
+
property_type: params.property_type,
|
|
6254
|
+
page: params.page,
|
|
6255
|
+
min_price: params.min_price,
|
|
6256
|
+
max_price: params.max_price,
|
|
6257
|
+
price_type: params.price_type,
|
|
6258
|
+
min_size: params.min_size,
|
|
6259
|
+
max_size: params.max_size
|
|
6260
|
+
}
|
|
6261
|
+
});
|
|
6262
|
+
}
|
|
6263
|
+
};
|
|
6264
|
+
|
|
6265
|
+
// src/loopnet/listings.ts
|
|
6266
|
+
var ListingsClient2 = class {
|
|
6267
|
+
client;
|
|
6268
|
+
constructor(client) {
|
|
6269
|
+
this.client = client;
|
|
6270
|
+
}
|
|
6271
|
+
/**
|
|
6272
|
+
* Get a single LoopNet listing's full detail by listing id.
|
|
6273
|
+
*
|
|
6274
|
+
* Costs 12 credits.
|
|
6275
|
+
*
|
|
6276
|
+
* @param listingId - The LoopNet listing id.
|
|
6277
|
+
* @param params - Optional market selector.
|
|
6278
|
+
* @returns Listing detail response.
|
|
6279
|
+
* @throws NotFoundError - If the listing doesn't exist.
|
|
6280
|
+
*/
|
|
6281
|
+
async get(listingId, params = {}) {
|
|
6282
|
+
return this.client.request(`/v1/loopnet/listings/${listingId}`, {
|
|
6283
|
+
params: { market: params.market }
|
|
6284
|
+
});
|
|
6285
|
+
}
|
|
6286
|
+
};
|
|
6287
|
+
|
|
6288
|
+
// src/loopnet/brokers.ts
|
|
6289
|
+
var BrokersClient = class {
|
|
6290
|
+
client;
|
|
6291
|
+
constructor(client) {
|
|
6292
|
+
this.client = client;
|
|
6293
|
+
}
|
|
6294
|
+
/**
|
|
6295
|
+
* Get a LoopNet broker's profile and their active listings.
|
|
6296
|
+
*
|
|
6297
|
+
* Costs 8 credits.
|
|
6298
|
+
*
|
|
6299
|
+
* @param slug - The broker's profile URL slug.
|
|
6300
|
+
* @param brokerId - The LoopNet broker id.
|
|
6301
|
+
* @param params - Optional market selector.
|
|
6302
|
+
* @returns Broker profile response with the broker and their listings.
|
|
6303
|
+
* @throws NotFoundError - If the broker doesn't exist.
|
|
6304
|
+
*/
|
|
6305
|
+
async get(slug, brokerId, params = {}) {
|
|
6306
|
+
return this.client.request(`/v1/loopnet/brokers/${slug}/${brokerId}`, {
|
|
6307
|
+
params: { market: params.market }
|
|
6308
|
+
});
|
|
6309
|
+
}
|
|
6310
|
+
};
|
|
6311
|
+
|
|
6312
|
+
// src/loopnet/reference.ts
|
|
6313
|
+
var ReferenceClient10 = class {
|
|
6314
|
+
client;
|
|
6315
|
+
constructor(client) {
|
|
6316
|
+
this.client = client;
|
|
6317
|
+
}
|
|
6318
|
+
/**
|
|
6319
|
+
* List LoopNet coverage markets (us, ca, uk, fr, es).
|
|
6320
|
+
*
|
|
6321
|
+
* Free — costs 0 credits.
|
|
6322
|
+
*
|
|
6323
|
+
* @returns Markets response with all supported coverage markets.
|
|
6324
|
+
*/
|
|
6325
|
+
async markets() {
|
|
6326
|
+
return this.client.request("/v1/loopnet/markets");
|
|
6327
|
+
}
|
|
6328
|
+
/**
|
|
6329
|
+
* List LoopNet property-type facets (Office, Retail, Industrial, …).
|
|
6330
|
+
*
|
|
6331
|
+
* Free — costs 0 credits.
|
|
6332
|
+
*
|
|
6333
|
+
* @returns Property-types response with all searchable property-type slugs.
|
|
6334
|
+
*/
|
|
6335
|
+
async propertyTypes() {
|
|
6336
|
+
return this.client.request("/v1/loopnet/property-types");
|
|
6337
|
+
}
|
|
6338
|
+
};
|
|
6339
|
+
|
|
6340
|
+
// src/loopnet/client.ts
|
|
6341
|
+
var LoopNetClient = class {
|
|
6342
|
+
/** Client for for-lease / for-sale / auction commercial-listing search */
|
|
6343
|
+
search;
|
|
6344
|
+
/** Client for listing detail (by listing id) */
|
|
6345
|
+
listings;
|
|
6346
|
+
/** Client for broker profile and their active listings */
|
|
6347
|
+
brokers;
|
|
6348
|
+
/** Client for reference data (markets, property types) */
|
|
6349
|
+
reference;
|
|
6350
|
+
/**
|
|
6351
|
+
* Create a new LoopNet client.
|
|
6352
|
+
*
|
|
6353
|
+
* @param client - The base HTTP client for making requests.
|
|
6354
|
+
*/
|
|
6355
|
+
constructor(client) {
|
|
6356
|
+
this.search = new SearchClient12(client);
|
|
6357
|
+
this.listings = new ListingsClient2(client);
|
|
6358
|
+
this.brokers = new BrokersClient(client);
|
|
6359
|
+
this.reference = new ReferenceClient10(client);
|
|
6360
|
+
}
|
|
6361
|
+
};
|
|
6362
|
+
|
|
6101
6363
|
// src/client.ts
|
|
6102
6364
|
var ScrapeBadger = class {
|
|
6103
6365
|
baseClient;
|
|
@@ -6127,6 +6389,10 @@ var ScrapeBadger = class {
|
|
|
6127
6389
|
leboncoin;
|
|
6128
6390
|
/** Zillow scraper API client — 5 endpoints (search, property, agent, autocomplete, markets) */
|
|
6129
6391
|
zillow;
|
|
6392
|
+
/** Immobiliare scraper API client — 8 endpoints across 4 markets (it, es, gr, lu) */
|
|
6393
|
+
immobiliare;
|
|
6394
|
+
/** LoopNet scraper API client — commercial real estate across US/CA/UK/FR/ES (search, listing, broker, markets, property types) */
|
|
6395
|
+
loopnet;
|
|
6130
6396
|
/**
|
|
6131
6397
|
* Create a new ScrapeBadger client.
|
|
6132
6398
|
*
|
|
@@ -6174,9 +6440,11 @@ var ScrapeBadger = class {
|
|
|
6174
6440
|
this.realtor = new RealtorClient(this.baseClient);
|
|
6175
6441
|
this.leboncoin = new LeboncoinClient(this.baseClient);
|
|
6176
6442
|
this.zillow = new ZillowClient(this.baseClient);
|
|
6443
|
+
this.immobiliare = new ImmobiliareClient(this.baseClient);
|
|
6444
|
+
this.loopnet = new LoopNetClient(this.baseClient);
|
|
6177
6445
|
}
|
|
6178
6446
|
};
|
|
6179
6447
|
|
|
6180
|
-
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient7 as EbaySearchClient, SellersClient2 as EbaySellersClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient8 as LeboncoinReferenceClient, SearchClient10 as LeboncoinSearchClient, SellersClient3 as LeboncoinSellersClient, ListsClient, NotFoundError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient7 as RealtorReferenceClient, SearchClient9 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient6 as YoutubeReferenceClient, SearchClient8 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient9 as ZillowReferenceClient, SearchClient11 as ZillowSearchClient, collectAll, verifyWebhookSignature };
|
|
6448
|
+
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient7 as EbaySearchClient, SellersClient2 as EbaySellersClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, ImmobiliareClient, InsufficientCreditsError, AdsClient2 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient8 as LeboncoinReferenceClient, SearchClient10 as LeboncoinSearchClient, SellersClient3 as LeboncoinSellersClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient10 as LoopNetReferenceClient, SearchClient12 as LoopNetSearchClient, NotFoundError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient7 as RealtorReferenceClient, SearchClient9 as RealtorSearchClient, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient6 as YoutubeReferenceClient, SearchClient8 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient9 as ZillowReferenceClient, SearchClient11 as ZillowSearchClient, collectAll, verifyWebhookSignature };
|
|
6181
6449
|
//# sourceMappingURL=index.mjs.map
|
|
6182
6450
|
//# sourceMappingURL=index.mjs.map
|