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{
"id": 123,
"name": "<string>",
"slug": "<string>",
"result_count": 123,
"children": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"has_children": true
}
]
}Reference
List Locations
Browse Gumtree’s UK location tree: United Kingdom, nations, counties, 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{
"id": 123,
"name": "<string>",
"slug": "<string>",
"result_count": 123,
"children": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"has_children": true
}
]
}Browse Gumtree’s location tree one level at a time — United Kingdom → nations →
counties → towns. Each child’s
slug is a valid location for
/search.
Credits: 1
Authorization
string
required
Your ScrapeBadger API key.
Query Parameters
integer
default:"10000392"
Location id to list the children of.
10000392 (the default) is the United
Kingdom. Then drill down by id, e.g. 10000393 for England.Response
integer
The parent location id.
string
e.g.
England.string
e.g.
england.integer
Number of children.
TreeNode[]
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
{
"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 }
]
}

