Replace Comps
curl --request PUT \
--url https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}",
"property_ids": [
781266,
781390
]
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps"
payload = {
"account_id": "{account_id}",
"property_ids": [781266, 781390]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '{account_id}', property_ids: [781266, 781390]})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps', 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/comp_sets/{comp_set_id}/comps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '{account_id}',
'property_ids' => [
781266,
781390
]
]),
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/comp_sets/{comp_set_id}/comps"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\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": 781390,
"property_name": "The Foundry",
"score": 0.77
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310",
"added_property_ids": [
781390
],
"removed_property_ids": [
781301
]
}{
"error": "property_ids is required"
}{
"error": "<string>",
"message": "<string>",
"quota_limit": 123,
"quota_usage": 123
}{
"error": "You do not have permission to edit this comp set"
}{
"error": "Comp set not found"
}{
"error": "Invalid property_ids",
"invalid_property_ids": [
990001
]
}{
"error": "Trial API quota limit exceeded",
"quota_limit": 1000,
"quota_usage": 1000
}Market Surveys
Replace Comps
Set a comp set’s comps to exactly the list you send. Comps missing from the list are removed, and new ones are added. Sending the same list again changes nothing, so you can sync from your own system safely.
- Owned properties in the comp set, such as the subject, are never removed. Send only competitive comps.
- Comps already in the comp set are kept whatever their status, so you can send back the list you received.
- New comps must be properties ApartmentIQ can use as comps. Otherwise nothing changes and the response lists the invalid IDs.
- The list can hold more comps than
target_comp_count. - Later automatic top-ups can add comps up to
target_comp_count: reactivating a market survey, and the daily refresh for comp sets that update automatically. Comp sets created through the API do not update automatically. - Every change is recorded in the comp set’s history under the API token’s user.
- If you get a 500, the change may already be saved. Send the same list again.
PUT
/
comp_sets
/
{comp_set_id}
/
comps
Replace Comps
curl --request PUT \
--url https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "{account_id}",
"property_ids": [
781266,
781390
]
}
'import requests
url = "https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps"
payload = {
"account_id": "{account_id}",
"property_ids": [781266, 781390]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '{account_id}', property_ids: [781266, 781390]})
};
fetch('https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps', 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/comp_sets/{comp_set_id}/comps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'account_id' => '{account_id}',
'property_ids' => [
781266,
781390
]
]),
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/comp_sets/{comp_set_id}/comps"
payload := strings.NewReader("{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.apartmentiq.io/apartmentiq/api/v2/comp_sets/{comp_set_id}/comps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"{account_id}\",\n \"property_ids\": [\n 781266,\n 781390\n ]\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": 781390,
"property_name": "The Foundry",
"score": 0.77
}
],
"app_url": "https://app.apartmentiq.io/accounts/1042/market-surveys/52310",
"added_property_ids": [
781390
],
"removed_property_ids": [
781301
]
}{
"error": "property_ids is required"
}{
"error": "<string>",
"message": "<string>",
"quota_limit": 123,
"quota_usage": 123
}{
"error": "You do not have permission to edit this comp set"
}{
"error": "Comp set not found"
}{
"error": "Invalid property_ids",
"invalid_property_ids": [
990001
]
}{
"error": "Trial API quota limit exceeded",
"quota_limit": 1000,
"quota_usage": 1000
}Authorizations
Body
application/json
Request contract for replacing a comp set's comps.
Response
The comps were applied. Both lists are empty when nothing changed.
A market survey or research report.