Floor Plan Extractor API
Send a floor plan as a PDF or image and get back every door, window and glass wall on it. Each one comes with its position on the page, its type, and the code, size and fire rating printed on the plan.
Base URL:
Each page processed costs 1 credit, so a PDF with 3 pages costs 3 credits. A large drawing sheet takes about 2–3 minutes.
Authentication
Every request needs your API key in the X-API-Key header. Authorization: Bearer <key> is
also accepted. Keep the key on your server and don't put it in browser code.
1. Process a floor plan
Upload the file as multipart/form-data in a field named file. Accepted formats are PDF, PNG, JPEG,
WebP and TIFF, up to 100 MB and 50 pages. The request stays open until every page is done, then returns the result.
| Field | In | Description |
|---|---|---|
file | form | Required. The floor plan. |
pages | form | Optional. PDF pages to process, e.g. 1,3-5. Default: all pages. |
curl -X POST "/v1/extract" \ -H "X-API-Key: YOUR_API_KEY" \ -F "file=@floor-plan.pdf"
import requests
r = requests.post("/v1/extract",
headers={"X-API-Key": "YOUR_API_KEY"},
files={"file": open("floor-plan.pdf", "rb")},
timeout=1800)
r.raise_for_status()
result = r.json()
for page in result["pages"]:
print(page["page"], page["summary"]["door"]["total"], "doors")
// Node 18+
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append("file", new Blob([await readFile("floor-plan.pdf")]), "floor-plan.pdf");
const r = await fetch("/v1/extract", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY" },
body: form,
});
const result = await r.json();
2. Check credits
curl "/v1/credits" -H "X-API-Key: YOUR_API_KEY"
import requests
r = requests.get("/v1/credits", headers={"X-API-Key": "YOUR_API_KEY"})
print(r.json()["credits_remaining"])
const r = await fetch("/v1/credits", { headers: { "X-API-Key": "YOUR_API_KEY" } });
const { credits_remaining } = await r.json();
{
"customer_name": "Acme Ltd",
"credits_remaining": 42,
"credits_per_page": 1
}
Response
POST /v1/extract returns one entry per page. summary has the counts and items lists
every detection.
{
"job_id": "job_7d7208febe9c75aa",
"status": "done",
"filename": "floor-plan.pdf",
"pages_total": 1,
"pages_done": 1,
"credits_charged": 1,
"credits_remaining": 41,
"pages": [
{
"page": 1,
"status": "done",
"width": 12403,
"height": 5263,
"dpi": 150,
"image_url": "/v1/jobs/job_7d7208febe9c75aa/pages/1/image",
"summary": {
"door": { "total": 130, "hinged": 130, "sliding": 0, "folding": 0, "other": 0 },
"window": { "total": 38, "standard": 16, "fixed": 22, "sliding": 0, "tilt": 0,
"casement": 0, "bay_corner": 0, "roof": 0 },
"glass_wall": { "total": 5 }
},
"items": [
{
"id": 12,
"category": "door",
"type": "hinged",
"subtype": "single",
"tag": "D 2P*",
"size_label": "800/1970",
"notes": "EI-S 30 DP3",
"confidence": 0.95,
"code": "D 2",
"handing": "right",
"width_mm": 800,
"height_mm": 1970,
"fire_rating": { "text": "EI-S 30 DP3", "class": "EI", "minutes": 30,
"smoke_control": true, "self_closing": false, "dp_class": "DP3" },
"bbox": [6974, 900, 7225, 1150],
"bbox_norm": [0.56229, 0.17101, 0.58252, 0.21851]
}
]
}
]
}
The page image that bbox refers to is at image_url (send your API key with this request too). It is
scaled down, so use bbox_norm to draw on it.
Item fields
| Field | Description |
|---|---|
id | Number of the item on its page. |
category, type, subtype | What it is; see Categories. |
tag | The door or window tag exactly as printed on the plan, e.g. D 2P*. Empty if there is none. |
code | The type code from the tag without the handing letter, e.g. D 2. Use it to match the item to your door or window schedule. |
handing | right, left or empty, from the P / L after the code. |
size_label | The size exactly as printed, e.g. 800/1970. |
width_mm, height_mm | Width and height read from the size label, in mm. null if not printed. |
fire_rating | Read from the notes, e.g. EI-S,C 30 DP3. class is EI, EW or E. minutes is the
rating. smoke_control is the S flag and self_closing is the C flag. dp_class is DP1–DP3. null if not rated. |
notes | Other text printed on the item, as printed. |
confidence | 0–1. How sure the model is that the item is real and correctly typed. |
bbox | [x1, y1, x2, y2] in pixels of the page (width × height). PDFs are read at 150 dpi. |
bbox_norm | The same box as fractions (0–1) of the page width and height. |
Categories
| Category | Type | Subtypes |
|---|---|---|
door | hinged | single, double, unequal_double |
door | sliding | pocket, surface, multi_panel |
door | folding | bifold |
door | other | revolving, overhead (garage, roller, sectional) |
window | window | standard, fixed, sliding, tilt, casement, bay_corner, roof |
glass_wall | glass_wall | None |
Errors
Errors return JSON like {"detail": "…"}. No credits are taken for a request that fails before processing starts.
If a single page fails during processing, its credit is refunded and that page has "status": "failed".
| Status | Meaning |
|---|---|
401 | Missing or invalid API key. |
402 | Not enough credits for the pages in this file. |
413 | File over 100 MB or more than 50 pages. |
415 | Not a PDF or image. |
422 | The file could not be read, or pages is out of range. |
Large PDFs
?wait=false to the upload and it returns at once
with a job_id. Then call GET /v1/jobs/{job_id} every few seconds. It returns the same response
as above, with page statuses queued, running, done or failed, until
status is done, partial or failed.
AxcelerateAI