Marketplace Locations
curl --request GET \
--url https://scrapebadger.com/v1/facebook/marketplace/locations \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/locations")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/marketplace/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{
"locations": [
{}
],
"count": 123
}Marketplace Locations
The common Facebook Marketplace location slugs used as the location parameter — free reference catalog.
GET
/
v1
/
facebook
/
marketplace
/
locations
Marketplace Locations
curl --request GET \
--url https://scrapebadger.com/v1/facebook/marketplace/locations \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/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/facebook/marketplace/locations")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/marketplace/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{
"locations": [
{}
],
"count": 123
}The common Facebook Marketplace location slugs, surfaced for convenience.
Not exhaustive, and not guessable: only places Facebook itself has created a
slug for resolve.
london and newcastleupontyne do; durham and sunderland
do not, and
/marketplace/search
returns a 400 invalid_location for those rather than silently searching a
different place (the place varies — San Francisco, Maryland and Delaware have
all been observed for the same bad input).
To cover a town that has no slug, search a nearby location that does have one
and read city_page_id off the listings — those numeric Facebook place ids are
valid location values. See
Location targeting.
Credits: 0 (free)
Authorization
Response
Each
Location has slug (the value you pass as a location parameter) and
name (the human-readable city).Example
curl "https://scrapebadger.com/v1/facebook/marketplace/locations" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/facebook/marketplace/locations",
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const data = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/facebook/marketplace/locations",
headers={"X-API-Key": "YOUR_API_KEY"},
)
data = res.json()
Response
{
"locations": [
{ "slug": "nyc", "name": "New York, NY" },
{ "slug": "la", "name": "Los Angeles, CA" },
{ "slug": "chicago", "name": "Chicago, IL" },
{ "slug": "houston", "name": "Houston, TX" },
{ "slug": "seattle", "name": "Seattle, WA" },
{ "slug": "sanfrancisco", "name": "San Francisco, CA" },
{ "slug": "miami", "name": "Miami, FL" },
{ "slug": "atlanta", "name": "Atlanta, GA" },
{ "slug": "london", "name": "London, UK" },
{ "slug": "toronto", "name": "Toronto, ON" },
{ "slug": "sydney", "name": "Sydney, AU" }
],
"count": 11
}

