List Locations
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/locations \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/locations"
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/locations', 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/locations",
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/locations"
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/locations")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/locations")
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{
"market": "<string>",
"id": {},
"name": "<string>",
"slug": "<string>",
"result_count": 123,
"children": [
{
"id": {},
"name": "<string>",
"slug": "<string>",
"has_children": true
}
]
}Reference
List Locations
Browse Gumtree’s location tree in the UK, Australia or South Africa: nations, states or provinces down to towns.
GET
/
v1
/
gumtree
/
locations
List Locations
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/locations \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/locations"
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/locations', 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/locations",
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/locations"
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/locations")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/locations")
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{
"market": "<string>",
"id": {},
"name": "<string>",
"slug": "<string>",
"result_count": 123,
"children": [
{
"id": {},
"name": "<string>",
"slug": "<string>",
"has_children": true
}
]
}Browse Gumtree’s location tree one level at a time. On
On
uk and au each
child’s slug is a valid location for
/search — a name slug on uk, the
numeric id on au. On za pass the child’s id, a ref such as dkp8y
(Gauteng).
uk: United Kingdom → nations → counties → towns.au: Australia → states → regions → areas, each with its live ad count.za: South Africa → provinces → towns and suburbs.
Authorization
Query Parameters
Location id (
uk, au: a number) or ref (za) to list the children of.
Omit it for the whole country (uk root 10000392, za root gsptp). Then
drill down by id, e.g. 10000393 for England, 3003435 for the Sydney
Region, dkp8y for Gauteng.Response
Example
curl "https://scrapebadger.com/v1/gumtree/locations?parent_id=10000393" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/gumtree/locations?" +
new URLSearchParams({ parent_id: "10000393" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const { children } = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/gumtree/locations",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"parent_id": 10000393},
)
children = res.json()["children"]
Response
{
"market": "uk",
"id": 10000393,
"name": "England",
"slug": "england",
"result_count": 47,
"children": [
{ "id": 11000000, "name": "Bedfordshire", "slug": "bedfordshire", "has_children": true },
{ "id": 11000001, "name": "Berkshire", "slug": "berkshire", "has_children": true },
{ "id": 10000348, "name": "Bristol", "slug": "bristol", "has_children": true }
]
}
Australia
curl "https://scrapebadger.com/v1/gumtree/locations?market=au&parent_id=3003435" \
-H "X-API-Key: YOUR_API_KEY"
Response (abridged)
{
"market": "au",
"id": 3003435,
"name": "Sydney Region",
"slug": "3003435",
"result_count": 38,
"children": [
{ "id": 3003812, "name": "Ku-ring-gai Area", "slug": "3003812", "has_children": null },
{ "id": 3003771, "name": "Inner Sydney", "slug": "3003771", "has_children": null },
{ "id": 3003633, "name": "Eastern Suburbs", "slug": "3003633", "has_children": null }
]
}
za, the root (parent_id omitted, ref gsptp South Africa) lists the 9
provinces — dkp8y Gauteng, pys74 KwaZulu-Natal, x0r1b Western Cape … Each province lists its towns:
curl "https://scrapebadger.com/v1/gumtree/locations?market=za&parent_id=dkp8y" \
-H "X-API-Key: YOUR_API_KEY"
Response (abridged)
{
"market": "za",
"id": "dkp8y",
"name": "Gauteng",
"slug": null,
"result_count": 80,
"children": [
{ "id": "yb4jd", "name": "Akasia", "slug": null, "has_children": true },
{ "id": "m22ns", "name": "Alberton", "slug": null, "has_children": true },
{ "id": "tvszd", "name": "Alexandra", "slug": null, "has_children": false }
]
}
Errors
| Status | Meaning |
|---|---|
400 | parent_id is not a number (uk, au) or not a ref (za — including the old numeric ids). |
404 | parent_id is not a location of this market (au, za). |
422 | Gumtree temporarily refused the request — not billed. Retry shortly. |

