Create Market Survey
curl --request POST \
--url https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}",
"iq_property_id": 781245
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys"
payload = {
"account_id": "{account_id}",
"iq_property_id": 781245
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '{account_id}', iq_property_id: 781245})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys', 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://data.apartmentiq.io/apartmentiq/api/v2/market_surveys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '{account_id}',
'iq_property_id' => 781245
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}"
response = http.request(request)
puts response.read_body{
"id": 52310,
"name": "Marina Landing",
"category": "market_survey",
"account_id": 1042,
"active": true,
"min_floorplan": 0,
"max_floorplan": 3,
"target_comp_count": 10,
"subject_property": {
"id": 781245,
"custom": false,
"property_name": "Marina Landing",
"address": "401 Riverfront Dr, Austin, TX 78701"
},
"comps": [
{
"property_id": 781266,
"property_name": "Marina Heights",
"score": 0.82
},
{
"property_id": 781301,
"property_name": "Riverside Commons",
"score": 0.74
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310",
"reactivated": false
}Market Surveys
Create Market Survey
Create an active market survey with a property as its subject.
Available upon request. This endpoint is not enabled for all customers. Please reach out to your account representative to turn on the Market Survey API for your account. Each new or reactivated market survey counts as a market survey addition, exactly like adding one in ApartmentIQ.
- Without
name, the survey is named after the property, with a counter if that name is taken. - The floorplan range comes from the bedroom counts the property has advertised, or 0 to 5 (studio to 5 bedrooms) when it has none.
- Without
comp_property_ids, comps are selected automatically, up totarget_comp_countminus the subject (9 by default). Withcomp_property_ids, every ID you send is added, even past that target. - If the account has a deactivated market survey for this property, it is reactivated and
reactivatedistrue. It keeps its floorplan range, target comp count and comps, and is topped up to its target comp count. Withname, it is renamed. If that name is taken, the response is 422 and the survey stays deactivated. Withoutname, it keeps its old name.comp_property_idsis ignored, but still validated. unit_count_overrideis the unit count billed for the survey. It is saved for the property in your account, so it also applies outside this survey.- The confirmation email goes to the API token’s user.
- A 422 for an existing survey includes its
comp_set_id, so a client that lost a response can find the survey it created.
POST
/
market_surveys
Create Market Survey
curl --request POST \
--url https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}",
"iq_property_id": 781245
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys"
payload = {
"account_id": "{account_id}",
"iq_property_id": 781245
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '{account_id}', iq_property_id: 781245})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys', 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://data.apartmentiq.io/apartmentiq/api/v2/market_surveys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '{account_id}',
'iq_property_id' => 781245
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/market_surveys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{account_id}\",\n \"iq_property_id\": 781245\n}"
response = http.request(request)
puts response.read_body{
"id": 52310,
"name": "Marina Landing",
"category": "market_survey",
"account_id": 1042,
"active": true,
"min_floorplan": 0,
"max_floorplan": 3,
"target_comp_count": 10,
"subject_property": {
"id": 781245,
"custom": false,
"property_name": "Marina Landing",
"address": "401 Riverfront Dr, Austin, TX 78701"
},
"comps": [
{
"property_id": 781266,
"property_name": "Marina Heights",
"score": 0.82
},
{
"property_id": 781301,
"property_name": "Riverside Commons",
"score": 0.74
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310",
"reactivated": false
}Authorizations
Body
application/json
Request contract for creating a market survey or research report. Integer fields also accept integer strings such as "300".
Response
The market survey was created or reactivated.
A market survey or research report.