scrapebadger 0.60.0 → 0.60.1
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 +1 -1
- package/dist/index.d.cts +70 -48
- package/dist/index.d.ts +70 -48
- package/dist/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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: "
|
|
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) |
|
package/dist/index.d.cts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
/**
|
|
10069
|
+
/** Ads ever posted (no market publishes it at present). */
|
|
10065
10070
|
lifetime_listings: number | null;
|
|
10066
|
-
/**
|
|
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
|
|
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
|
-
|
|
10109
|
+
/** za: a ref such as `"p6dnh"`. */
|
|
10110
|
+
category_id: number | string | null;
|
|
10105
10111
|
category_name: string | null;
|
|
10106
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
10240
|
-
* `"
|
|
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
|
|
10246
|
-
* `"
|
|
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 `"
|
|
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
|
|
10290
|
+
/** uk: category slug; au: numeric category id; za: category ref (`"p6dnh"`). Default `"all"`. */
|
|
10279
10291
|
category?: string;
|
|
10280
|
-
/**
|
|
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. `"
|
|
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
|
|
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
|
|
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:
|
|
10349
|
-
* const za = await client.gumtree.search({
|
|
10350
|
-
*
|
|
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
|
|
10390
|
-
*
|
|
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:
|
|
10401
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
package/dist/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
/**
|
|
10069
|
+
/** Ads ever posted (no market publishes it at present). */
|
|
10065
10070
|
lifetime_listings: number | null;
|
|
10066
|
-
/**
|
|
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
|
|
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
|
-
|
|
10109
|
+
/** za: a ref such as `"p6dnh"`. */
|
|
10110
|
+
category_id: number | string | null;
|
|
10105
10111
|
category_name: string | null;
|
|
10106
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
10240
|
-
* `"
|
|
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
|
|
10246
|
-
* `"
|
|
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 `"
|
|
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
|
|
10290
|
+
/** uk: category slug; au: numeric category id; za: category ref (`"p6dnh"`). Default `"all"`. */
|
|
10279
10291
|
category?: string;
|
|
10280
|
-
/**
|
|
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. `"
|
|
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
|
|
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
|
|
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:
|
|
10349
|
-
* const za = await client.gumtree.search({
|
|
10350
|
-
*
|
|
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
|
|
10390
|
-
*
|
|
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:
|
|
10401
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|