{"openapi":"3.1.0","info":{"title":"Metal Weight API","version":"1.0.0","description":"Metal stock weight and cost as an API, computed locally and deterministically. The weight endpoint computes the mass of a length of metal stock from its shape, dimensions and material: round bar, square bar, flat bar or plate, sheet, hexagonal bar, round tube or pipe and rectangular (box) tube. It works out the cross-sectional area, multiplies by the length and the material density, and returns the weight per piece and the total for a quantity — in kilograms, pounds, grams and tonnes — along with the volume. Material density is looked up from a built-in table of metals (steel, stainless, aluminium, copper, brass, bronze, lead, zinc, titanium, nickel, gold, silver and more) or you can pass an explicit density. The cost endpoint multiplies that weight by a price per kilogram, pound or tonne to give the material cost per piece and in total. The materials endpoint lists the densities. Dimensions accept millimetres, centimetres, metres, inches or feet. Everything is computed locally and deterministically, so it is instant and private. Ideal for metal fabrication and machine-shop tools, engineering and CAD apps, scrap and stock quoting, and shipping-weight estimates. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is metal stock weight from geometry and density; for beam reactions and deflection use a beam API and for live metal spot prices use a commodities API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/metalweight-api","description":"oanor gateway"}],"tags":[{"name":"Metal"},{"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/cost":{"get":{"operationId":"get_v1_cost","tags":["Metal"],"summary":"Material cost","description":"","parameters":[{"name":"shape","in":"query","required":true,"description":"Stock shape","schema":{"type":"string"},"example":"round_bar"},{"name":"material","in":"query","required":false,"description":"Material","schema":{"type":"string"},"example":"steel"},{"name":"unit","in":"query","required":false,"description":"Dimension unit","schema":{"type":"string"},"example":"mm"},{"name":"length","in":"query","required":true,"description":"Length","schema":{"type":"string"},"example":"1000"},{"name":"diameter","in":"query","required":false,"description":"Diameter (per shape)","schema":{"type":"string"},"example":"50"},{"name":"quantity","in":"query","required":false,"description":"Pieces","schema":{"type":"string"},"example":"1"},{"name":"price_per_kg","in":"query","required":false,"description":"Price per kg","schema":{"type":"string"},"example":"2"},{"name":"price_per_lb","in":"query","required":false,"description":"Or per lb","schema":{"type":"string"}},{"name":"price_per_tonne","in":"query","required":false,"description":"Or per tonne","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"total cost = total weight (kg) × price per kg. Prices in pounds/tonne are converted to per-kg.","shape":"round_bar","material":"steel","quantity":1,"total_cost":30.8269,"price_per_kg":2,"cost_per_piece":30.8269,"total_weight_kg":15.4134},"meta":{"timestamp":"2026-06-04T01:59:10.045Z","request_id":"c586b4ef-9af4-4592-b5b7-54079f31283c"},"status":"ok","message":"Material cost from weight & price","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/materials":{"get":{"operationId":"get_v1_materials","tags":["Metal"],"summary":"Metal density reference","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Typical engineering densities. Pass material=<name> or an explicit density to the weight/cost endpoints.","materials":{"tin":7280,"gold":19320,"lead":11340,"zinc":7140,"brass":8500,"steel":7850,"bronze":8800,"copper":8960,"nickel":8900,"silver":10490,"aluminum":2700,"chromium":7190,"platinum":21450,"titanium":4500,"tungsten":19300,"aluminium":2700,"cast_iron":7200,"magnesium":1740,"wrought_iron":7700,"stainless_steel":8000},"density_unit":"kg/m³"},"meta":{"timestamp":"2026-06-04T01:59:10.145Z","request_id":"cf33f935-2eb8-4d5a-81b3-ecc4d5f0c72c"},"status":"ok","message":"Metal density reference","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/weight":{"get":{"operationId":"get_v1_weight","tags":["Metal"],"summary":"Metal stock weight","description":"","parameters":[{"name":"shape","in":"query","required":true,"description":"round_bar|square_bar|flat_bar|plate|sheet|hex_bar|round_tube|pipe|rect_tube","schema":{"type":"string"},"example":"round_bar"},{"name":"material","in":"query","required":false,"description":"steel|aluminium|copper|… (default steel)","schema":{"type":"string"},"example":"steel"},{"name":"density","in":"query","required":false,"description":"Or explicit density (kg/m³)","schema":{"type":"string"}},{"name":"unit","in":"query","required":false,"description":"mm|cm|m|in|ft (default mm)","schema":{"type":"string"},"example":"mm"},{"name":"length","in":"query","required":true,"description":"Length along the axis","schema":{"type":"string"},"example":"1000"},{"name":"diameter","in":"query","required":false,"description":"Round bar / tube diameter","schema":{"type":"string"},"example":"50"},{"name":"side","in":"query","required":false,"description":"Square bar side","schema":{"type":"string"}},{"name":"width","in":"query","required":false,"description":"Flat/plate/box width","schema":{"type":"string"}},{"name":"height","in":"query","required":false,"description":"Box height","schema":{"type":"string"}},{"name":"thickness","in":"query","required":false,"description":"Flat/plate thickness","schema":{"type":"string"}},{"name":"across_flats","in":"query","required":false,"description":"Hex across-flats","schema":{"type":"string"}},{"name":"outer_diameter","in":"query","required":false,"description":"Tube OD","schema":{"type":"string"}},{"name":"wall_thickness","in":"query","required":false,"description":"Tube/box wall","schema":{"type":"string"}},{"name":"quantity","in":"query","required":false,"description":"Number of pieces","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"mass = cross-section area × length × density. Per-metre weight = weight_per_piece ÷ length_m.","shape":"round_bar","length_m":1,"material":"steel","quantity":1,"total_weight":{"g":15413.4,"kg":15.4134,"lb":33.9808,"tonnes":0.015413},"density_kg_m3":7850,"dimension_unit":"mm","total_volume_m3":0.001963495,"weight_per_piece":{"g":15413.4,"kg":15.4134,"lb":33.9808},"cross_section_area_m2":0.0019635},"meta":{"timestamp":"2026-06-04T01:59:10.241Z","request_id":"631541fa-f0da-4ab0-827c-a20688912ba0"},"status":"ok","message":"Metal stock weight from shape & material","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":"metalweight","note":"Metal weight & cost maths — computed locally and deterministically, no key, no third-party service.","shapes":["round_bar","square_bar","flat_bar","plate","sheet","hex_bar","round_tube","pipe","rect_tube"],"endpoints":["/v1/weight","/v1/cost","/v1/materials","/v1/meta"],"length_units":["mm","cm","m","in","inch","ft"]},"meta":{"timestamp":"2026-06-04T01:59:10.331Z","request_id":"5c7f3fee-090c-4d93-afa4-0e722c1bf1a9"},"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":13335,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1485,"monthly_call_quota":22950,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3475,"monthly_call_quota":279500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7275,"monthly_call_quota":1440000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/metalweight-api"}