scrapebadger 0.60.0 → 0.61.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/README.md CHANGED
@@ -87,7 +87,7 @@ const client = new ScrapeBadger();
87
87
  | **TikTok** | 26 endpoints — user profile/videos/followers/following/liked/reposts, video detail/comments/replies/related/transcript, oEmbed, hashtag detail/videos, music detail/videos, search (general/videos/users/hashtags), trending (videos/hashtags/songs), ad library, regions | [TikTok Guide](docs/tiktok.md) |
88
88
  | **eBay** | 12 endpoints across 18 markets — search, search by image, completed/sold listings, item detail, item reviews, seller profile/items/feedback, category browse, categories, autocomplete, markets | [eBay Guide](docs/ebay.md) |
89
89
  | **Walmart** | 11 endpoints (walmart.com, US-only) — search, category browse, deals feed, autocomplete, product detail, reviews, seller profile/products, store detail with nearby stores, markets |
90
- | **Gumtree** | 9 endpoints across gumtree.com, gumtree.com.au and gumtree.co.za (`market: "uk"` default, `"au"`, `"za"`) — search (category, location/postcode radius, price, seller type, urgent/photos, category-specific filters), search filters with live counts, listing detail (full vehicle spec, seller rating/verification, masked phone), seller listings, keyword and location autocomplete, location and category trees, markets. E.g. `client.gumtree.search({ market: "au", category: "18320", location: "3003435", distance: 10 })` or `client.gumtree.search({ market: "za", category: "9077", location: "3100003" })` | [Gumtree Docs](https://docs.scrapebadger.com/gumtree/overview) |
90
+ | **Gumtree** | 9 endpoints across gumtree.com, gumtree.com.au and gumtree.co.za (`market: "uk"` default, `"au"`, `"za"`) — search (category, location/postcode radius, price, seller type, urgent/photos, category-specific filters), search filters with live counts, listing detail (full vehicle spec, seller rating/verification, masked phone), seller listings, keyword and location autocomplete, location and category trees, markets. E.g. `client.gumtree.search({ market: "au", category: "18320", location: "3003435", distance: 10 })` or `client.gumtree.search({ market: "za", category: "p6dnh", location: "dkp8y" })` (za ids are refs) | [Gumtree Docs](https://docs.scrapebadger.com/gumtree/overview) |
91
91
  | **Bing** | 6 endpoints — web search (with ads + related searches), image search, video search, news vertical, autocomplete, markets |
92
92
  | **DuckDuckGo** | 7 endpoints — web search (with instant-answer abstract), image search, news vertical, video search, autocomplete, instant answers, regions |
93
93
  | **Yahoo** | 6 endpoints across 35 markets — web search (with ads + related searches), image search, video search, news vertical, autocomplete, markets | [Yahoo Docs](https://docs.scrapebadger.com/yahoo/overview) |
@@ -2141,6 +2141,51 @@ declare class ValidationError extends ScrapeBadgerError {
2141
2141
  readonly errors: Record<string, string[]> | undefined;
2142
2142
  constructor(message?: string, errors?: Record<string, string[]>);
2143
2143
  }
2144
+ /** Why the Web Scraping API reported a target as blocked (SCR-306). */
2145
+ type BlockKind = "antibot" | "captcha" | "rate_limit" | "ip_ban" | "geo_block" | "auth_wall" | "empty" | "other";
2146
+ /** The CAPTCHA gating a blocked page. */
2147
+ interface BlockingCaptcha {
2148
+ system: string;
2149
+ confidence: number;
2150
+ details?: string | null;
2151
+ version?: string | null;
2152
+ gate?: boolean;
2153
+ solvable?: boolean;
2154
+ params?: Record<string, unknown>;
2155
+ }
2156
+ /**
2157
+ * Raised when a web scrape hit an anti-bot wall on every attempt (HTTP 422,
2158
+ * `error: "blocking_page_detected"`). Extends `ValidationError`, which is
2159
+ * what this threw before 0.61.0, so existing handlers still match. Blocked
2160
+ * requests are not charged.
2161
+ *
2162
+ * @example
2163
+ * ```ts
2164
+ * try {
2165
+ * await client.web.scrape({ url: "https://example.com" });
2166
+ * } catch (err) {
2167
+ * if (err instanceof BlockedError) {
2168
+ * console.log(err.blockKind, err.vendor, err.captcha?.params);
2169
+ * }
2170
+ * }
2171
+ * ```
2172
+ */
2173
+ declare class BlockedError extends ValidationError {
2174
+ /** The wall's class; undefined on older responses */
2175
+ readonly blockKind: BlockKind | undefined;
2176
+ /** The protection vendor that served it, e.g. "cloudflare", "datadome", "aws_waf" */
2177
+ readonly vendor: string | undefined;
2178
+ /** The CAPTCHA gating the page when blockKind is "captcha" */
2179
+ readonly captcha: BlockingCaptcha | undefined;
2180
+ /** The scrape result the API returned with the block */
2181
+ readonly data: Record<string, unknown> | undefined;
2182
+ constructor(message?: string, details?: {
2183
+ blockKind?: BlockKind | null;
2184
+ vendor?: string | null;
2185
+ captcha?: BlockingCaptcha | null;
2186
+ data?: Record<string, unknown> | null;
2187
+ });
2188
+ }
2144
2189
  /**
2145
2190
  * Raised when an internal server error occurs.
2146
2191
  */
@@ -3175,4 +3220,4 @@ declare class TwitterClient {
3175
3220
  removeWebhookFromMonitor(webhookId: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
3176
3221
  }
3177
3222
 
3178
- export { type PlaceTrends as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type User as D, type UserAbout as E, type UserIds as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type List as J, type CommunityBanner as K, ListsClient as L, type Media as M, NotFoundError as N, type CommunityRule as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type Community as X, type CommunityMember as Y, type Trend as Z, type Location as _, ScrapeBadgerError as a, type Place as a0, type Article as a1, type CommunityNote as a2, type Space as a3, type Broadcast as a4, type ApiResponse as a5, type ListResponse as a6, type MonitorStatus as a7, type StreamMonitor as a8, type StreamMonitorList as a9, type CreateMonitorParams as aa, type UpdateMonitorParams as ab, type StreamTweet as ac, type ConnectedEvent as ad, type PingEvent as ae, type TweetEvent as af, type ErrorEvent as ag, type StreamEvent as ah, type StreamEventType as ai, type DeliveryLog as aj, type DeliveryLogList as ak, type BillingLog as al, type BillingLogList as am, type ConnectOptions as an, type FilterRuleStatus as ao, type FilterRuleResponse as ap, type FilterRuleCreate as aq, type FilterRuleUpdate as ar, type FilterRulePricingTier as as, type FilterRuleListResponse as at, type FilterRuleValidateResponse as au, type FilterRuleDeliveryLog as av, type FilterRuleDeliveryLogListResponse as aw, type FilterRulePricingTiersResponse as ax, RateLimitError as b, ServerError as c, TimeoutError as d, AccountRestrictedError as e, IPNotAllowedError as f, type PaginatedResponse as g, type PaginationOptions as h, type IteratorOptions as i, collectAll as j, TweetsClient as k, CommunitiesClient as l, TrendsClient as m, type GeoSearchOptions as n, StreamClient as o, type StreamEmitter as p, SpacesClient as q, type TrendCategory as r, type CommunityTweetType as s, type PollOption as t, type Poll as u, verifyWebhookSignature as v, type Url as w, type UserMention as x, type TweetPlace as y, type Tweet as z };
3223
+ export { type CommunityMember as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type UserMention as D, type TweetPlace as E, type Tweet as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type User as J, type UserAbout as K, ListsClient as L, type Media as M, NotFoundError as N, type UserIds as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type List as X, type CommunityBanner as Y, type CommunityRule as Z, type Community as _, ScrapeBadgerError as a, type Trend as a0, type Location as a1, type PlaceTrends as a2, type Place as a3, type Article as a4, type CommunityNote as a5, type Space as a6, type Broadcast as a7, type ApiResponse as a8, type ListResponse as a9, type FilterRulePricingTiersResponse as aA, type MonitorStatus as aa, type StreamMonitor as ab, type StreamMonitorList as ac, type CreateMonitorParams as ad, type UpdateMonitorParams as ae, type StreamTweet as af, type ConnectedEvent as ag, type PingEvent as ah, type TweetEvent as ai, type ErrorEvent as aj, type StreamEvent as ak, type StreamEventType as al, type DeliveryLog as am, type DeliveryLogList as an, type BillingLog as ao, type BillingLogList as ap, type ConnectOptions as aq, type FilterRuleStatus as ar, type FilterRuleResponse as as, type FilterRuleCreate as at, type FilterRuleUpdate as au, type FilterRulePricingTier as av, type FilterRuleListResponse as aw, type FilterRuleValidateResponse as ax, type FilterRuleDeliveryLog as ay, type FilterRuleDeliveryLogListResponse as az, RateLimitError as b, BlockedError as c, ServerError as d, TimeoutError as e, AccountRestrictedError as f, IPNotAllowedError as g, type BlockKind as h, type BlockingCaptcha as i, type PaginatedResponse as j, type PaginationOptions as k, type IteratorOptions as l, collectAll as m, TweetsClient as n, CommunitiesClient as o, TrendsClient as p, type GeoSearchOptions as q, StreamClient as r, type StreamEmitter as s, SpacesClient as t, type TrendCategory as u, verifyWebhookSignature as v, type CommunityTweetType as w, type PollOption as x, type Poll as y, type Url as z };
@@ -2141,6 +2141,51 @@ declare class ValidationError extends ScrapeBadgerError {
2141
2141
  readonly errors: Record<string, string[]> | undefined;
2142
2142
  constructor(message?: string, errors?: Record<string, string[]>);
2143
2143
  }
2144
+ /** Why the Web Scraping API reported a target as blocked (SCR-306). */
2145
+ type BlockKind = "antibot" | "captcha" | "rate_limit" | "ip_ban" | "geo_block" | "auth_wall" | "empty" | "other";
2146
+ /** The CAPTCHA gating a blocked page. */
2147
+ interface BlockingCaptcha {
2148
+ system: string;
2149
+ confidence: number;
2150
+ details?: string | null;
2151
+ version?: string | null;
2152
+ gate?: boolean;
2153
+ solvable?: boolean;
2154
+ params?: Record<string, unknown>;
2155
+ }
2156
+ /**
2157
+ * Raised when a web scrape hit an anti-bot wall on every attempt (HTTP 422,
2158
+ * `error: "blocking_page_detected"`). Extends `ValidationError`, which is
2159
+ * what this threw before 0.61.0, so existing handlers still match. Blocked
2160
+ * requests are not charged.
2161
+ *
2162
+ * @example
2163
+ * ```ts
2164
+ * try {
2165
+ * await client.web.scrape({ url: "https://example.com" });
2166
+ * } catch (err) {
2167
+ * if (err instanceof BlockedError) {
2168
+ * console.log(err.blockKind, err.vendor, err.captcha?.params);
2169
+ * }
2170
+ * }
2171
+ * ```
2172
+ */
2173
+ declare class BlockedError extends ValidationError {
2174
+ /** The wall's class; undefined on older responses */
2175
+ readonly blockKind: BlockKind | undefined;
2176
+ /** The protection vendor that served it, e.g. "cloudflare", "datadome", "aws_waf" */
2177
+ readonly vendor: string | undefined;
2178
+ /** The CAPTCHA gating the page when blockKind is "captcha" */
2179
+ readonly captcha: BlockingCaptcha | undefined;
2180
+ /** The scrape result the API returned with the block */
2181
+ readonly data: Record<string, unknown> | undefined;
2182
+ constructor(message?: string, details?: {
2183
+ blockKind?: BlockKind | null;
2184
+ vendor?: string | null;
2185
+ captcha?: BlockingCaptcha | null;
2186
+ data?: Record<string, unknown> | null;
2187
+ });
2188
+ }
2144
2189
  /**
2145
2190
  * Raised when an internal server error occurs.
2146
2191
  */
@@ -3175,4 +3220,4 @@ declare class TwitterClient {
3175
3220
  removeWebhookFromMonitor(webhookId: string, body?: unknown, params?: Record<string, string | number | boolean | undefined>): Promise<Record<string, unknown>>;
3176
3221
  }
3177
3222
 
3178
- export { type PlaceTrends as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type User as D, type UserAbout as E, type UserIds as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type List as J, type CommunityBanner as K, ListsClient as L, type Media as M, NotFoundError as N, type CommunityRule as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type Community as X, type CommunityMember as Y, type Trend as Z, type Location as _, ScrapeBadgerError as a, type Place as a0, type Article as a1, type CommunityNote as a2, type Space as a3, type Broadcast as a4, type ApiResponse as a5, type ListResponse as a6, type MonitorStatus as a7, type StreamMonitor as a8, type StreamMonitorList as a9, type CreateMonitorParams as aa, type UpdateMonitorParams as ab, type StreamTweet as ac, type ConnectedEvent as ad, type PingEvent as ae, type TweetEvent as af, type ErrorEvent as ag, type StreamEvent as ah, type StreamEventType as ai, type DeliveryLog as aj, type DeliveryLogList as ak, type BillingLog as al, type BillingLogList as am, type ConnectOptions as an, type FilterRuleStatus as ao, type FilterRuleResponse as ap, type FilterRuleCreate as aq, type FilterRuleUpdate as ar, type FilterRulePricingTier as as, type FilterRuleListResponse as at, type FilterRuleValidateResponse as au, type FilterRuleDeliveryLog as av, type FilterRuleDeliveryLogListResponse as aw, type FilterRulePricingTiersResponse as ax, RateLimitError as b, ServerError as c, TimeoutError as d, AccountRestrictedError as e, IPNotAllowedError as f, type PaginatedResponse as g, type PaginationOptions as h, type IteratorOptions as i, collectAll as j, TweetsClient as k, CommunitiesClient as l, TrendsClient as m, type GeoSearchOptions as n, StreamClient as o, type StreamEmitter as p, SpacesClient as q, type TrendCategory as r, type CommunityTweetType as s, type PollOption as t, type Poll as u, verifyWebhookSignature as v, type Url as w, type UserMention as x, type TweetPlace as y, type Tweet as z };
3223
+ export { type CommunityMember as $, AuthenticationError as A, BaseClient as B, ConflictError as C, type UserMention as D, type TweetPlace as E, type Tweet as F, GeoClient as G, type Hashtag as H, InsufficientCreditsError as I, type User as J, type UserAbout as K, ListsClient as L, type Media as M, NotFoundError as N, type UserIds as O, PermissionDeniedError as P, type QueryType as Q, type ResolvedConfig as R, type ScrapeBadgerConfig as S, TwitterClient as T, UsersClient as U, ValidationError as V, WebSocketStreamError as W, type List as X, type CommunityBanner as Y, type CommunityRule as Z, type Community as _, ScrapeBadgerError as a, type Trend as a0, type Location as a1, type PlaceTrends as a2, type Place as a3, type Article as a4, type CommunityNote as a5, type Space as a6, type Broadcast as a7, type ApiResponse as a8, type ListResponse as a9, type FilterRulePricingTiersResponse as aA, type MonitorStatus as aa, type StreamMonitor as ab, type StreamMonitorList as ac, type CreateMonitorParams as ad, type UpdateMonitorParams as ae, type StreamTweet as af, type ConnectedEvent as ag, type PingEvent as ah, type TweetEvent as ai, type ErrorEvent as aj, type StreamEvent as ak, type StreamEventType as al, type DeliveryLog as am, type DeliveryLogList as an, type BillingLog as ao, type BillingLogList as ap, type ConnectOptions as aq, type FilterRuleStatus as ar, type FilterRuleResponse as as, type FilterRuleCreate as at, type FilterRuleUpdate as au, type FilterRulePricingTier as av, type FilterRuleListResponse as aw, type FilterRuleValidateResponse as ax, type FilterRuleDeliveryLog as ay, type FilterRuleDeliveryLogListResponse as az, RateLimitError as b, BlockedError as c, ServerError as d, TimeoutError as e, AccountRestrictedError as f, IPNotAllowedError as g, type BlockKind as h, type BlockingCaptcha as i, type PaginatedResponse as j, type PaginationOptions as k, type IteratorOptions as l, collectAll as m, TweetsClient as n, CommunitiesClient as o, TrendsClient as p, type GeoSearchOptions as q, StreamClient as r, type StreamEmitter as s, SpacesClient as t, type TrendCategory as u, verifyWebhookSignature as v, type CommunityTweetType as w, type PollOption as x, type Poll as y, type Url as z };
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-DBk60c2e.cjs';
2
- export { e as AccountRestrictedError, a5 as ApiResponse, a1 as Article, A as AuthenticationError, al as BillingLog, am as BillingLogList, a4 as Broadcast, l as CommunitiesClient, X as Community, K as CommunityBanner, Y as CommunityMember, a2 as CommunityNote, O as CommunityRule, s as CommunityTweetType, C as ConflictError, an as ConnectOptions, ad as ConnectedEvent, aa as CreateMonitorParams, aj as DeliveryLog, ak as DeliveryLogList, ag as ErrorEvent, aq as FilterRuleCreate, av as FilterRuleDeliveryLog, aw as FilterRuleDeliveryLogListResponse, at as FilterRuleListResponse, as as FilterRulePricingTier, ax as FilterRulePricingTiersResponse, ap as FilterRuleResponse, ao as FilterRuleStatus, ar as FilterRuleUpdate, au as FilterRuleValidateResponse, G as GeoClient, n as GeoSearchOptions, H as Hashtag, f as IPNotAllowedError, I as InsufficientCreditsError, i as IteratorOptions, J as List, a6 as ListResponse, L as ListsClient, _ as Location, M as Media, a7 as MonitorStatus, N as NotFoundError, g as PaginatedResponse, h as PaginationOptions, P as PermissionDeniedError, ae as PingEvent, a0 as Place, $ as PlaceTrends, u as Poll, t as PollOption, Q as QueryType, b as RateLimitError, R as ResolvedConfig, a as ScrapeBadgerError, c as ServerError, a3 as Space, q as SpacesClient, o as StreamClient, p as StreamEmitter, ah as StreamEvent, ai as StreamEventType, a8 as StreamMonitor, a9 as StreamMonitorList, ac as StreamTweet, d as TimeoutError, Z as Trend, r as TrendCategory, m as TrendsClient, z as Tweet, af as TweetEvent, y as TweetPlace, k as TweetsClient, ab as UpdateMonitorParams, w as Url, D as User, E as UserAbout, F as UserIds, x as UserMention, U as UsersClient, V as ValidationError, W as WebSocketStreamError, j as collectAll, v as verifyWebhookSignature } from './index-DBk60c2e.cjs';
1
+ import { B as BaseClient, T as TwitterClient, S as ScrapeBadgerConfig } from './index-MBQ1Ksjt.cjs';
2
+ export { f as AccountRestrictedError, a8 as ApiResponse, a4 as Article, A as AuthenticationError, ao as BillingLog, ap as BillingLogList, h as BlockKind, c as BlockedError, i as BlockingCaptcha, a7 as Broadcast, o as CommunitiesClient, _ as Community, Y as CommunityBanner, $ as CommunityMember, a5 as CommunityNote, Z as CommunityRule, w as CommunityTweetType, C as ConflictError, aq as ConnectOptions, ag as ConnectedEvent, ad as CreateMonitorParams, am as DeliveryLog, an as DeliveryLogList, aj as ErrorEvent, at as FilterRuleCreate, ay as FilterRuleDeliveryLog, az as FilterRuleDeliveryLogListResponse, aw as FilterRuleListResponse, av as FilterRulePricingTier, aA as FilterRulePricingTiersResponse, as as FilterRuleResponse, ar as FilterRuleStatus, au as FilterRuleUpdate, ax as FilterRuleValidateResponse, G as GeoClient, q as GeoSearchOptions, H as Hashtag, g as IPNotAllowedError, I as InsufficientCreditsError, l as IteratorOptions, X as List, a9 as ListResponse, L as ListsClient, a1 as Location, M as Media, aa as MonitorStatus, N as NotFoundError, j as PaginatedResponse, k as PaginationOptions, P as PermissionDeniedError, ah as PingEvent, a3 as Place, a2 as PlaceTrends, y as Poll, x as PollOption, Q as QueryType, b as RateLimitError, R as ResolvedConfig, a as ScrapeBadgerError, d as ServerError, a6 as Space, t as SpacesClient, r as StreamClient, s as StreamEmitter, ak as StreamEvent, al as StreamEventType, ab as StreamMonitor, ac as StreamMonitorList, af as StreamTweet, e as TimeoutError, a0 as Trend, u as TrendCategory, p as TrendsClient, F as Tweet, ai as TweetEvent, E as TweetPlace, n as TweetsClient, ae as UpdateMonitorParams, z as Url, J as User, K as UserAbout, O as UserIds, D as UserMention, U as UsersClient, V as ValidationError, W as WebSocketStreamError, m as collectAll, v as verifyWebhookSignature } from './index-MBQ1Ksjt.cjs';
3
3
  import 'node:events';
4
4
 
5
5
  /**
@@ -9880,6 +9880,8 @@ declare class WalmartClient {
9880
9880
  * Three markets share these types: `uk` (gumtree.com, GBP), `au`
9881
9881
  * (gumtree.com.au, AUD) and `za` (gumtree.co.za, ZAR). They are separate
9882
9882
  * platforms, so a field one market does not publish is simply `null` there.
9883
+ * Category, location and tree ids are numbers on uk/au and gumtree.co.za refs
9884
+ * (strings such as `"p6dnh"`) on za, so those fields are `number | string`.
9883
9885
  * Every top-level response carries the `market` it came from. Every datetime
9884
9886
  * ships in BOTH forms: `*_utc` (Unix seconds) and `*_at` (ISO 8601 UTC string).
9885
9887
  * Phone numbers are only ever the MASKED form Gumtree shows a logged-out
@@ -9894,7 +9896,8 @@ interface GumtreeAttribute {
9894
9896
  }
9895
9897
  /** A category reference attached to an autocomplete suggestion. */
9896
9898
  interface GumtreeCategoryRef {
9897
- id: number | null;
9899
+ /** za: a ref such as `"p6dnh"`. */
9900
+ id: number | string | null;
9898
9901
  name: string | null;
9899
9902
  slug: string | null;
9900
9903
  }
@@ -9906,7 +9909,7 @@ interface GumtreeBreadcrumb {
9906
9909
  /** A listing as it appears on a search / seller / similar-listings grid. */
9907
9910
  interface GumtreeListingSummary {
9908
9911
  id: string;
9909
- /** za: the 10-digit id Gumtree shows (the `id` is the full ad id). */
9912
+ /** Not published by any market at present (za's old short id). */
9910
9913
  short_id: string | null;
9911
9914
  title: string | null;
9912
9915
  url: string | null;
@@ -9918,7 +9921,7 @@ interface GumtreeListingSummary {
9918
9921
  price_text: string | null;
9919
9922
  /** `pm` / `pw` for rentals. */
9920
9923
  price_frequency: string | null;
9921
- /** au/za: `FIXED`, `NEGOTIABLE` / `MAKE_OFFER`, `FREE`, `SWAP_TRADE`… */
9924
+ /** au: `FIXED`, `NEGOTIABLE`, `FREE`, `SWAP_TRADE`…; za: `ASKING_PRICE`, `POA`… */
9922
9925
  price_type: string | null;
9923
9926
  currency: string;
9924
9927
  location: string | null;
@@ -9929,10 +9932,11 @@ interface GumtreeListingSummary {
9929
9932
  /** e.g. `"13 miles"` (uk) or `"4 km"` (au) from the search location. */
9930
9933
  distance_text: string | null;
9931
9934
  distance_miles: number | null;
9932
- category_id: number | null;
9935
+ /** za: a ref such as `"p6dnh"`. */
9936
+ category_id: number | string | null;
9933
9937
  category_name: string | null;
9934
- /** Root-to-leaf category ids. */
9935
- category_ids: number[];
9938
+ /** Root-to-leaf category ids (refs on za). */
9939
+ category_ids: (number | string)[];
9936
9940
  image_url: string | null;
9937
9941
  image_urls: string[];
9938
9942
  image_count: number | null;
@@ -9962,8 +9966,8 @@ interface GumtreeListingSummary {
9962
9966
  }
9963
9967
  /** A sub-category of a result set, with its listing count. */
9964
9968
  interface GumtreeCategoryFacet {
9965
- /** au/za: the category id `search` takes. */
9966
- id: number | null;
9969
+ /** au: the numeric category id `search` takes; za: its ref. */
9970
+ id: number | string | null;
9967
9971
  name: string | null;
9968
9972
  slug: string | null;
9969
9973
  count: number | null;
@@ -9976,7 +9980,8 @@ interface GumtreeSearchResponse {
9976
9980
  /** Category slug the search ran in. */
9977
9981
  category: string | null;
9978
9982
  category_name: string | null;
9979
- category_id: number | null;
9983
+ /** za: a ref such as `"p6dnh"`. */
9984
+ category_id: number | string | null;
9980
9985
  /** Location slug / postcode searched. */
9981
9986
  location: string | null;
9982
9987
  location_name: string | null;
@@ -10053,7 +10058,7 @@ interface GumtreeSeller {
10053
10058
  is_pro: boolean | null;
10054
10059
  /** e.g. `"6+ years"`. */
10055
10060
  posting_since: string | null;
10056
- /** au: year the account opened. */
10061
+ /** au/za: year the account opened. */
10057
10062
  member_since_year: number | null;
10058
10063
  /** au: e.g. `"yesterday"`. */
10059
10064
  last_active_text: string | null;
@@ -10061,9 +10066,9 @@ interface GumtreeSeller {
10061
10066
  last_active_at: string | null;
10062
10067
  /** Live listings right now. */
10063
10068
  total_listings: number | null;
10064
- /** za: ads ever posted. */
10069
+ /** Ads ever posted (no market publishes it at present). */
10065
10070
  lifetime_listings: number | null;
10066
- /** za: views across all their ads. */
10071
+ /** Views across all their ads (no market publishes it at present). */
10067
10072
  total_views: number | null;
10068
10073
  listings_last_year: number | null;
10069
10074
  listings_by_category: Record<string, number>;
@@ -10089,7 +10094,7 @@ interface GumtreeListingDetail {
10089
10094
  price: number | null;
10090
10095
  price_text: string | null;
10091
10096
  price_frequency: string | null;
10092
- /** au/za: `FIXED`, `NEGOTIABLE` / `MAKE_OFFER`, `FREE`, `SWAP_TRADE`… */
10097
+ /** au: `FIXED`, `NEGOTIABLE`, `FREE`, `SWAP_TRADE`…; za: `ASKING_PRICE`, `POA`… */
10093
10098
  price_type: string | null;
10094
10099
  currency: string;
10095
10100
  /** Motors trade listings: `"Inc VAT"` / `"No VAT"`. */
@@ -10101,9 +10106,11 @@ interface GumtreeListingDetail {
10101
10106
  postcode: string | null;
10102
10107
  latitude: number | null;
10103
10108
  longitude: number | null;
10104
- category_id: number | null;
10109
+ /** za: a ref such as `"p6dnh"`. */
10110
+ category_id: number | string | null;
10105
10111
  category_name: string | null;
10106
- category_ids: number[];
10112
+ /** Root-to-leaf category ids (refs on za). */
10113
+ category_ids: (number | string)[];
10107
10114
  breadcrumbs: GumtreeBreadcrumb[];
10108
10115
  image_urls: string[];
10109
10116
  video_urls: string[];
@@ -10146,7 +10153,7 @@ interface GumtreeSellerListingsResponse {
10146
10153
  total_results: number | null;
10147
10154
  page: number;
10148
10155
  total_pages: number | null;
10149
- /** `za`: another page follows (the site gives no total upfront). `null` elsewhere. */
10156
+ /** `za`: another page follows. `null` elsewhere. */
10150
10157
  has_next?: boolean | null;
10151
10158
  result_count: number;
10152
10159
  listings: GumtreeListingSummary[];
@@ -10168,7 +10175,8 @@ interface GumtreeAutocompleteResponse {
10168
10175
  }
10169
10176
  /** A Gumtree location matched by name or postcode prefix. */
10170
10177
  interface GumtreeLocationSuggestion {
10171
- id: number | null;
10178
+ /** za: a ref such as `"pfw8k"`. */
10179
+ id: number | string | null;
10172
10180
  name: string | null;
10173
10181
  /** uk: location / outcode / postcode; au/za: region / area. */
10174
10182
  type: string | null;
@@ -10185,7 +10193,8 @@ interface GumtreeLocationAutocompleteResponse {
10185
10193
  }
10186
10194
  /** A category or location node. `slug` (uk) or `id` (au/za) is what `search` takes. */
10187
10195
  interface GumtreeTreeNode {
10188
- id: number;
10196
+ /** A number on uk/au, a ref such as `"p6dnh"` on za. */
10197
+ id: number | string;
10189
10198
  name: string | null;
10190
10199
  slug: string | null;
10191
10200
  has_children: boolean | null;
@@ -10194,7 +10203,8 @@ interface GumtreeTreeNode {
10194
10203
  interface GumtreeTreeResponse {
10195
10204
  /** `uk` = gumtree.com, `au` = gumtree.com.au, `za` = gumtree.co.za. */
10196
10205
  market: string;
10197
- id: number;
10206
+ /** A number on uk/au, a ref such as `"l4dq6"` on za. */
10207
+ id: number | string;
10198
10208
  name: string | null;
10199
10209
  slug: string | null;
10200
10210
  result_count: number;
@@ -10236,14 +10246,16 @@ interface GumtreeSearchParams {
10236
10246
  query?: string;
10237
10247
  /**
10238
10248
  * uk: category slug, e.g. `"cars"`, `"for-sale"`, `"property-to-rent"`.
10239
- * au/za: numeric category id as a string, e.g. `"18320"` (au cars) or
10240
- * `"9077"` (za cars). Browse the tree with `listCategories`. Default `"all"`.
10249
+ * au: numeric category id as a string, e.g. `"18320"` (cars). za: category
10250
+ * ref, e.g. `"p6dnh"` (Cars & Bakkies). Browse the tree with
10251
+ * `listCategories`. Default `"all"`.
10241
10252
  */
10242
10253
  category?: string;
10243
10254
  /**
10244
10255
  * uk: location slug (`"london"`), town name or UK postcode (`"SW1A 1AA"`).
10245
- * au/za: numeric location id as a string, e.g. `"3003435"` (au Sydney) or
10246
- * `"3100003"` (za Gauteng). Resolve one with `locationAutocomplete`.
10256
+ * au: numeric location id as a string, e.g. `"3003435"` (Sydney). za:
10257
+ * location ref, e.g. `"dkp8y"` (Gauteng). Resolve one with
10258
+ * `locationAutocomplete`.
10247
10259
  * Default: the whole country.
10248
10260
  */
10249
10261
  location?: string;
@@ -10264,24 +10276,27 @@ interface GumtreeSearchParams {
10264
10276
  /**
10265
10277
  * Category-specific filters as comma-separated `key:value` pairs, e.g.
10266
10278
  * `"vehicle_make:bmw,vehicle_fuel_type:petrol,min_vehicle_mileage:10000"` (uk)
10267
- * or `"ma:toyota,fu:petrol,max_km:100000"` (za). Range filters take
10279
+ * or `"make:toyota,fuelType:petrol,max_mileageKm:100000"` (za). Range filters take
10268
10280
  * `min_<key>`/`max_<key>`. Discover keys with `searchFilters` for the same market.
10269
10281
  */
10270
10282
  filters?: string;
10271
- /** Page number, 1-50. */
10283
+ /** Page number, 1-50 (za: only the first 375 matches are reachable). */
10272
10284
  page?: number;
10273
10285
  /** Which Gumtree. Unset = the server default, `"uk"`. */
10274
10286
  market?: GumtreeMarket;
10275
10287
  }
10276
10288
  /** Parameters for `GET /v1/gumtree/search/filters`. All optional. */
10277
10289
  interface GumtreeSearchFiltersParams {
10278
- /** uk: category slug; au/za: numeric category id. Default `"all"`. */
10290
+ /** uk: category slug; au: numeric category id; za: category ref (`"p6dnh"`). Default `"all"`. */
10279
10291
  category?: string;
10280
- /** uk: location slug, town or UK postcode; au/za: numeric location id. Default: the whole country. */
10292
+ /**
10293
+ * uk: location slug, town or UK postcode; au: numeric location id; za:
10294
+ * location ref (`"dkp8y"`). Default: the whole country.
10295
+ */
10281
10296
  location?: string;
10282
10297
  /** Optional keywords to scope the counts. */
10283
10298
  query?: string;
10284
- /** za only: filters already applied, e.g. `"ma:toyota"` to list the Toyota models. */
10299
+ /** za only: filters already applied, e.g. `"make:toyota"` to narrow the model counts. */
10285
10300
  filters?: string;
10286
10301
  /** Which Gumtree. Unset = the server default, `"uk"`. */
10287
10302
  market?: GumtreeMarket;
@@ -10298,8 +10313,8 @@ interface GumtreeSellerListingsParams extends GumtreeMarketParams {
10298
10313
  }
10299
10314
  /** Options for `listLocations` and `listCategories`. */
10300
10315
  interface GumtreeTreeParams extends GumtreeMarketParams {
10301
- /** Node id to list the children of. Unset = the market's root. */
10302
- parent_id?: number;
10316
+ /** Node id (uk/au: a number; za: a ref such as `"dkp8y"`). Unset = the market's root. */
10317
+ parent_id?: number | string;
10303
10318
  }
10304
10319
 
10305
10320
  /**
@@ -10315,8 +10330,8 @@ interface GumtreeTreeParams extends GumtreeMarketParams {
10315
10330
  * Three markets, chosen per call with `market`: `"uk"` (gumtree.com, GBP — the
10316
10331
  * server default), `"au"` (gumtree.com.au, AUD) and `"za"` (gumtree.co.za,
10317
10332
  * ZAR). They are separate sites: uk takes slugs for category and location,
10318
- * au/za take numeric ids from `listCategories` / `listLocations` of the same
10319
- * market.
10333
+ * au takes numeric ids and za takes refs (`"p6dnh"`) from `listCategories` /
10334
+ * `listLocations` of the same market.
10320
10335
  */
10321
10336
 
10322
10337
  /**
@@ -10345,9 +10360,14 @@ interface GumtreeTreeParams extends GumtreeMarketParams {
10345
10360
  * distance: 10,
10346
10361
  * });
10347
10362
  *
10348
- * // South Africa: cars (9077) in Gauteng (3100003); listing ids are 26 digits
10349
- * const za = await client.gumtree.search({ market: "za", category: "9077", location: "3100003" });
10350
- * const detail = await client.gumtree.getListing("10013681289561010209976109", { market: "za" });
10363
+ * // South Africa: refs — Cars & Bakkies (p6dnh) in Gauteng (dkp8y)
10364
+ * const za = await client.gumtree.search({
10365
+ * market: "za",
10366
+ * category: "p6dnh",
10367
+ * location: "dkp8y",
10368
+ * filters: "make:toyota",
10369
+ * });
10370
+ * const detail = await client.gumtree.getListing("ls26bvmcpnsqmz7l9jz", { market: "za" });
10351
10371
  * console.log(detail.seller?.name);
10352
10372
  *
10353
10373
  * // Browse a market's category tree
@@ -10386,9 +10406,8 @@ declare class GumtreeClient {
10386
10406
  * Full listing: description, every attribute, images, location, seller and
10387
10407
  * similar ads. Motors listings carry the full vehicle spec.
10388
10408
  *
10389
- * @param listingId - Gumtree listing id — the number at the end of the
10390
- * listing URL (uk/au: ~10 digits; za: the full 26-digit ad id, not the
10391
- * short one).
10409
+ * @param listingId - Gumtree listing id from the end of the listing URL
10410
+ * (uk/au: ~10 digits; za: the listing ref, e.g. `"ls26bvmcpnsqmz7l9jz"`).
10392
10411
  * @param options - Optional parameters (market).
10393
10412
  * @throws NotFoundError - If the listing does not exist or has expired.
10394
10413
  */
@@ -10397,8 +10416,8 @@ declare class GumtreeClient {
10397
10416
  * Every live listing by the seller of `listingId`. Gumtree keys a seller's
10398
10417
  * ad list by one of their ads, so any listing id of theirs works.
10399
10418
  *
10400
- * @param listingId - Any Gumtree listing id belonging to the seller (za: the
10401
- * 26-digit id).
10419
+ * @param listingId - Any Gumtree listing id belonging to the seller (za: a
10420
+ * listing ref, e.g. `"ls26bvmcpnsqmz7l9jz"`).
10402
10421
  * @param options - Page number (1-50), or `{ page, market }`.
10403
10422
  */
10404
10423
  getSellerListings(listingId: string, options?: number | GumtreeSellerListingsParams): Promise<GumtreeSellerListingsResponse>;
@@ -10411,7 +10430,8 @@ declare class GumtreeClient {
10411
10430
  autocomplete(query: string, options?: GumtreeMarketParams): Promise<GumtreeAutocompleteResponse>;
10412
10431
  /**
10413
10432
  * Resolve a place name or postcode prefix to Gumtree locations. The `id`
10414
- * (au/za) or `name` (uk) is what {@link search} takes as `location`.
10433
+ * (au: a number; za: a ref such as `"pfw8k"`) or `name` (uk) is what
10434
+ * {@link search} takes as `location`.
10415
10435
  *
10416
10436
  * @param query - Town, area or postcode prefix (min 2 chars), e.g. `"manch"` or `"SW1A"`.
10417
10437
  * @param options - Optional parameters (market).
@@ -10419,20 +10439,22 @@ declare class GumtreeClient {
10419
10439
  locationAutocomplete(query: string, options?: GumtreeMarketParams): Promise<GumtreeLocationAutocompleteResponse>;
10420
10440
  /**
10421
10441
  * Browse Gumtree's location tree. uk: UK -> nations -> counties -> towns;
10422
- * au: states -> regions -> areas; za: provinces -> towns.
10442
+ * au: states -> regions -> areas; za: provinces -> towns and suburbs.
10423
10443
  *
10424
- * @param options - Location id to list the children of, or
10444
+ * @param options - Location id (uk/au: a number; za: a ref such as
10445
+ * `"dkp8y"` for Gauteng) to list the children of, or
10425
10446
  * `{ parent_id, market }`. Unset = the market's root (the whole country).
10426
10447
  */
10427
- listLocations(options?: number | GumtreeTreeParams): Promise<GumtreeTreeResponse>;
10448
+ listLocations(options?: number | string | GumtreeTreeParams): Promise<GumtreeTreeResponse>;
10428
10449
  /**
10429
- * Browse Gumtree's category tree. A node's `slug` (uk) or `id` (au/za) is
10430
- * the {@link search} category.
10450
+ * Browse Gumtree's category tree. A node's `slug` (uk) or `id` (au: a
10451
+ * number; za: a ref such as `"p6dnh"`) is the {@link search} category.
10431
10452
  *
10432
- * @param options - Category id to list the children of, or
10453
+ * @param options - Category id (uk/au: a number; za: a ref such as
10454
+ * `"l4dq6"` for Vehicles) to list the children of, or
10433
10455
  * `{ parent_id, market }`. Unset = the market's root (all categories).
10434
10456
  */
10435
- listCategories(options?: number | GumtreeTreeParams): Promise<GumtreeTreeResponse>;
10457
+ listCategories(options?: number | string | GumtreeTreeParams): Promise<GumtreeTreeResponse>;
10436
10458
  /**
10437
10459
  * The Gumtree sites this API covers (`uk`, `au`, `za`), with their domain,
10438
10460
  * currency, distance unit, page size and id format.