List Markets
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/markets \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/markets"
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/markets', 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/markets",
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/markets"
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/markets")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/markets")
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{
"result_count": 123,
"markets": [
{
"market": "<string>",
"domain": "<string>",
"country": "<string>",
"currency": "<string>",
"distance_unit": "<string>",
"page_size": 123,
"id_format": "<string>"
}
]
}Reference
List Markets
List the Gumtree sites this API covers — UK, Australia and South Africa — with their currency, distance unit, page size and id format.
GET
/
v1
/
gumtree
/
markets
List Markets
curl --request GET \
--url https://scrapebadger.com/v1/gumtree/markets \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/gumtree/markets"
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/markets', 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/markets",
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/markets"
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/markets")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/gumtree/markets")
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{
"result_count": 123,
"markets": [
{
"market": "<string>",
"domain": "<string>",
"country": "<string>",
"currency": "<string>",
"distance_unit": "<string>",
"page_size": 123,
"id_format": "<string>"
}
]
}List the Gumtree sites this API covers. Pass a market’s
market code as the
market parameter of every other Gumtree endpoint. This endpoint is free.
Credits: 0
The three markets are separate platforms. Category, location and listing ids
from one market mean nothing in another — always pair an id with the
market it came from.Authorization
string
required
Your ScrapeBadger API key.
Response
integer
Number of markets.
MarketInfo[]
Supported markets.
Show MarketInfo
Show MarketInfo
string
uk, au or za — the market parameter value.string
e.g.
www.gumtree.com.au.string
ISO country code, e.g.
AU.string
GBP, AUD or ZAR.string
Unit of the
/search distance parameter — miles, km, or null when the market has no radius search.integer
Organic results per
/search page (featured ads come on top).string
How
/search takes category and location.Example
curl "https://scrapebadger.com/v1/gumtree/markets" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch("https://scrapebadger.com/v1/gumtree/markets", {
headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY },
});
const { markets } = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/gumtree/markets",
headers={"X-API-Key": "YOUR_API_KEY"},
)
markets = res.json()["markets"]
Response
{
"result_count": 3,
"markets": [
{
"market": "uk",
"domain": "www.gumtree.com",
"country": "GB",
"currency": "GBP",
"distance_unit": "miles",
"page_size": 25,
"id_format": "slugs: category 'cars', location 'london' or a UK postcode"
},
{
"market": "au",
"domain": "www.gumtree.com.au",
"country": "AU",
"currency": "AUD",
"distance_unit": "km",
"page_size": 24,
"id_format": "numeric ids from /categories and /locations (market=au)"
},
{
"market": "za",
"domain": "www.gumtree.co.za",
"country": "ZA",
"currency": "ZAR",
"distance_unit": null,
"page_size": 20,
"id_format": "numeric ids from /categories and /locations (market=za)"
}
]
}

