Get Search Filters
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/search/filters \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/search/filters"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/gumtree/search/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/gumtree/search/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/gumtree/search/filters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/gumtree/search/filters")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/search/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"category": "<string>",
"category_name": "<string>",
"total_results": 123,
"filters": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"min_key": "<string>",
"max_key": "<string>",
"options": [
{}
],
"min_options": [
{}
],
"max_options": [
{}
]
}
],
"sort_options": [
{}
],
"distance_options": [
123
],
"category_facets": [
{}
]
}Search
Get Search Filters
The filters, sort orders and radius options Gumtree offers for a category, each value with its live result count.
GET
/
v1
/
gumtree
/
search
/
filters
Get Search Filters
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/search/filters \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/search/filters"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/gumtree/search/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/gumtree/search/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/gumtree/search/filters"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/gumtree/search/filters")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/search/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"category": "<string>",
"category_name": "<string>",
"total_results": 123,
"filters": [
{
"key": "<string>",
"label": "<string>",
"type": "<string>",
"min_key": "<string>",
"max_key": "<string>",
"options": [
{}
],
"min_options": [
{}
],
"max_options": [
{}
]
}
],
"sort_options": [
{}
],
"distance_options": [
123
],
"category_facets": [
{}
]
}List every filter Gumtree offers for a category — make, model, fuel type,
mileage range, bedrooms, job type and so on — with a live result count per
value, plus the available sort orders and search radii. Feed a filter’s
Using a filter in
key
and an option’s value straight back into
/search as filters=key:value.
Credits: 5
Authorization
string
required
Your ScrapeBadger API key.
Query Parameters
string
default:"all"
Category slug, e.g.
cars, property-to-rent, jobs. Filters are
category-specific, so pass the category you intend to search.string
default:"uk"
Location slug, town name or UK postcode. Scopes the counts.
string
Optional keywords to scope the counts.
Response
string
Category slug.
string
e.g.
Cars.integer
Matching listings before any filter.
SearchFilter[]
Filters for the category.
Show SearchFilter
Show SearchFilter
string
Filter key for
filters=key:value, e.g. vehicle_make.string
e.g.
Make.string
enum, multiple_selection, enum_range, range_freeform or boolean.string
Range filters: the lower-bound key when Gumtree names it explicitly (e.g.
min_price). Otherwise it is min_ + key.string
Range filters: the upper-bound key, likewise
max_ + key when null.FilterOption[]
label, value, count — value is what /search takes. Empty for range filters.FilterOption[]
Range filters: the lower bounds Gumtree offers.
FilterOption[]
Range filters: the upper bounds Gumtree offers.
SortOption[]
Sort orders Gumtree offers for the category —
value, label.number[]
Search radius values in miles.
CategoryFacet[]
Sub-categories with counts —
name, slug, count.Example
curl "https://scrapebadger.com/v1/gumtree/search/filters?category=cars" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/gumtree/search/filters?" +
new URLSearchParams({ category: "cars" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const { filters } = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/gumtree/search/filters",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"category": "cars"},
)
filters = res.json()["filters"]
Response
{
"category": "cars",
"category_name": "Cars",
"total_results": 139812,
"filters": [
{
"key": "vehicle_make",
"label": "Make",
"type": "enum",
"min_key": null,
"max_key": null,
"options": [
{ "label": "Abarth", "value": "abarth", "count": 265 },
{ "label": "AC", "value": "ac", "count": 1 },
{ "label": "Aixam", "value": "aixam", "count": 1 }
],
"min_options": [],
"max_options": []
},
{
"key": "vehicle_mileage",
"label": "Mileage",
"type": "enum_range",
"min_key": null,
"max_key": null,
"options": [],
"min_options": [
{ "label": "0 miles", "value": "0", "count": null },
{ "label": "10,000 miles", "value": "10000", "count": null },
{ "label": "50,000 miles", "value": "50000", "count": null }
],
"max_options": [
{ "label": "1,000 miles", "value": "1000", "count": null },
{ "label": "10,000 miles", "value": "10000", "count": null }
]
}
],
"sort_options": [
{ "value": "relevance", "label": "Most relevant first" },
{ "value": "date", "label": "Most recent first" },
{ "value": "price_asc", "label": "Price: Low to High" },
{ "value": "price_desc", "label": "Price: High to Low" },
{ "value": "distance", "label": "Nearest first" }
],
"distance_options": [1.0, 3.0, 5.0, 10.0, 15.0, 30.0, 50.0, 75.0, 100.0, 1000.0],
"category_facets": []
}
sort_options values are the ones /search
accepts as sort — pass them straight back.Using a filter in /search
Filter type | Pass to /search as |
|---|---|
enum, multiple_selection | filters=vehicle_make:bmw — repeat the key for several values: vehicle_make:bmw,vehicle_make:audi |
enum_range | filters=min_vehicle_mileage:10000,max_vehicle_mileage:50000 (min_ / max_ + key) |
price, seller_type, photos_filter and urgent_filter also appear in this
list; on /search use the dedicated min_price / max_price, seller_type,
with_photos and urgent_only parameters for them.
Use this endpoint to size a search before paging it: the per-value counts
tell you which filters bring a result set under the 50-page ceiling of
/search.Errors
| Status | Meaning |
|---|---|
422 | Gumtree temporarily refused the request — not billed. Retry shortly. |

