scrapebadger 0.15.5 → 0.16.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 +1398 -118
- package/dist/index.d.ts +1398 -118
- package/dist/index.js +286 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +281 -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 {
|
|
@@ -5955,6 +5955,279 @@ var LeboncoinClient = class {
|
|
|
5955
5955
|
}
|
|
5956
5956
|
};
|
|
5957
5957
|
|
|
5958
|
+
// src/zillow/search.ts
|
|
5959
|
+
var SearchClient11 = class {
|
|
5960
|
+
client;
|
|
5961
|
+
constructor(client) {
|
|
5962
|
+
this.client = client;
|
|
5963
|
+
}
|
|
5964
|
+
/**
|
|
5965
|
+
* Search Zillow for properties.
|
|
5966
|
+
*
|
|
5967
|
+
* Beat the ~820-result (20-page) cap by re-issuing the search over
|
|
5968
|
+
* subdivided `north/south/east/west` map-bound boxes returned in
|
|
5969
|
+
* `map_bounds`.
|
|
5970
|
+
*
|
|
5971
|
+
* @param location - City/state, ZIP, address, or neighborhood ("Austin, TX").
|
|
5972
|
+
* @param options - Filters, sorting, pagination, and map bounds.
|
|
5973
|
+
* @returns Search results with pagination and map metadata.
|
|
5974
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
5975
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
5976
|
+
*/
|
|
5977
|
+
async search(location, options = {}) {
|
|
5978
|
+
return this.client.request("/v1/zillow/search", {
|
|
5979
|
+
params: {
|
|
5980
|
+
location,
|
|
5981
|
+
status: options.status,
|
|
5982
|
+
page: options.page,
|
|
5983
|
+
sort: options.sort,
|
|
5984
|
+
price_min: options.priceMin,
|
|
5985
|
+
price_max: options.priceMax,
|
|
5986
|
+
beds_min: options.bedsMin,
|
|
5987
|
+
baths_min: options.bathsMin,
|
|
5988
|
+
home_type: options.homeType,
|
|
5989
|
+
sqft_min: options.sqftMin,
|
|
5990
|
+
sqft_max: options.sqftMax,
|
|
5991
|
+
lot_min: options.lotMin,
|
|
5992
|
+
lot_max: options.lotMax,
|
|
5993
|
+
year_built_min: options.yearBuiltMin,
|
|
5994
|
+
year_built_max: options.yearBuiltMax,
|
|
5995
|
+
hoa_max: options.hoaMax,
|
|
5996
|
+
keywords: options.keywords,
|
|
5997
|
+
days_on: options.daysOn,
|
|
5998
|
+
north: options.north,
|
|
5999
|
+
south: options.south,
|
|
6000
|
+
east: options.east,
|
|
6001
|
+
west: options.west
|
|
6002
|
+
}
|
|
6003
|
+
});
|
|
6004
|
+
}
|
|
6005
|
+
/**
|
|
6006
|
+
* Resolve a search term to Zillow regions/addresses (regionId, lat/lng).
|
|
6007
|
+
*
|
|
6008
|
+
* @param query - Partial location — city, ZIP, address, or neighborhood.
|
|
6009
|
+
* @returns Autocomplete suggestions.
|
|
6010
|
+
*/
|
|
6011
|
+
async autocomplete(query) {
|
|
6012
|
+
return this.client.request("/v1/zillow/autocomplete", {
|
|
6013
|
+
params: { query }
|
|
6014
|
+
});
|
|
6015
|
+
}
|
|
6016
|
+
};
|
|
6017
|
+
|
|
6018
|
+
// src/zillow/properties.ts
|
|
6019
|
+
var PropertiesClient2 = class {
|
|
6020
|
+
client;
|
|
6021
|
+
constructor(client) {
|
|
6022
|
+
this.client = client;
|
|
6023
|
+
}
|
|
6024
|
+
/**
|
|
6025
|
+
* Get a single Zillow property's full detail by its zpid.
|
|
6026
|
+
*
|
|
6027
|
+
* Returns price/valuation, specs, resoFacts (home_facts), price & tax
|
|
6028
|
+
* history, schools, listing agent, mortgage rates and photos.
|
|
6029
|
+
*
|
|
6030
|
+
* @param zpid - The Zillow property id.
|
|
6031
|
+
* @returns Property detail wrapped in `{ property }`.
|
|
6032
|
+
* @throws NotFoundError - If the property doesn't exist.
|
|
6033
|
+
*/
|
|
6034
|
+
async getProperty(zpid) {
|
|
6035
|
+
return this.client.request(`/v1/zillow/property/${zpid}`);
|
|
6036
|
+
}
|
|
6037
|
+
};
|
|
6038
|
+
|
|
6039
|
+
// src/zillow/agent.ts
|
|
6040
|
+
var AgentClient = class {
|
|
6041
|
+
client;
|
|
6042
|
+
constructor(client) {
|
|
6043
|
+
this.client = client;
|
|
6044
|
+
}
|
|
6045
|
+
/**
|
|
6046
|
+
* Get a Zillow real-estate professional's profile and their active listings.
|
|
6047
|
+
*
|
|
6048
|
+
* Provide either a `username` (screen name) or a full `url`.
|
|
6049
|
+
*
|
|
6050
|
+
* @param options - The agent `username` or profile `url`.
|
|
6051
|
+
* @returns Agent profile wrapped in `{ agent }`.
|
|
6052
|
+
* @throws NotFoundError - If the agent doesn't exist.
|
|
6053
|
+
* @throws ValidationError - If neither username nor url is provided.
|
|
6054
|
+
*/
|
|
6055
|
+
async getAgent(options = {}) {
|
|
6056
|
+
return this.client.request("/v1/zillow/agent", {
|
|
6057
|
+
params: { username: options.username, url: options.url }
|
|
6058
|
+
});
|
|
6059
|
+
}
|
|
6060
|
+
};
|
|
6061
|
+
|
|
6062
|
+
// src/zillow/reference.ts
|
|
6063
|
+
var ReferenceClient9 = class {
|
|
6064
|
+
client;
|
|
6065
|
+
constructor(client) {
|
|
6066
|
+
this.client = client;
|
|
6067
|
+
}
|
|
6068
|
+
/**
|
|
6069
|
+
* List Zillow coverage regions (US + Canada, all served via zillow.com).
|
|
6070
|
+
*
|
|
6071
|
+
* @returns Markets response with all supported markets.
|
|
6072
|
+
*/
|
|
6073
|
+
async listMarkets() {
|
|
6074
|
+
return this.client.request("/v1/zillow/markets");
|
|
6075
|
+
}
|
|
6076
|
+
};
|
|
6077
|
+
|
|
6078
|
+
// src/zillow/client.ts
|
|
6079
|
+
var ZillowClient = class {
|
|
6080
|
+
/** Client for property search and location autocomplete */
|
|
6081
|
+
search;
|
|
6082
|
+
/** Client for full property detail */
|
|
6083
|
+
properties;
|
|
6084
|
+
/** Client for agent profile + listings */
|
|
6085
|
+
agent;
|
|
6086
|
+
/** Client for reference data (markets) */
|
|
6087
|
+
reference;
|
|
6088
|
+
/**
|
|
6089
|
+
* Create a new Zillow client.
|
|
6090
|
+
*
|
|
6091
|
+
* @param client - The base HTTP client for making requests.
|
|
6092
|
+
*/
|
|
6093
|
+
constructor(client) {
|
|
6094
|
+
this.search = new SearchClient11(client);
|
|
6095
|
+
this.properties = new PropertiesClient2(client);
|
|
6096
|
+
this.agent = new AgentClient(client);
|
|
6097
|
+
this.reference = new ReferenceClient9(client);
|
|
6098
|
+
}
|
|
6099
|
+
};
|
|
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
|
+
|
|
5958
6231
|
// src/client.ts
|
|
5959
6232
|
var ScrapeBadger = class {
|
|
5960
6233
|
baseClient;
|
|
@@ -5982,6 +6255,10 @@ var ScrapeBadger = class {
|
|
|
5982
6255
|
realtor;
|
|
5983
6256
|
/** Leboncoin scraper API client — 10 endpoints (France) */
|
|
5984
6257
|
leboncoin;
|
|
6258
|
+
/** Zillow scraper API client — 5 endpoints (search, property, agent, autocomplete, markets) */
|
|
6259
|
+
zillow;
|
|
6260
|
+
/** Immobiliare scraper API client — 8 endpoints across 4 markets (it, es, gr, lu) */
|
|
6261
|
+
immobiliare;
|
|
5985
6262
|
/**
|
|
5986
6263
|
* Create a new ScrapeBadger client.
|
|
5987
6264
|
*
|
|
@@ -6028,9 +6305,11 @@ var ScrapeBadger = class {
|
|
|
6028
6305
|
this.youtube = new YoutubeClient(this.baseClient);
|
|
6029
6306
|
this.realtor = new RealtorClient(this.baseClient);
|
|
6030
6307
|
this.leboncoin = new LeboncoinClient(this.baseClient);
|
|
6308
|
+
this.zillow = new ZillowClient(this.baseClient);
|
|
6309
|
+
this.immobiliare = new ImmobiliareClient(this.baseClient);
|
|
6031
6310
|
}
|
|
6032
6311
|
};
|
|
6033
6312
|
|
|
6034
|
-
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, collectAll, verifyWebhookSignature };
|
|
6313
|
+
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, 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 };
|
|
6035
6314
|
//# sourceMappingURL=index.mjs.map
|
|
6036
6315
|
//# sourceMappingURL=index.mjs.map
|