Introduction
Welcome to the FoxyAI API!
FoxyAI provides a simple and powerful REST API to integrate Visual Property Intelligence tools into your business or application.
The FoxyAI team loves to hear your comments and feedback. Email us! support@foxyai.com
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
-H "Authorization: API_KEY"
Make sure to replace
API_KEY
with your API key.
All requests are authenticated using an API Key provided by the FoxyAI team. To request a key, send an email to support@foxyai.com.
Header | Value |
---|---|
Authorization | Bearer {API_KEY} |
Content-Type | application/json |
Image Analysis
Analyze Images
curl -X "POST" "https://api.remodelit.ai/property-image/batch" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json' \
-d $'{
"urls": [
"https://photos.zillowstatic.com/fp/7964d9c3c45de20cea8e515ce3877d76-uncropped_scaled_within_1536_1152.jpg",
...
]
}'
Response:
{
"metrics": {
"Kitchen": {
"count": 1,
"average_condition": 2.49722075
},
"Overall": {
"count": 1,
"average_condition": 2.49722075
}
},
"images": [
{
"class": {
"status": "complete",
"type": "Kitchen",
"confidence": 0.998914361
},
"quality": {
"status": "complete",
"score": 2.49722075
},
"objects": {
"status": "pending",
"items": []
},
"url": "https://photos.zillowstatic.com/fp/7964d9c3c45de20cea8e515ce3877d76-uncropped_scaled_within_1536_1152.jpg",
"createdAt": "2021-03-26T17:38:49.020Z",
"updatedAt": "2021-03-26T17:38:49.021Z",
"id": "seJamnCgDuEpLXIw"
}
...
]
}
The image analysis endpoint allows you to post a list of image urls and receive inference about those images.
HTTP Request
Method | Path |
---|---|
POST |
/property-image/batch |
Query Parameters
Parameter | Required | Description |
---|---|---|
urls | yes | Array of image URLs to be analyzed. |
objectDetection | no | If set to true, this will enable object detection for the images passed in urls parameter. See below for more information on retrieving the results of object detection. |
Object / Material Detection
Step 1: Post image(s)
curl -X "POST" "https://api.remodelit.ai/property-image/batch" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json' \
-d $'{
"objectDetection": "true",
"urls": [
"https://photos.zillowstatic.com/fp/7964d9c3c45de20cea8e515ce3877d76-uncropped_scaled_within_1536_1152.jpg"
]
}'
Step 2: Get object detection results by image ID (returned in Step 1 response)
curl -X "GET" "https://api.remodelit.ai/property-image/abcdef" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json'
Response:
{
...
"images": [
{
...
"objects": {
"status": "complete",
"items": [
{
"centroid": {
"x": 0.22,
"y": 0.8208232445520581
},
"class": "Floor",
"materials": [
{
"type": "carpet",
"confidence": 0.7804508019072388
},
{
"type": "fabric",
"confidence": 0.16634156913740789
},
{
"type": "stone",
"confidence": 0.04789770264412657
},
{
"type": "brick",
"confidence": 0.005309926311226701
}
]
}
]
}
}
]
}
Object detection can be enabled by passing objectDetection: true
in the post body of the image analysis endpoint. This will queue object detection to be run asynchronously and you must poll the GET /property-image/{id} endpoint to receive the results.
The following objects classes will be detected and labeled:
["Chimney", "Building", "Wall", "Ceiling", "Window", "Dishwasher", "Sink", "House", "Fence", "Railing", "Stairs", "Toilet", "Roof", "Microwave", "Shower", "Bathtub", "Fireplace", "Skylight", "Fountain", "Area Rug", "Kitchen Island", "Washer/Dryer", "Hood", "Stove/Range/Oven", "Refrigerator", "Cabinets", "Countertops", "Double Door", "Ceiling Light", "Floor", "Chandelier"]
HTTP Request
Method | Path |
---|---|
GET |
/property-image/{id} |
Query Parameters
Parameter | Required | Description |
---|---|---|
urls | yes | Array of image URLs to be analyzed. |
objectDetection | no | If set to true, this will enable object detection for the images passed in urls parameter. See below for more information on retrieving the results of object detection. |
Flywheel (Image Feedback)
curl -X "POST" "https://api.remodelit.ai/flywheel" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json' \
-d $'{
"image": "{image_id_from_batch}",
"class": {
"confidence": 0.999325395,
"type": "Frontyard"
},
"quality": {
"score": 1.33736598
}
}'
Response:
{
"image": "{image_id_from_batch}",
"url": "https://remodelit-media.s3.amazonaws.com/image.png",
"key": "{your_api_key}",
"class": {
"type": "Frontyard",
"confidence": 0.999325395
},
"quality": {
"score": 1.33736598
},
"createdAt": "2022-01-05T00:42:32.806Z",
"updatedAt": "2022-01-05T00:42:32.806Z",
"id": "0o0yEGMFk9FxivHo"
}
The Flywheel endpoint allows you to send us corrected prediction results which we can use to tune our models.
HTTP Request
Method | Path |
---|---|
POST |
/flywheel |
Query Parameters
Parameter | Required | Description |
---|---|---|
image | yes | The image id you are sending corrections for. |
class.type | no | The corrected class type of the image |
class.confidence | no | The corrected class confidence of the image (Most likely 1) |
quality.score | no | The corrected quality score of the image |
Renovation
Renovation Cost
curl -X "POST" "https://api.remodelit.ai/renovation-cost" \
-H 'authorization: {api_key}' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"zipCode": "11201",
"projectTypes": [
"refinishWoodFloors",
"installNewCarpet"
]
}'
Response:
{
"installNewCarpet": {
"cost": {
"range": [679, 2206],
"avg": 1443,
"min": 220,
"max": 3850
},
"projectType": "installNewCarpet",
"zipCode": "11201",
"createdAt": "2021-04-19T16:39:15.580Z",
"projectName": "Install New Carpet",
"updatedAt": "2021-04-19T16:39:15.580Z",
"id": "Qi2d1Xr2GfkDe1lS"
},
"refinishWoodFloors": {
"cost": {
"range": [1067, 2470],
"avg": 1744,
"min": 550,
"max": 3960
},
"projectType": "refinishWoodFloors",
"zipCode": "11201",
"createdAt": "2021-04-19T16:39:15.525Z",
"projectName": "Refinish Wood Floors",
"updatedAt": "2021-04-19T16:39:15.525Z",
"id": "b2IwjEG5ieE0JgNq"
}
}
The renovation cost API returns pricing data for common renovation projects by zip code.
HTTP Request
Method | Path |
---|---|
POST |
/renovation-cost |
Query Parameters
Parameter | Required | Description |
---|---|---|
zipCode | yes | Zip code of project to be analyzed. |
projectTypes | yes | Array of project type keys to be analyzed. For a list of available project types and their corresponding keys, leverage the /renovation-cost/project-type endpoint below. |
Project Types
curl -X "GET" "https://api.remodelit.ai/renovation-cost/project-types" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json'
Response:
[
{
"key": "refinishWoodFloors",
"name": "Refinish Wood Floors"
},
{
"key": "installNewCarpet",
"name": "Install New Carpet"
},
{
"key": "replaceCarpetWithHardwood",
"name": "Replace Carpet with Hardwood"
},
...
]
The project-types
endpoint returns a list of project types available for analysis.
HTTP Request
Method | Path |
---|---|
POST |
/renovation-cost/project-types |
Query Parameters
N/A
Property Preservation
Predict
curl -X "POST" "https://api.remodelit.ai/guardian/predict" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"url": "https://remodelit-media.imgix.net/2021/11/01/fceae94d-908e-49cf-a0a4-ff18b4fe5965.jpg",
"model": "streetSigns"
}'
Response (accepted):
{
"result": [
[
0.3181952238082886, 0.4270417392253876, 0.6492163658142089,
0.5270580649375916, 0.8875733017921448
]
]
}
Response (rejected):
{
"result": []
}
The property-preservation
endpoint analyzes standard images taken by property preservation inspectors and verifies that the submitted photos contain the desired object.
Objects include: street signs, house numbers, vacancy forms, and gps units.
If the image submitted is rejected, an empty array is returned. If the image is accepted, an array of 5 or 6 element subarrays is returned, one subarray for each object detected in the image. The 6 values in the subarrays are:
[x, y, xx, yy, probability, class]
Value | Description |
---|---|
x | The x-coordinate (percentage) of the top-left corner of the bounding box |
y | The y-coordinate (percentage) of the top-left corner of the bounding box |
xx | The x-coordinate (percentage) of the bottom-right corner of the bounding box |
yy | The y-coordinate (percentage) of the bottom-right corner of the bounding box |
probabilty | The confidence of the prediction |
class | Class name of detected object if using 'multiObjectDetection' model. Values: 'forms', 'gps', 'housenumbers' 'streetsigns', 'boarding', 'forsalesign', 'lockbox' |
HTTP Request
Method | Path |
---|---|
POST |
/guardian/predict |
Query Parameters
Parameter | Required | Description |
---|---|---|
url | yes | Url of image to be analyzed. |
model | yes | The model to be used to analyze the submitted image. Options include: gps , streetSigns , houseNumbers , vacancyForms , and multiObjectDetection |
Batch Predict
Step 1: Post image(s)
curl -X "POST" "https://api.remodelit.ai/guardian/predict/batch" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json' \
-d $'{
"model": "multiObjectDetection",
"urls": [
"https://remodelit-media.imgix.net/2021/11/01/fceae94d-908e-49cf-a0a4-ff18b4fe5965.jpg",
"https://remodelit-media.imgix.net/2021/11/02/d7deb430-8430-4753-ad8b-4a9a1df21b90.jpg"
]
}'
Response:
{
"images": [
{
"status": "pending",
"url": "https://remodelit-media.imgix.net/2021/11/02/d7deb430-8430-4753-ad8b-4a9a1df21b90.jpg",
"id": "34YuiaaXciXvUP02",
"model": "multiObjectDetection"
},
{
"status": "pending",
"url": "https://remodelit-media.imgix.net/2021/11/01/fceae94d-908e-49cf-a0a4-ff18b4fe5965.jpg",
"id": "YoomDWWuAoXUeP0B",
"model": "multiObjectDetection"
}
]
}
HTTP Request
Method | Path |
---|---|
POST |
guardian/predict/batch |
Query Parameters
Parameter | Required | Description |
---|---|---|
model | yes | name of the model to run against |
urls | yes | array of the urls to run model on |
Step 2: Get prediction results by image ID (returned in Step 1 response)
curl -X "GET" "https://api.remodelit.ai/guardian/predict/YoomDWWuAoXUeP0B" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json'
Response:
{
"status": "complete",
"id": "YoomDWWuAoXUeP0B",
"url": "https://remodelit-media.imgix.net/2021/11/01/fceae94d-908e-49cf-a0a4-ff18b4fe5965.jpg",
"model": "multiObjectDetection",
"result": [
[
0.3181952238082886, 0.4270417392253876, 0.6492163658142089,
0.5270580649375916, 0.8875733017921448, "streetsigns"
]
]
}
This will generate a record for each image and run the model against each asynchronously. GET /predict/{id} endpoint to receive the results.
HTTP Request
Method | Path |
---|---|
GET |
guardian/predict/{id} |
Query Parameters
Parameter | Required | Description |
---|---|---|
id | yes | id of the image to look up |
Media Upload
Upload
curl -X "POST" "https://api.remodelit.ai/media/upload" \
-H 'authorization: bearer {api_key}' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"contentType": "image/jpeg",
"extension": "jpg"
}'
Response:
{
"key": "2021/11/02/d7deb430-8430-4753-ad8b-4a9a1df21b90.jpg",
"bucket": "remodelit-media",
"uploadUrl": "https://remodelit-media.s3-accelerate.amazonaws.com/2021/11/02/d7deb430-8430-4753-ad8b-4a9a1df21b90.jpg?AWSAccessKeyId=AKIAWONLJKP23MP7SYGD&Cache-Control=public%2C%20max-age%3D31536000&Content-Type=image%2Fjpeg&Expires=1636411336&Signature=eRtZqL6b2iVmM25eMGd9tLZ4R6U%3D&x-amz-acl=public-read",
"downloadUrl": "https://remodelit-media.imgix.net/2021/11/02/d7deb430-8430-4753-ad8b-4a9a1df21b90.jpg"
}
The media/upload
endpoint can be used to request an upload URL for uploading various types of media files. Using the uploadUrl
provided in the response, you can upload an image or video file with a PUT
http request. This file can then be accessed at the downloadUrl
also provided in the response from media/upload
, which will not expire if you did not provide an api-key.
If using the media/upload
endpoint with an api-key, the downloadUrl
provided will be a temporary presigned url that expires in one hour and the image will be stored in a private S3 bucket
HTTP Request
Method | Path |
---|---|
POST |
/media-upload |
Query Parameters
Parameter | Required | Description |
---|---|---|
contentType | yes | Content type of the media file being submitted. |
extension | no | Extension to be applied to the downloadURL returned in the response (example: "jpg") |
Errors
The Foxy AI API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request -- Your request is invalid. |
401 | Unauthorized -- Your API key is wrong. |
403 | Forbidden -- The endpoint requested is hidden for administrators only. |
404 | Not Found -- The specified endpoint could not be found. |
405 | Method Not Allowed -- You tried to access an endpoint with an invalid method. |
406 | Not Acceptable -- You requested a format that isn't json. |
410 | Gone -- The endpoint requested has been removed from our servers. |
429 | Too Many Requests -- You're making too many requests! Slow down! |
500 | Internal Server Error -- We had a problem with our server. Try again later. |
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |