scrapebadger 0.15.4 → 0.15.6

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.js CHANGED
@@ -5780,6 +5780,330 @@ var RealtorClient = class {
5780
5780
  }
5781
5781
  };
5782
5782
 
5783
+ // src/leboncoin/search.ts
5784
+ var SearchClient10 = class {
5785
+ client;
5786
+ constructor(client) {
5787
+ this.client = client;
5788
+ }
5789
+ /**
5790
+ * Search Leboncoin classified ads.
5791
+ *
5792
+ * France is a single market; scope results with `region_id` /
5793
+ * `department_id` / `city` (DOM-TOM are region values).
5794
+ *
5795
+ * @param params - Search parameters including text, filters, and pagination.
5796
+ * @returns Search results with ads, totals, and pagination metadata.
5797
+ * @throws AuthenticationError - If the API key is invalid.
5798
+ * @throws ValidationError - If the parameters are invalid.
5799
+ */
5800
+ async search(params = {}) {
5801
+ return this.client.request("/v1/leboncoin/search", {
5802
+ params: {
5803
+ text: params.text,
5804
+ category: params.category,
5805
+ region_id: params.region_id,
5806
+ department_id: params.department_id,
5807
+ city: params.city,
5808
+ zipcode: params.zipcode,
5809
+ price_min: params.price_min,
5810
+ price_max: params.price_max,
5811
+ owner_type: params.owner_type,
5812
+ ad_type: params.ad_type,
5813
+ sort: params.sort,
5814
+ page: params.page,
5815
+ limit: params.limit
5816
+ }
5817
+ });
5818
+ }
5819
+ };
5820
+
5821
+ // src/leboncoin/ads.ts
5822
+ var AdsClient2 = class {
5823
+ client;
5824
+ constructor(client) {
5825
+ this.client = client;
5826
+ }
5827
+ /**
5828
+ * Get a single Leboncoin ad's full detail.
5829
+ *
5830
+ * @param listId - The Leboncoin ad list id.
5831
+ * @returns Ad detail response.
5832
+ * @throws NotFoundError - If the ad doesn't exist.
5833
+ */
5834
+ async get(listId) {
5835
+ return this.client.request(`/v1/leboncoin/ads/${listId}`);
5836
+ }
5837
+ /**
5838
+ * Get the ads Leboncoin surfaces as similar to a given ad.
5839
+ *
5840
+ * @param listId - The Leboncoin ad list id.
5841
+ * @param options - Optional parameters (limit).
5842
+ * @returns Similar-ads response.
5843
+ */
5844
+ async similar(listId, options = {}) {
5845
+ return this.client.request(
5846
+ `/v1/leboncoin/ads/${listId}/similar`,
5847
+ { params: { limit: options.limit } }
5848
+ );
5849
+ }
5850
+ };
5851
+
5852
+ // src/leboncoin/sellers.ts
5853
+ var SellersClient3 = class {
5854
+ client;
5855
+ constructor(client) {
5856
+ this.client = client;
5857
+ }
5858
+ /**
5859
+ * Get a Leboncoin seller's public profile.
5860
+ *
5861
+ * @param userId - The seller user id.
5862
+ * @returns Seller profile response.
5863
+ * @throws NotFoundError - If the seller doesn't exist.
5864
+ */
5865
+ async get(userId) {
5866
+ return this.client.request(
5867
+ `/v1/leboncoin/sellers/${userId}`
5868
+ );
5869
+ }
5870
+ /**
5871
+ * List a Leboncoin seller's active ads.
5872
+ *
5873
+ * @param userId - The seller user id.
5874
+ * @param options - Optional parameters (page, limit).
5875
+ * @returns Seller listings response with ads and pagination.
5876
+ */
5877
+ async listings(userId, options = {}) {
5878
+ return this.client.request(
5879
+ `/v1/leboncoin/sellers/${userId}/listings`,
5880
+ { params: { page: options.page, limit: options.limit } }
5881
+ );
5882
+ }
5883
+ };
5884
+
5885
+ // src/leboncoin/reference.ts
5886
+ var ReferenceClient8 = class {
5887
+ client;
5888
+ constructor(client) {
5889
+ this.client = client;
5890
+ }
5891
+ /**
5892
+ * List all Leboncoin categories.
5893
+ *
5894
+ * @returns Categories response.
5895
+ */
5896
+ async categories() {
5897
+ return this.client.request("/v1/leboncoin/categories");
5898
+ }
5899
+ /**
5900
+ * List all Leboncoin regions.
5901
+ *
5902
+ * @returns Regions response.
5903
+ */
5904
+ async regions() {
5905
+ return this.client.request("/v1/leboncoin/regions");
5906
+ }
5907
+ /**
5908
+ * List Leboncoin departments, optionally filtered by region.
5909
+ *
5910
+ * @param options - Optional parameters (region_id).
5911
+ * @returns Departments response.
5912
+ */
5913
+ async departments(options = {}) {
5914
+ return this.client.request(
5915
+ "/v1/leboncoin/departments",
5916
+ { params: { region_id: options.region_id } }
5917
+ );
5918
+ }
5919
+ /**
5920
+ * Resolve a place name to Leboncoin location ids (for building filters).
5921
+ *
5922
+ * @param query - Place name to resolve.
5923
+ * @returns Location search response with suggestions.
5924
+ */
5925
+ async locations(query) {
5926
+ return this.client.request(
5927
+ "/v1/leboncoin/locations/search",
5928
+ { params: { q: query } }
5929
+ );
5930
+ }
5931
+ /**
5932
+ * List the supported Leboncoin markets (France is the single market).
5933
+ *
5934
+ * @returns Markets response.
5935
+ */
5936
+ async markets() {
5937
+ return this.client.request("/v1/leboncoin/markets");
5938
+ }
5939
+ };
5940
+
5941
+ // src/leboncoin/client.ts
5942
+ var LeboncoinClient = class {
5943
+ /** Client for ad search */
5944
+ search;
5945
+ /** Client for ad detail and similar ads */
5946
+ ads;
5947
+ /** Client for seller profile and listings */
5948
+ sellers;
5949
+ /** Client for reference data (categories, regions, departments, locations, markets) */
5950
+ reference;
5951
+ /**
5952
+ * Create a new Leboncoin client.
5953
+ *
5954
+ * @param client - The base HTTP client for making requests.
5955
+ */
5956
+ constructor(client) {
5957
+ this.search = new SearchClient10(client);
5958
+ this.ads = new AdsClient2(client);
5959
+ this.sellers = new SellersClient3(client);
5960
+ this.reference = new ReferenceClient8(client);
5961
+ }
5962
+ };
5963
+
5964
+ // src/zillow/search.ts
5965
+ var SearchClient11 = class {
5966
+ client;
5967
+ constructor(client) {
5968
+ this.client = client;
5969
+ }
5970
+ /**
5971
+ * Search Zillow for properties.
5972
+ *
5973
+ * Beat the ~820-result (20-page) cap by re-issuing the search over
5974
+ * subdivided `north/south/east/west` map-bound boxes returned in
5975
+ * `map_bounds`.
5976
+ *
5977
+ * @param location - City/state, ZIP, address, or neighborhood ("Austin, TX").
5978
+ * @param options - Filters, sorting, pagination, and map bounds.
5979
+ * @returns Search results with pagination and map metadata.
5980
+ * @throws AuthenticationError - If the API key is invalid.
5981
+ * @throws ValidationError - If the parameters are invalid.
5982
+ */
5983
+ async search(location, options = {}) {
5984
+ return this.client.request("/v1/zillow/search", {
5985
+ params: {
5986
+ location,
5987
+ status: options.status,
5988
+ page: options.page,
5989
+ sort: options.sort,
5990
+ price_min: options.priceMin,
5991
+ price_max: options.priceMax,
5992
+ beds_min: options.bedsMin,
5993
+ baths_min: options.bathsMin,
5994
+ home_type: options.homeType,
5995
+ sqft_min: options.sqftMin,
5996
+ sqft_max: options.sqftMax,
5997
+ lot_min: options.lotMin,
5998
+ lot_max: options.lotMax,
5999
+ year_built_min: options.yearBuiltMin,
6000
+ year_built_max: options.yearBuiltMax,
6001
+ hoa_max: options.hoaMax,
6002
+ keywords: options.keywords,
6003
+ days_on: options.daysOn,
6004
+ north: options.north,
6005
+ south: options.south,
6006
+ east: options.east,
6007
+ west: options.west
6008
+ }
6009
+ });
6010
+ }
6011
+ /**
6012
+ * Resolve a search term to Zillow regions/addresses (regionId, lat/lng).
6013
+ *
6014
+ * @param query - Partial location — city, ZIP, address, or neighborhood.
6015
+ * @returns Autocomplete suggestions.
6016
+ */
6017
+ async autocomplete(query) {
6018
+ return this.client.request("/v1/zillow/autocomplete", {
6019
+ params: { query }
6020
+ });
6021
+ }
6022
+ };
6023
+
6024
+ // src/zillow/properties.ts
6025
+ var PropertiesClient2 = class {
6026
+ client;
6027
+ constructor(client) {
6028
+ this.client = client;
6029
+ }
6030
+ /**
6031
+ * Get a single Zillow property's full detail by its zpid.
6032
+ *
6033
+ * Returns price/valuation, specs, resoFacts (home_facts), price & tax
6034
+ * history, schools, listing agent, mortgage rates and photos.
6035
+ *
6036
+ * @param zpid - The Zillow property id.
6037
+ * @returns Property detail wrapped in `{ property }`.
6038
+ * @throws NotFoundError - If the property doesn't exist.
6039
+ */
6040
+ async getProperty(zpid) {
6041
+ return this.client.request(`/v1/zillow/property/${zpid}`);
6042
+ }
6043
+ };
6044
+
6045
+ // src/zillow/agent.ts
6046
+ var AgentClient = class {
6047
+ client;
6048
+ constructor(client) {
6049
+ this.client = client;
6050
+ }
6051
+ /**
6052
+ * Get a Zillow real-estate professional's profile and their active listings.
6053
+ *
6054
+ * Provide either a `username` (screen name) or a full `url`.
6055
+ *
6056
+ * @param options - The agent `username` or profile `url`.
6057
+ * @returns Agent profile wrapped in `{ agent }`.
6058
+ * @throws NotFoundError - If the agent doesn't exist.
6059
+ * @throws ValidationError - If neither username nor url is provided.
6060
+ */
6061
+ async getAgent(options = {}) {
6062
+ return this.client.request("/v1/zillow/agent", {
6063
+ params: { username: options.username, url: options.url }
6064
+ });
6065
+ }
6066
+ };
6067
+
6068
+ // src/zillow/reference.ts
6069
+ var ReferenceClient9 = class {
6070
+ client;
6071
+ constructor(client) {
6072
+ this.client = client;
6073
+ }
6074
+ /**
6075
+ * List Zillow coverage regions (US + Canada, all served via zillow.com).
6076
+ *
6077
+ * @returns Markets response with all supported markets.
6078
+ */
6079
+ async listMarkets() {
6080
+ return this.client.request("/v1/zillow/markets");
6081
+ }
6082
+ };
6083
+
6084
+ // src/zillow/client.ts
6085
+ var ZillowClient = class {
6086
+ /** Client for property search and location autocomplete */
6087
+ search;
6088
+ /** Client for full property detail */
6089
+ properties;
6090
+ /** Client for agent profile + listings */
6091
+ agent;
6092
+ /** Client for reference data (markets) */
6093
+ reference;
6094
+ /**
6095
+ * Create a new Zillow client.
6096
+ *
6097
+ * @param client - The base HTTP client for making requests.
6098
+ */
6099
+ constructor(client) {
6100
+ this.search = new SearchClient11(client);
6101
+ this.properties = new PropertiesClient2(client);
6102
+ this.agent = new AgentClient(client);
6103
+ this.reference = new ReferenceClient9(client);
6104
+ }
6105
+ };
6106
+
5783
6107
  // src/client.ts
5784
6108
  var ScrapeBadger = class {
5785
6109
  baseClient;
@@ -5805,6 +6129,10 @@ var ScrapeBadger = class {
5805
6129
  youtube;
5806
6130
  /** Realtor scraper API client — 4 endpoints across 2 markets (us, ca) */
5807
6131
  realtor;
6132
+ /** Leboncoin scraper API client — 10 endpoints (France) */
6133
+ leboncoin;
6134
+ /** Zillow scraper API client — 5 endpoints (search, property, agent, autocomplete, markets) */
6135
+ zillow;
5808
6136
  /**
5809
6137
  * Create a new ScrapeBadger client.
5810
6138
  *
@@ -5850,6 +6178,8 @@ var ScrapeBadger = class {
5850
6178
  this.ebay = new EbayClient(this.baseClient);
5851
6179
  this.youtube = new YoutubeClient(this.baseClient);
5852
6180
  this.realtor = new RealtorClient(this.baseClient);
6181
+ this.leboncoin = new LeboncoinClient(this.baseClient);
6182
+ this.zillow = new ZillowClient(this.baseClient);
5853
6183
  }
5854
6184
  };
5855
6185
 
@@ -5890,6 +6220,11 @@ exports.GoogleShortsClient = ShortsClient;
5890
6220
  exports.GoogleTrendsClient = TrendsClient2;
5891
6221
  exports.GoogleVideosClient = VideosClient;
5892
6222
  exports.InsufficientCreditsError = InsufficientCreditsError;
6223
+ exports.LeboncoinAdsClient = AdsClient2;
6224
+ exports.LeboncoinClient = LeboncoinClient;
6225
+ exports.LeboncoinReferenceClient = ReferenceClient8;
6226
+ exports.LeboncoinSearchClient = SearchClient10;
6227
+ exports.LeboncoinSellersClient = SellersClient3;
5893
6228
  exports.ListsClient = ListsClient;
5894
6229
  exports.NotFoundError = NotFoundError;
5895
6230
  exports.RateLimitError = RateLimitError;
@@ -5944,6 +6279,11 @@ exports.YoutubeSearchClient = SearchClient8;
5944
6279
  exports.YoutubeShortsClient = ShortsClient2;
5945
6280
  exports.YoutubeTrendingClient = TrendingClient2;
5946
6281
  exports.YoutubeVideosClient = VideosClient3;
6282
+ exports.ZillowAgentClient = AgentClient;
6283
+ exports.ZillowClient = ZillowClient;
6284
+ exports.ZillowPropertiesClient = PropertiesClient2;
6285
+ exports.ZillowReferenceClient = ReferenceClient9;
6286
+ exports.ZillowSearchClient = SearchClient11;
5947
6287
  exports.collectAll = collectAll;
5948
6288
  exports.verifyWebhookSignature = verifyWebhookSignature;
5949
6289
  //# sourceMappingURL=index.js.map