List Categories
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/categories \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/categories"
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/categories', 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/categories",
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/categories"
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/categories")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/categories")
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 Categories
Browse Gumtree’s category tree. A node’s slug is the category value /search takes.
GET
/
v1
/
gumtree
/
categories
List Categories
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/categories \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/categories"
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/categories', 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/categories",
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/categories"
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/categories")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/categories")
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 category tree one level at a time. Each child’s
slug is the
value /search and
/search/filters take as
category.
Credits: 1
Authorization
string
required
Your ScrapeBadger API key.
Query Parameters
integer
default:"1"
Category id to list the children of.
1 (the default) is the root — all
categories. Then drill down by id, e.g. 2551 for Motors.Response
integer
The parent category id.
string
e.g.
Motors.string
e.g.
cars-vans-motorbikes.integer
Number of children.
TreeNode[]
Example
curl "https://scrapebadger.com/v1/gumtree/categories?parent_id=2551" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/gumtree/categories?" +
new URLSearchParams({ parent_id: "2551" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const { children } = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/gumtree/categories",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"parent_id": 2551},
)
children = res.json()["children"]
Response
{
"id": 2551,
"name": "Motors",
"slug": "cars-vans-motorbikes",
"result_count": 12,
"children": [
{ "id": 11986, "name": "Other Categories", "slug": "other-vehicle-categories", "has_children": false },
{ "id": 9311, "name": "Cars", "slug": "cars", "has_children": false },
{ "id": 10442, "name": "Motorbikes & Scooters", "slug": "motorbikes-scooters", "has_children": false },
{ "id": 94, "name": "Vans", "slug": "vans", "has_children": false }
]
}

