Location Suggestions
curl --request GET \
--url https://scrapebadger.com/v1/realtor/autocomplete \
--header 'x-api-key: <api-key>'import requests
url = "https://scrapebadger.com/v1/realtor/autocomplete"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://scrapebadger.com/v1/realtor/autocomplete', 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/realtor/autocomplete",
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: <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/realtor/autocomplete"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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/realtor/autocomplete")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/realtor/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"market": "<string>",
"query": "<string>",
"suggestions": [
{
"id": "<string>",
"type": "<string>",
"label": "<string>",
"city": "<string>",
"state_code": "<string>",
"postal_code": "<string>",
"country": "<string>",
"slug_id": "<string>",
"geo_id": "<string>",
"coordinate": {
"lat": 123,
"lon": 123
},
"market": "<string>"
}
]
}Search
Location Suggestions
Autocomplete locations (cities, ZIPs, neighborhoods, addresses) for a partial query.
GET
/
v1
/
realtor
/
autocomplete
Location Suggestions
curl --request GET \
--url https://scrapebadger.com/v1/realtor/autocomplete \
--header 'x-api-key: <api-key>'import requests
url = "https://scrapebadger.com/v1/realtor/autocomplete"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://scrapebadger.com/v1/realtor/autocomplete', 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/realtor/autocomplete",
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: <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/realtor/autocomplete"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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/realtor/autocomplete")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/realtor/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"market": "<string>",
"query": "<string>",
"suggestions": [
{
"id": "<string>",
"type": "<string>",
"label": "<string>",
"city": "<string>",
"state_code": "<string>",
"postal_code": "<string>",
"country": "<string>",
"slug_id": "<string>",
"geo_id": "<string>",
"coordinate": {
"lat": 123,
"lon": 123
},
"market": "<string>"
}
]
}Query Parameters
string
required
Partial location to autocomplete (e.g.
austi, 9021, toron).string
default:"us"
Which market to source suggestions from:
us (realtor.com) or ca (realtor.ca).integer
default:10
Maximum number of suggestions to return. Range:
1 - 25.Response
string
The market the suggestions came from.
string
The query prefix that was autocompleted.
array
Array of suggestion objects.
Show Suggestion object
Show Suggestion object
string
Suggestion id.
string
Suggestion type, e.g.
city, postal_code, neighborhood, address.string
Human-readable label, e.g.
Austin, TX.string
City (nullable).
string
State/province code (nullable).
string
Postal/ZIP code (nullable).
string
ISO country code (nullable).
string
Portal slug id (nullable).
string
Portal geo id (nullable).
object
Center coordinate
{lat, lon} (nullable).string
Market the suggestion belongs to.
Example Response
{
"market": "us",
"query": "austi",
"suggestions": [
{
"id": "city:austin_tx",
"type": "city",
"label": "Austin, TX",
"city": "Austin",
"state_code": "TX",
"postal_code": null,
"country": "US",
"slug_id": "Austin_TX",
"geo_id": "1234",
"coordinate": { "lat": 30.2672, "lon": -97.7431 },
"market": "us"
}
]
}
Each autocomplete request costs 2 credits. Failed requests are not charged.
Authorizations
Query Parameters
Partial location prefix.
Market to source suggestions from.
Available options:
us, ca Maximum number of suggestions (1-25).
Required range:
1 <= x <= 25
