Loading…

Developer Docs — Embed a 360° Panorama or Call the API

Drop an interactive 360° viewer into any page with a single iframe, or drive the platform from your own code: generate equirectangular panoramas, publish them, and read them back as JSON or image bytes. No SDK, and no API key for reads.

Embed a 360° Panorama with One iframe

Load https://360panoramaviewer.com/?embed=true&pano=https://example.com/my-panorama.jpg#embed inside an iframe. The page switches to full-viewport viewer mode, so the frame shows the scene only.

  • embed=true — full-viewport viewer mode with a small branding badge.
  • pano — public HTTPS URL of the 2:1 equirectangular image.
  • autorotate=1 — slow automatic camera rotation until the visitor drags.
  • #embed — hash form of the embed switch for hosts that strip query strings.

REST API Endpoints

  • GET /api/health — service, database and payment gateway status.
  • GET /api/billing — public plan configuration and trial credits.
  • GET /api/models — available image models with API keys stripped.
  • GET /api/user/auth-config — registration availability and public Turnstile site key.
  • POST /api/generate — generate a 2:1 equirectangular panorama from a prompt.
  • GET /api/shares?public=1 — listed panoramas only, newest first, no auth.
  • GET /api/shares/{id}/image — panorama bytes, usable as a texture or embed source.
  • POST /api/shares — publish a panorama with a bearer token (PNG or JPEG body).

Authentication and Limits

Read-only endpoints need no credentials and send Access-Control-Allow-Origin: *. Private calls use an Authorization: Bearer session token from the auth endpoint. Guests cannot generate images. Free AI generation requires a registered account with a verified email. Share reads are rate limited per hour and per day, publishing is limited to a few new links per day with a 100 MB personal quota, and generation is limited by daily credits.

AI Agents and MCP Tools

Every endpoint is ordinary JSON over HTTPS, so an agent or a self-hosted MCP server can call /api/generate to create a scene and then pass /api/shares/{id}/image to other tools as a plain image URL.

Frequently Asked Developer Questions

Does the embed viewer support cross-origin embedding?

Yes. The embed viewer allows embedding via iframes on any external domain or blog without X-Frame-Options blocking. All assets and textures are loaded with permissive CORS headers.

Do I need an API key to read public panoramas or use the viewer?

No. All public share reads, viewer embeds, and health checks are open and require no API key or developer registration.

What response formats are returned by the REST endpoints?

Standard JSON for metadata and configuration endpoints, and raw image/png or image/jpeg binary streams for panorama textures and snapshot downloads.

Quick Embed & API Code Examples

Embed an interactive 360 panorama viewer on any HTML website, WordPress blog, or Webflow project with a single responsive iframe line:

<iframe src="https://360panoramaviewer.com/?embed=true&pano=https://yoursite.com/equirectangular.jpg&autorotate=1" width="100%" height="500" frameborder="0" allow="fullscreen; xr-spatial-tracking" allowfullscreen></iframe>

Fetch public community panoramas programmatically using standard cURL or JavaScript Fetch:

curl -s https://360panoramaviewer.com/api/shares?public=1 | jq .

Related 360° Panorama Developer Tools

Skybox tutorial: sample files, Three.js and Unity — Download the orientation PNG and six-face ZIP, then follow the engine setup steps.