scrapebadger 0.58.0 → 0.59.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/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.58.0";
6
+ var SDK_VERSION = "0.59.0";
7
7
 
8
8
  // src/internal/exceptions.ts
9
9
  var ScrapeBadgerError = class _ScrapeBadgerError extends Error {
@@ -6523,6 +6523,127 @@ var WalmartClient = class {
6523
6523
  }
6524
6524
  };
6525
6525
 
6526
+ // src/gumtree/client.ts
6527
+ var GumtreeClient = class {
6528
+ constructor(client) {
6529
+ this.client = client;
6530
+ }
6531
+ /**
6532
+ * Search gumtree.com listings.
6533
+ *
6534
+ * @param params - Optional query, category, location (+ distance radius),
6535
+ * price, sort, seller type, urgent/photo flags, category-specific filters
6536
+ * and page (1-50).
6537
+ * @returns ~25-30 listings per page. Gumtree pins up to 5 paid featured ads
6538
+ * (`is_featured`) above the chosen sort order.
6539
+ * @throws AuthenticationError - If the API key is invalid.
6540
+ * @throws ValidationError - If the parameters are invalid.
6541
+ */
6542
+ async search(params = {}) {
6543
+ return this.client.request("/v1/gumtree/search", {
6544
+ params: {
6545
+ query: params.query,
6546
+ category: params.category,
6547
+ location: params.location,
6548
+ distance: params.distance,
6549
+ min_price: params.min_price,
6550
+ max_price: params.max_price,
6551
+ sort: params.sort,
6552
+ seller_type: params.seller_type,
6553
+ urgent_only: params.urgent_only,
6554
+ with_photos: params.with_photos,
6555
+ filters: params.filters,
6556
+ page: params.page
6557
+ }
6558
+ });
6559
+ }
6560
+ /**
6561
+ * The filters, sort orders and radius options Gumtree offers for a category.
6562
+ *
6563
+ * Each filter lists its values with live result counts. Feed a `key` and a
6564
+ * `value` back into {@link search} as `filters: "key:value"`.
6565
+ *
6566
+ * @param params - Optional category (default `"all"`), location (default
6567
+ * `"uk"`) and query to scope the counts.
6568
+ */
6569
+ async searchFilters(params = {}) {
6570
+ return this.client.request("/v1/gumtree/search/filters", {
6571
+ params: {
6572
+ category: params.category,
6573
+ location: params.location,
6574
+ query: params.query
6575
+ }
6576
+ });
6577
+ }
6578
+ /**
6579
+ * Full listing: description, every attribute, images, location, seller and
6580
+ * similar ads. Motors listings carry the full vehicle spec.
6581
+ *
6582
+ * @param listingId - Gumtree listing id — the number at the end of a
6583
+ * `gumtree.com/p/...` URL.
6584
+ * @throws NotFoundError - If the listing does not exist or has expired.
6585
+ */
6586
+ async getListing(listingId) {
6587
+ return this.client.request(`/v1/gumtree/listings/${listingId}`);
6588
+ }
6589
+ /**
6590
+ * Every live listing by the seller of `listingId`. Gumtree keys a seller's
6591
+ * ad list by one of their ads, so any listing id of theirs works.
6592
+ *
6593
+ * @param listingId - Any Gumtree listing id belonging to the seller.
6594
+ * @param page - Page number, 1-50.
6595
+ */
6596
+ async getSellerListings(listingId, page) {
6597
+ return this.client.request(
6598
+ `/v1/gumtree/listings/${listingId}/seller-listings`,
6599
+ { params: { page } }
6600
+ );
6601
+ }
6602
+ /**
6603
+ * Gumtree search-box keyword suggestions, each with the category it maps to.
6604
+ *
6605
+ * @param query - Partial search term, e.g. `"iph"`.
6606
+ */
6607
+ async autocomplete(query) {
6608
+ return this.client.request("/v1/gumtree/autocomplete", {
6609
+ params: { query }
6610
+ });
6611
+ }
6612
+ /**
6613
+ * Resolve a place name or postcode prefix to Gumtree locations with coordinates.
6614
+ *
6615
+ * @param query - Town, area or postcode prefix (min 2 chars), e.g. `"manch"` or `"SW1A"`.
6616
+ */
6617
+ async locationAutocomplete(query) {
6618
+ return this.client.request(
6619
+ "/v1/gumtree/locations/autocomplete",
6620
+ { params: { query } }
6621
+ );
6622
+ }
6623
+ /**
6624
+ * Browse Gumtree's location tree: UK -> nations -> counties -> towns.
6625
+ *
6626
+ * @param parentId - Location id to list the children of. Defaults to the
6627
+ * United Kingdom (`10000392`) server-side.
6628
+ */
6629
+ async listLocations(parentId) {
6630
+ return this.client.request("/v1/gumtree/locations", {
6631
+ params: { parent_id: parentId }
6632
+ });
6633
+ }
6634
+ /**
6635
+ * Browse Gumtree's category tree. A node's `slug` is the {@link search} category.
6636
+ *
6637
+ * @param parentId - Category id to list the children of. Defaults to all
6638
+ * categories (`1`) server-side.
6639
+ */
6640
+ async listCategories(parentId) {
6641
+ return this.client.request("/v1/gumtree/categories", {
6642
+ params: { parent_id: parentId }
6643
+ });
6644
+ }
6645
+ };
6646
+
6526
6647
  // src/duckduckgo/search.ts
6527
6648
  var SearchClient10 = class {
6528
6649
  constructor(client) {
@@ -10023,6 +10144,8 @@ var ScrapeBadger = class {
10023
10144
  facebook;
10024
10145
  /** Walmart scraper API client — 11 endpoints (walmart.com, US-only) */
10025
10146
  walmart;
10147
+ /** Gumtree scraper API client — 8 endpoints (gumtree.com, UK-only) */
10148
+ gumtree;
10026
10149
  /** DuckDuckGo scraper API client — search, images, news, videos, autocomplete, instant, regions */
10027
10150
  duckduckgo;
10028
10151
  /** Bing scraper API client — 6 endpoints (search, images, videos, news, autocomplete, markets) */
@@ -10114,6 +10237,7 @@ var ScrapeBadger = class {
10114
10237
  this.ebay = new EbayClient(this.baseClient);
10115
10238
  this.facebook = new FacebookClient(this.baseClient);
10116
10239
  this.walmart = new WalmartClient(this.baseClient);
10240
+ this.gumtree = new GumtreeClient(this.baseClient);
10117
10241
  this.duckduckgo = new DuckDuckGoClient(this.baseClient);
10118
10242
  this.bing = new BingClient(this.baseClient);
10119
10243
  this.booking = new BookingClient(this.baseClient);
@@ -10136,6 +10260,6 @@ var ScrapeBadger = class {
10136
10260
  }
10137
10261
  };
10138
10262
 
10139
- export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AdsClient as GoogleAdsClient, 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, IPNotAllowedError, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient3 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient17 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient19 as LoopNetSearchClient, NaverClient, ContentClient as NaverContentClient, PlacesClient as NaverPlacesClient, ProductsClient5 as NaverProductsClient, ReviewsClient2 as NaverReviewsClient, SearchClient12 as NaverSearchClient, ShoppingClient2 as NaverShoppingClient, ShoppingLiveClient as NaverShoppingLiveClient, StoresClient2 as NaverStoresClient, NotFoundError, PermissionDeniedError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient16 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, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient2 as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WallapopClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient13 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient14 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient15 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient18 as ZillowSearchClient, collectAll, verifyWebhookSignature };
10263
+ export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient5 as AmazonSearchClient, SellersClient as AmazonSellersClient, ApartmentsClient, AuthenticationError, BaiduClient, BingClient, MediaClient3 as BingMediaClient, NewsClient2 as BingNewsClient, ReferenceClient8 as BingReferenceClient, SearchClient11 as BingSearchClient, AskClient as ChatGPTAskClient, BrandClient as ChatGPTBrandClient, ChatGPTClient, ReferenceClient16 as ChatGPTReferenceClient, CommunitiesClient, ConflictError, DepopClient, DuckDuckGoClient, MediaClient2 as DuckDuckGoMediaClient, ReferenceClient7 as DuckDuckGoReferenceClient, SearchClient10 as DuckDuckGoSearchClient, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient8 as EbaySearchClient, SellersClient2 as EbaySellersClient, AskClient2 as GeminiAskClient, BrandClient2 as GeminiBrandClient, GeminiClient, GeoClient, AdsClient as GoogleAdsClient, 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, GumtreeClient, IPNotAllowedError, ImmobiliareClient, AudioClient as InstagramAudioClient, InstagramClient, HashtagsClient as InstagramHashtagsClient, LocationsClient as InstagramLocationsClient, MediaClient as InstagramMediaClient, SearchClient4 as InstagramSearchClient, UsersClient4 as InstagramUsersClient, InsufficientCreditsError, AdsClient3 as LeboncoinAdsClient, LeboncoinClient, ReferenceClient13 as LeboncoinReferenceClient, SearchClient17 as LeboncoinSearchClient, SellersClient4 as LeboncoinSellersClient, LinkedInClient, ListsClient, BrokersClient as LoopNetBrokersClient, LoopNetClient, ListingsClient2 as LoopNetListingsClient, ReferenceClient15 as LoopNetReferenceClient, SearchClient19 as LoopNetSearchClient, NaverClient, ContentClient as NaverContentClient, PlacesClient as NaverPlacesClient, ProductsClient5 as NaverProductsClient, ReviewsClient2 as NaverReviewsClient, SearchClient12 as NaverSearchClient, ShoppingClient2 as NaverShoppingClient, ShoppingLiveClient as NaverShoppingLiveClient, StoresClient2 as NaverStoresClient, NotFoundError, PermissionDeniedError, RateLimitError, RealtorClient, PropertiesClient as RealtorPropertiesClient, ReferenceClient12 as RealtorReferenceClient, SearchClient16 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, SearchClient6 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient2 as TikTokAdsClient, TikTokClient, HashtagsClient2 as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient7 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient5 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WallapopClient, WalmartClient, ProductsClient4 as WalmartProductsClient, ReferenceClient6 as WalmartReferenceClient, SearchClient9 as WalmartSearchClient, SellersClient3 as WalmartSellersClient, StoresClient as WalmartStoresClient, WebClient, WebSocketStreamError, YahooClient, MediaClient4 as YahooMediaClient, NewsClient3 as YahooNewsClient, ReferenceClient9 as YahooReferenceClient, SearchClient13 as YahooSearchClient, YandexClient, ImagesClient2 as YandexImagesClient, ReferenceClient10 as YandexReferenceClient, SearchClient14 as YandexSearchClient, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient11 as YoutubeReferenceClient, SearchClient15 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, AgentClient as ZillowAgentClient, ZillowClient, PropertiesClient2 as ZillowPropertiesClient, ReferenceClient14 as ZillowReferenceClient, SearchClient18 as ZillowSearchClient, collectAll, verifyWebhookSignature };
10140
10264
  //# sourceMappingURL=index.mjs.map
10141
10265
  //# sourceMappingURL=index.mjs.map