{"openapi":"3.1.0","info":{"title":"Earthquake Magnitude API","version":"1.0.0","description":"Earthquake-magnitude seismology as an API, computed locally and deterministically. The energy endpoint computes the radiated seismic energy released by an earthquake of a given magnitude using the Gutenberg-Richter relation, log10(E) = 1.5·M + 4.8 with E in joules, and converts it to a TNT equivalent in tons and kilotons (one ton of TNT ≈ 4.184×10⁹ J), with a felt/damage classification. The compare endpoint quantifies how much bigger one quake is than another: each magnitude unit means about ten times the ground-motion amplitude on a seismograph and about 31.6 times (10^1.5) the energy, so it returns both the amplitude ratio and the energy ratio between two magnitudes. The moment-magnitude endpoint converts between the seismic moment M0 (in newton-metres, M0 = rigidity × rupture area × slip) and the moment magnitude with the Hanks-Kanamori relation Mw = (2/3)·log10(M0) − 6.07, in either direction. Magnitudes are dimensionless, energy is in joules and seismic moment in newton-metres. Everything is computed locally and deterministically, so it is instant and private. Ideal for seismology-education, disaster-modelling, insurance, structural-risk and science app developers, earthquake-energy and magnitude tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is the earthquake-magnitude calculator; for real-time and historical earthquake event feeds use an earthquake data API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/richter-api","description":"oanor gateway"}],"tags":[{"name":"Seismology"},{"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/compare":{"get":{"operationId":"get_v1_compare","tags":["Seismology"],"summary":"Magnitude comparison","description":"","parameters":[{"name":"magnitude1","in":"query","required":true,"description":"First magnitude","schema":{"type":"string"},"example":"7"},{"name":"magnitude2","in":"query","required":true,"description":"Second magnitude","schema":{"type":"string"},"example":"6"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Per magnitude unit: ground-motion amplitude scales ×10 and radiated energy ×10^1.5 ≈ 31.6. Ratios use M1 relative to M2.","inputs":{"magnitude1":7,"magnitude2":6},"summary":"Magnitude 7 shakes the ground 10× as much and releases 31.62× the energy of magnitude 6.","energy_ratio":31.622777,"amplitude_ratio":10,"magnitude_difference":1},"meta":{"timestamp":"2026-06-05T11:30:35.946Z","request_id":"2afe57ec-8a63-45ad-8132-a6f20c68a3df"},"status":"ok","message":"Magnitude comparison","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/energy":{"get":{"operationId":"get_v1_energy","tags":["Seismology"],"summary":"Earthquake energy","description":"","parameters":[{"name":"magnitude","in":"query","required":true,"description":"Magnitude","schema":{"type":"string"},"example":"6"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Radiated seismic energy: log10(E) = 1.5·M + 4.8 (E in joules). One ton of TNT ≈ 4.184×10⁹ J. Each whole magnitude step releases ~31.6× more energy.","inputs":{"magnitude":6},"log10_energy":13.8,"energy_joules":63095734448019.43,"classification":"strong (damage in populated areas)","tnt_equivalent_tons":15080.2425,"tnt_equivalent_kilotons":15.080242},"meta":{"timestamp":"2026-06-05T11:30:36.048Z","request_id":"ed4e2c78-3757-4631-9251-685ba6d11448"},"status":"ok","message":"Earthquake energy","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/moment-magnitude":{"get":{"operationId":"get_v1_moment_magnitude","tags":["Seismology"],"summary":"Moment magnitude","description":"","parameters":[{"name":"seismic_moment","in":"query","required":false,"description":"Seismic moment M0 (N·m)","schema":{"type":"string"},"example":"1e19"},{"name":"moment_magnitude","in":"query","required":false,"description":"Or moment magnitude Mw","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Hanks-Kanamori: Mw = (2/3)·log10(M0) − 6.07, with the seismic moment M0 in newton-metres (M0 = μ·A·d: rigidity × rupture area × slip).","inputs":{"seismic_moment_nm":1.0e+19},"classification":"strong (damage in populated areas)","moment_magnitude":6.5967},"meta":{"timestamp":"2026-06-05T11:30:36.156Z","request_id":"70985fa7-6378-4a22-ac8a-122c44da7ce3"},"status":"ok","message":"Moment magnitude","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":{"notes":"Magnitudes are dimensionless; energy in joules; seismic moment M0 in newton-metres. One ton of TNT ≈ 4.184×10⁹ J.","service":"richter-api","formulae":{"energy":"log10(E) = 1.5·M + 4.8  (joules)","energy_ratio":"10^(1.5·(M1 − M2))","amplitude_ratio":"10^(M1 − M2)","moment_magnitude":"Mw = (2/3)·log10(M0) − 6.07"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/energy":"Radiated energy, TNT equivalent and classification from a magnitude.","GET /v1/compare":"Amplitude and energy ratios between two magnitudes.","GET /v1/moment-magnitude":"Moment magnitude Mw from seismic moment M0 (or the inverse)."},"description":"Seismology calculator: earthquake radiated energy and TNT equivalent from magnitude, magnitude comparison (amplitude and energy ratios) and moment magnitude from the seismic moment."},"meta":{"timestamp":"2026-06-05T11:30:36.268Z","request_id":"95e34a43-5602-4219-8103-5ba858c52de5"},"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":3500,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":34000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1400,"monthly_call_quota":215000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4400,"monthly_call_quota":1280000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/richter-api"}