scrapebadger 0.15.4 → 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
@@ -5780,6 +5780,187 @@ 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
+
5783
5964
  // src/client.ts
5784
5965
  var ScrapeBadger = class {
5785
5966
  baseClient;
@@ -5805,6 +5986,8 @@ var ScrapeBadger = class {
5805
5986
  youtube;
5806
5987
  /** Realtor scraper API client — 4 endpoints across 2 markets (us, ca) */
5807
5988
  realtor;
5989
+ /** Leboncoin scraper API client — 10 endpoints (France) */
5990
+ leboncoin;
5808
5991
  /**
5809
5992
  * Create a new ScrapeBadger client.
5810
5993
  *
@@ -5850,6 +6033,7 @@ var ScrapeBadger = class {
5850
6033
  this.ebay = new EbayClient(this.baseClient);
5851
6034
  this.youtube = new YoutubeClient(this.baseClient);
5852
6035
  this.realtor = new RealtorClient(this.baseClient);
6036
+ this.leboncoin = new LeboncoinClient(this.baseClient);
5853
6037
  }
5854
6038
  };
5855
6039
 
@@ -5890,6 +6074,11 @@ exports.GoogleShortsClient = ShortsClient;
5890
6074
  exports.GoogleTrendsClient = TrendsClient2;
5891
6075
  exports.GoogleVideosClient = VideosClient;
5892
6076
  exports.InsufficientCreditsError = InsufficientCreditsError;
6077
+ exports.LeboncoinAdsClient = AdsClient2;
6078
+ exports.LeboncoinClient = LeboncoinClient;
6079
+ exports.LeboncoinReferenceClient = ReferenceClient8;
6080
+ exports.LeboncoinSearchClient = SearchClient10;
6081
+ exports.LeboncoinSellersClient = SellersClient3;
5893
6082
  exports.ListsClient = ListsClient;
5894
6083
  exports.NotFoundError = NotFoundError;
5895
6084
  exports.RateLimitError = RateLimitError;