scrapebadger 0.26.1 → 0.27.1

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/dist/index.mjs CHANGED
@@ -4039,6 +4039,55 @@ var RedditClient = class {
4039
4039
  }
4040
4040
  };
4041
4041
 
4042
+ // src/apartments/client.ts
4043
+ var ApartmentsClient = class {
4044
+ constructor(client) {
4045
+ this.client = client;
4046
+ }
4047
+ /**
4048
+ * Search rental listings in a location.
4049
+ *
4050
+ * @param location - apartments.com slug (`"kansas-city-mo"`) or a ZIP.
4051
+ * @param params - Optional page and bed/price filters.
4052
+ *
4053
+ * @remarks
4054
+ * Cards are summaries with a rent/bed rollup. For per-unit rent and
4055
+ * availability, pass a card's `url` to {@link getProperty}.
4056
+ */
4057
+ async search(location, params = {}) {
4058
+ const query = {
4059
+ location,
4060
+ page: params.page ?? 1
4061
+ };
4062
+ if (params.beds !== void 0) query.beds = params.beds;
4063
+ if (params.minPrice !== void 0) query.min_price = params.minPrice;
4064
+ if (params.maxPrice !== void 0) query.max_price = params.maxPrice;
4065
+ return this.client.request("/v1/apartments/search", { params: query });
4066
+ }
4067
+ /**
4068
+ * Get one property with floor plans and per-unit inventory.
4069
+ *
4070
+ * @param url - Full property URL. Omit to look up by `slug` + `propertyId`.
4071
+ * @param params - `slug` and `propertyId` alternative to a URL.
4072
+ *
4073
+ * @remarks
4074
+ * Use `unit.rent` (the advertised price), not `unit.max_term_rent` — the
4075
+ * latter is the site's raw `data-maxrent`, roughly double the advertised
4076
+ * rent.
4077
+ */
4078
+ async getProperty(url, params = {}) {
4079
+ if (url) {
4080
+ return this.client.request("/v1/apartments/property", { params: { url } });
4081
+ }
4082
+ if (params.slug && params.propertyId) {
4083
+ return this.client.request(
4084
+ `/v1/apartments/properties/${params.slug}/${params.propertyId}`
4085
+ );
4086
+ }
4087
+ throw new Error("Provide either url, or both slug and propertyId");
4088
+ }
4089
+ };
4090
+
4042
4091
  // src/redfin/client.ts
4043
4092
  var RedfinClient = class {
4044
4093
  client;
@@ -6977,6 +7026,8 @@ var ScrapeBadger = class {
6977
7026
  google;
6978
7027
  /** Reddit scraper API client */
6979
7028
  reddit;
7029
+ /** Apartments.com scraper API client — search + property with unit-level pricing (US) */
7030
+ apartments;
6980
7031
  /** Redfin scraper API client — search, property, agent, autocomplete, markets (redfin.com, US) */
6981
7032
  redfin;
6982
7033
  /** Amazon scraper API client — 14 endpoints */
@@ -7044,6 +7095,7 @@ var ScrapeBadger = class {
7044
7095
  this.vinted = new VintedClient(this.baseClient);
7045
7096
  this.google = new GoogleClient(this.baseClient);
7046
7097
  this.reddit = new RedditClient(this.baseClient);
7098
+ this.apartments = new ApartmentsClient(this.baseClient);
7047
7099
  this.redfin = new RedfinClient(this.baseClient);
7048
7100
  this.amazon = new AmazonClient(this.baseClient);
7049
7101
  this.shopee = new ShopeeClient(this.baseClient);
@@ -7061,6 +7113,6 @@ var ScrapeBadger = class {
7061
7113
  }
7062
7114
  };
7063
7115
 
7064
- export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient11 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, 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, LinkedInClient, 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, RedfinClient, 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 };
7116
+ export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient11 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, 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, LinkedInClient, 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, RedfinClient, 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 };
7065
7117
  //# sourceMappingURL=index.mjs.map
7066
7118
  //# sourceMappingURL=index.mjs.map