Phone photos in, a walkable 3D house tour out.
One REST API to turn the photos of a house into a 3D tour your clients can walk through from any browser. Add tours to your portal, CRM or app in an afternoon.
The API speaks JSON over HTTPS, uses standard HTTP status codes and sends errors in plain words. Every call is authenticated with your secret key.
https://azerlight.com/v1# 1. One call: photos in walking order POST /v1/tours multipart, photos[] # 2. Point by point, with full control POST /v1/tours create the tour POST /v1/tours/{id}/spots add a point POST .../spots/{id}/photos POST .../spots/{id}/complete POST /v1/tours/{id}/finalize
Quickstart
The fastest way to a tour: send one 360° photo per point, in the order you walk through the house, starting at the front door. You get the tour link back at once and the tour is ready a few minutes later.
- Create an account and copy your API key from your account page.
- Send the photos with
POST /v1/tours. - Wait for
statusto becomeready, by polling the tour or with a webhook. - Share
viewer_url, or embed it on your site. Publish it to remove the preview mark.
Authentication
Send your secret key as a bearer token in the Authorization header of every request. Your key is on your account page, where you can also replace it at any time.
Keep the key on your server. Never put it in a mobile app or in the code of a public web page. A tour can only be read and changed with the key that created it.
A missing or wrong key gets 401 invalid_api_key.
Authorization: Bearer YOUR_API_KEYErrors
Errors always have the same shape: a stable code your program can check, and a message you can show to a person.
| Status | Meaning |
|---|---|
400 | Something in the request is missing or not allowed. |
401 | Missing or wrong API key. |
402 | Publishing needs a plan or more tours left this month. |
404 | The tour or point does not exist, or belongs to another key. |
409 | Not possible right now, for example the tour is still being built. |
413 415 | A photo is too large, or not a photo (JPEG, PNG, HEIC or WebP). |
422 | A field has the wrong type or value. details says which. |
5xx | Our side. Retry with the same Idempotency-Key. |
{"error": {"code": "tour_not_found", "message": "No tour with id tr_8c1d0f2a9b3e."}}Idempotency
Networks fail. To retry POST /v1/tours safely, send an Idempotency-Key header with a unique value (a UUID works). If a tour was already created with that key, you get the same tour back with status 200 instead of a second tour.
Idempotency-Key: 5f0c2b8e-4d1a-4c7e-9a52-1b3f6e0d7a44How a tour is built
A tour is a house. A spot (a point) is one place where the photographer stood and turned around. Spots are linked in walking order, starting at the front door.
Tour status
capturing | Created. You are still adding spots and photos. |
processing | The tour is being built. progress goes from 0 to 100. |
ready | Done. viewer_url shows the tour. |
failed | The tour could not be built. error says why. |
Spot status
waiting_photos | Created, no photos yet. |
uploaded | Photos received. Call complete to check them. |
checking | Quick quality check running (a few seconds). |
ok | Good to go. Walk to the next spot. |
retake | Something is wrong. issues says what, in words you can show. |
{
"id": "spt_41e9a07c2d15",
"status": "retake",
"issues": [
{"code": "spot_too_dark", "level": "retake",
"message": "This spot is too dark. Turn on the lights or open the curtains and retake."}
]
}Webhooks
Give a webhook_url when you create a tour and we POST a JSON event to it when the tour is ready. We retry up to 3 times if your server does not answer with a 2xx.
Every event is signed. The X-Azerlight-Signature header is sha256= followed by the HMAC-SHA256 of the raw body with your signing secret. Compare it before trusting the event. Ask us for your signing secret from the help center.
| Event | When |
|---|---|
tour.ready | The tour is built and viewer_url works. |
{
"event": "tour.ready",
"tour_id": "tr_8c1d0f2a9b3e",
"status": "ready",
"viewer_url": "https://azerlight.com/t/bRN7YxeoT5dt",
"warnings": []
}import crypto from "node:crypto"; function isFromAzerlight(rawBody, header, secret) { const mine = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex"); return header.length === mine.length && crypto.timingSafeEqual(Buffer.from(header), Buffer.from(mine)); }
import hashlib, hmac def is_from_azerlight(raw_body: bytes, header: str, secret: str) -> bool: mine = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(mine, header)
Embed a tour
Every tour lives at its own private, unguessable link. Put it in an iframe to show it on a listing page. On phones, visitors can turn their phone to look around, so keep the allow attribute.
Until the tour is published, it shows a preview mark. Building and previewing tours is free.
<iframe src="https://azerlight.com/t/bRN7YxeoT5dt" width="100%" height="560" style="border:0" allow="fullscreen; accelerometer; gyroscope" allowfullscreen></iframe>