scrapebadger 0.15.3 → 0.15.5

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
@@ -5670,6 +5670,297 @@ var YoutubeClient = class {
5670
5670
  }
5671
5671
  };
5672
5672
 
5673
+ // src/realtor/search.ts
5674
+ var SearchClient9 = class {
5675
+ client;
5676
+ constructor(client) {
5677
+ this.client = client;
5678
+ }
5679
+ /**
5680
+ * Search a market for properties.
5681
+ *
5682
+ * @param location - Freetext location ("Austin, TX" / ZIP / "Toronto, ON").
5683
+ * Required unless a CA bounding box is provided.
5684
+ * @param options - Filters, sorting, and pagination.
5685
+ * @returns Search results with pagination metadata.
5686
+ * @throws AuthenticationError - If the API key is invalid.
5687
+ * @throws ValidationError - If the parameters are invalid.
5688
+ */
5689
+ async search(location, options = {}) {
5690
+ return this.client.request("/v1/realtor/search", {
5691
+ params: {
5692
+ location,
5693
+ market: options.market,
5694
+ status: options.status,
5695
+ price_min: options.priceMin,
5696
+ price_max: options.priceMax,
5697
+ beds_min: options.bedsMin,
5698
+ baths_min: options.bathsMin,
5699
+ sqft_min: options.sqftMin,
5700
+ sqft_max: options.sqftMax,
5701
+ property_type: options.propertyType,
5702
+ sort: options.sort,
5703
+ page: options.page,
5704
+ limit: options.limit,
5705
+ lat_min: options.latMin,
5706
+ lat_max: options.latMax,
5707
+ lng_min: options.lngMin,
5708
+ lng_max: options.lngMax
5709
+ }
5710
+ });
5711
+ }
5712
+ /**
5713
+ * Get location autocomplete suggestions.
5714
+ *
5715
+ * @param query - Partial location query.
5716
+ * @param options - Optional parameters (market, limit).
5717
+ * @returns Autocomplete suggestions.
5718
+ */
5719
+ async autocomplete(query, options = {}) {
5720
+ return this.client.request("/v1/realtor/autocomplete", {
5721
+ params: { query, market: options.market, limit: options.limit }
5722
+ });
5723
+ }
5724
+ };
5725
+
5726
+ // src/realtor/properties.ts
5727
+ var PropertiesClient = class {
5728
+ client;
5729
+ constructor(client) {
5730
+ this.client = client;
5731
+ }
5732
+ /**
5733
+ * Get a single property's full detail.
5734
+ *
5735
+ * @param propertyId - The property id.
5736
+ * @param options - Optional parameters (market).
5737
+ * @returns Property detail including details, amenities, and history.
5738
+ * @throws NotFoundError - If the property doesn't exist.
5739
+ */
5740
+ async getProperty(propertyId, options = {}) {
5741
+ return this.client.request(`/v1/realtor/properties/${propertyId}`, {
5742
+ params: { market: options.market }
5743
+ });
5744
+ }
5745
+ };
5746
+
5747
+ // src/realtor/reference.ts
5748
+ var ReferenceClient7 = class {
5749
+ client;
5750
+ constructor(client) {
5751
+ this.client = client;
5752
+ }
5753
+ /**
5754
+ * Get all supported realtor markets.
5755
+ *
5756
+ * @returns Markets response with all supported markets.
5757
+ */
5758
+ async listMarkets() {
5759
+ return this.client.request("/v1/realtor/markets");
5760
+ }
5761
+ };
5762
+
5763
+ // src/realtor/client.ts
5764
+ var RealtorClient = class {
5765
+ /** Client for property search and location autocomplete */
5766
+ search;
5767
+ /** Client for full property detail */
5768
+ properties;
5769
+ /** Client for reference data (markets) */
5770
+ reference;
5771
+ /**
5772
+ * Create a new Realtor client.
5773
+ *
5774
+ * @param client - The base HTTP client for making requests.
5775
+ */
5776
+ constructor(client) {
5777
+ this.search = new SearchClient9(client);
5778
+ this.properties = new PropertiesClient(client);
5779
+ this.reference = new ReferenceClient7(client);
5780
+ }
5781
+ };
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
+
5673
5964
  // src/client.ts
5674
5965
  var ScrapeBadger = class {
5675
5966
  baseClient;
@@ -5693,6 +5984,10 @@ var ScrapeBadger = class {
5693
5984
  ebay;
5694
5985
  /** YouTube scraper API client — 39 endpoints */
5695
5986
  youtube;
5987
+ /** Realtor scraper API client — 4 endpoints across 2 markets (us, ca) */
5988
+ realtor;
5989
+ /** Leboncoin scraper API client — 10 endpoints (France) */
5990
+ leboncoin;
5696
5991
  /**
5697
5992
  * Create a new ScrapeBadger client.
5698
5993
  *
@@ -5737,6 +6032,8 @@ var ScrapeBadger = class {
5737
6032
  this.tiktok = new TikTokClient(this.baseClient);
5738
6033
  this.ebay = new EbayClient(this.baseClient);
5739
6034
  this.youtube = new YoutubeClient(this.baseClient);
6035
+ this.realtor = new RealtorClient(this.baseClient);
6036
+ this.leboncoin = new LeboncoinClient(this.baseClient);
5740
6037
  }
5741
6038
  };
5742
6039
 
@@ -5777,9 +6074,18 @@ exports.GoogleShortsClient = ShortsClient;
5777
6074
  exports.GoogleTrendsClient = TrendsClient2;
5778
6075
  exports.GoogleVideosClient = VideosClient;
5779
6076
  exports.InsufficientCreditsError = InsufficientCreditsError;
6077
+ exports.LeboncoinAdsClient = AdsClient2;
6078
+ exports.LeboncoinClient = LeboncoinClient;
6079
+ exports.LeboncoinReferenceClient = ReferenceClient8;
6080
+ exports.LeboncoinSearchClient = SearchClient10;
6081
+ exports.LeboncoinSellersClient = SellersClient3;
5780
6082
  exports.ListsClient = ListsClient;
5781
6083
  exports.NotFoundError = NotFoundError;
5782
6084
  exports.RateLimitError = RateLimitError;
6085
+ exports.RealtorClient = RealtorClient;
6086
+ exports.RealtorPropertiesClient = PropertiesClient;
6087
+ exports.RealtorReferenceClient = ReferenceClient7;
6088
+ exports.RealtorSearchClient = SearchClient9;
5783
6089
  exports.RedditClient = RedditClient;
5784
6090
  exports.RedditPostsClient = PostsClient;
5785
6091
  exports.RedditSearchClient = SearchClient3;