Gumtree search API
Gumtree ads for a query, category and location with Gumtree’s sort, distance, price and seller filters.
GET /v1/gumtree/search2 credits per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/gumtree/search?query=bike&location_id=london",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 2 credits{ "url": "https://www.gumtree.com/search?q=bike&search_category=all", "page": 1, "total": 53374, "next_page": 2, "listings": [ { "id": "1804963190", "title": "Merida Black and Green Road Bike, Well Maintained", "url": "https://www.gumtree.com/p/road-bikes/merida-black-and-green-road-bike-well-maintained/1804963190", "image": "https://img.gumtree.com/ePR8PyKf84wPHx7_RYmEag/5e994a0c64254b03a9_6f953fb33315/86", "price": "£800", "location": "Storrington, West Sussex", "attributes": [], "badges": [ "Featured" ] }, { "id": "1804553590", "title": "HONDA CRF 110 2023 MOTOCROSS BIKE VERY TIDY BIKE", "url": "https://www.gumtree.com/p/honda-motorbikes/honda-crf-110-2023-motocross-bike-very-tidy-bike-/1804553590", "image": "https://img.gumtree.com/ePR8PyKf84wPHx7_RYmEag/28f0450398b7471aa4_c605441b1f22/86", "price": "£2,395", "location": "Salisbury, Wiltshire", "attributes": [ "2023", "0 mile", "… 2 more" ], "badges": [ "Featured" ] }, "… 4 more" ], "breadcrumb": [ { "name": "For Sale", "url": "https://www.gumtree.com/for-sale" }, { "name": "Sports, Leisure & Travel", "url": "https://www.gumtree.com/for-sale/sports-leisure-travel" }, "… 2 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
queryquery | string | Search words. Example: bike. |
urlquery | string | Or a gumtree.com search URL to read as is. |
pagequery | integer | |
sort_byquery | "relevance" | "newest" | "price_low" | "price_high" | One of relevance, newest, price_low, price_high. |
category_idquery | string | |
location_idquery | string | |
distancequery | "0" | "1" | "3" | "5" | "10" | "15" | "30" | "50" | "75" | "100" | "150" | "250" | "500" | "nationwide" | One of 0, 1, 3, 5, 10, 15, 30, 50, 75, 100, 150, 250, 500, nationwide. |
min_pricequery | integer | null | |
max_pricequery | integer | null | |
seller_typequery | "private" | "trade" | One of private, trade. |
attributesquery | string | Extra Gumtree URL parameters, k=v&k=v. |
Response fields
200 with a GumtreeSearch, in the labels Gumtree’s own listing and ad pages show.
| Field | Type | Description |
|---|---|---|
url | string | |
page | number | |
total | number | null | |
next_page | number | null | |
listings | object[] | |
breadcrumb | object[] |
Status codes
| Status | Meaning |
|---|---|
200 | A page of ads. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The ad, category or location does not exist. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Gumtree is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Gumtree is a trademark of Gumtree.com Limited. We are not affiliated with or endorsed by Gumtree.