{"openapi":"3.1.0","info":{"title":"Diffraction & Interference API","version":"1.0.0","description":"Wave-optics diffraction and interference as an API, computed locally and deterministically. The double-slit endpoint applies Young's two-slit interference, d·sinθ = m·λ: from a wavelength and the slit separation it returns the angle of the m-th bright fringe and, given the screen distance, the fringe spacing Δy = λ·L/d and the position of any maximum — the classic experiment that proved light is a wave. The grating endpoint handles a diffraction grating, d·sinθ = m·λ with d = 1/lines: from a wavelength and the grating density (lines per millimetre) it gives the diffraction angle of each order and the maximum observable order ⌊d/λ⌋, flagging orders that do not exist. The single-slit endpoint computes single-slit diffraction, a·sinθ = m·λ for the dark fringes (minima), and, given the screen distance, the width of the bright central maximum 2·λ·L/a. Wavelengths may be entered in metres, nanometres or micrometres. Everything is computed locally and deterministically, so it is instant and private. Ideal for physics and optics-education tools, spectroscopy and grating design, laser and photonics apps, and laboratory software. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is wave-optics diffraction; for thin-lens imaging use a lens API and for Snell's-law refraction use a Snell API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/diffraction-api","description":"oanor gateway"}],"tags":[{"name":"Diffraction"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/double-slit":{"get":{"operationId":"get_v1_double_slit","tags":["Diffraction"],"summary":"Young's double-slit interference","description":"","parameters":[{"name":"wavelength_nm","in":"query","required":true,"description":"Wavelength (nm)","schema":{"type":"string"},"example":"500"},{"name":"slit_separation","in":"query","required":true,"description":"Slit separation d (m)","schema":{"type":"string"},"example":"0.0001"},{"name":"screen_distance","in":"query","required":false,"description":"Screen distance L (m)","schema":{"type":"string"},"example":"2"},{"name":"order","in":"query","required":false,"description":"Fringe order m (default 1)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"order":1,"formula":"d·sinθ = m·λ (bright fringes); fringe spacing Δy = λ·L/d.","bright_fringe":{"angle_deg":0.28648,"angle_rad":0.00500002,"sin_theta":0.005},"wavelength_nm":500,"fringe_spacing_m":0.01,"fringe_position_m":0.01,"fringe_spacing_mm":10,"screen_distance_m":2,"slit_separation_m":0.0001},"meta":{"timestamp":"2026-06-04T10:18:46.597Z","request_id":"45d768a8-641c-4bcd-a45e-0f580f799d12"},"status":"ok","message":"Young's double-slit interference","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/grating":{"get":{"operationId":"get_v1_grating","tags":["Diffraction"],"summary":"Diffraction grating","description":"","parameters":[{"name":"wavelength_nm","in":"query","required":true,"description":"Wavelength (nm)","schema":{"type":"string"},"example":"500"},{"name":"lines_per_mm","in":"query","required":false,"description":"Grating density (lines/mm)","schema":{"type":"string"},"example":"600"},{"name":"grating_spacing","in":"query","required":false,"description":"Or spacing d (m)","schema":{"type":"string"}},{"name":"order","in":"query","required":false,"description":"Order m (default 1)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"order":1,"formula":"d·sinθ = m·λ; maximum order m = ⌊d/λ⌋.","diffraction":{"angle_deg":17.457603,"angle_rad":0.30469265,"sin_theta":0.3},"lines_per_mm":600,"maximum_order":3,"wavelength_nm":500,"grating_spacing_m":1.666667e-6,"grating_spacing_nm":1666.6667},"meta":{"timestamp":"2026-06-04T10:18:46.702Z","request_id":"cfd7b840-0f04-4963-8f70-09909127f425"},"status":"ok","message":"Diffraction grating","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/single-slit":{"get":{"operationId":"get_v1_single_slit","tags":["Diffraction"],"summary":"Single-slit diffraction","description":"","parameters":[{"name":"wavelength_nm","in":"query","required":true,"description":"Wavelength (nm)","schema":{"type":"string"},"example":"600"},{"name":"slit_width","in":"query","required":true,"description":"Slit width a (m)","schema":{"type":"string"},"example":"0.00005"},{"name":"screen_distance","in":"query","required":false,"description":"Screen distance L (m)","schema":{"type":"string"},"example":"2"},{"name":"order","in":"query","required":false,"description":"Minimum number m (default 1)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"order":1,"formula":"a·sinθ = m·λ (minima); central-maximum width = 2·λ·L/a.","minimum":{"angle_deg":0.687566,"angle_rad":0.01200029,"sin_theta":0.012},"slit_width_m":5.0e-5,"wavelength_nm":600,"screen_distance_m":2,"central_max_width_m":0.048,"central_max_width_mm":48,"central_max_half_width_m":0.024},"meta":{"timestamp":"2026-06-04T10:18:46.801Z","request_id":"957109a9-acfe-4cf5-9530-8423a7dc160a"},"status":"ok","message":"Single-slit diffraction","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"api":"diffraction","note":"Wave-optics diffraction & interference — computed locally and deterministically, no key, no third-party service.","endpoints":["/v1/double-slit","/v1/grating","/v1/single-slit","/v1/meta"]},"meta":{"timestamp":"2026-06-04T10:18:46.898Z","request_id":"6e51634c-a24d-481c-9372-b2e2b5f0cb9e"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":2000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":25000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":150000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4500,"monthly_call_quota":600000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/diffraction-api"}