{"openapi":"3.1.0","info":{"title":"Fraction API","version":"1.0.0","description":"Exact fraction maths with arbitrary-precision integers — no floating-point rounding. The simplify endpoint reduces any fraction to its lowest terms and returns the decimal value, the mixed-number form (10/4 → 2 1/2) and whether it is a whole number. The calc endpoint adds, subtracts, multiplies or divides two values — given as fractions (1/2), whole numbers, mixed numbers (1 1/2) or decimals (0.5) — and returns the simplified result. The fromdecimal endpoint turns a decimal into a fraction: exactly for terminating decimals, and precisely for repeating decimals written with parentheses, so 0.(3) becomes 1/3 and 0.1(6) becomes 1/6. Because every step uses big integers, results are always exact and very large numerators or denominators are returned as strings rather than losing precision. Ideal for education and maths tools, recipes and unit scaling, engineering and woodworking measurements, finance, and anywhere fractions must stay exact. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is fraction maths; for general expressions use a math-engine API and for prime factorization use a number-theory API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/fraction-api","description":"oanor gateway"}],"tags":[{"name":"Fraction"},{"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/calc":{"get":{"operationId":"get_v1_calc","tags":["Fraction"],"summary":"Fraction arithmetic","description":"","parameters":[{"name":"a","in":"query","required":true,"description":"First value (n/d, integer, mixed or decimal)","schema":{"type":"string"},"example":"1/2"},{"name":"b","in":"query","required":true,"description":"Second value","schema":{"type":"string"},"example":"1/3"},{"name":"op","in":"query","required":true,"description":"add, subtract, multiply or divide","schema":{"type":"string"},"example":"add"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"a":"1/2","b":"1/3","op":"add","result":{"mixed":{"text":"0 5/6","whole":0,"fraction":"5/6"},"decimal":"0.833333333333","fraction":"5/6","is_whole":false,"numerator":5,"denominator":6}},"meta":{"timestamp":"2026-06-03T17:42:20.979Z","request_id":"f56e8d29-11de-4245-8b4f-d1b48214eb7c"},"status":"ok","message":"Fraction arithmetic","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/fromdecimal":{"get":{"operationId":"get_v1_fromdecimal","tags":["Fraction"],"summary":"Decimal to fraction","description":"","parameters":[{"name":"value","in":"query","required":true,"description":"A decimal — 0.75, or repeating like 0.1(6)","schema":{"type":"string"},"example":"0.75"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mixed":{"text":"0 3/4","whole":0,"fraction":"3/4"},"value":"0.75","decimal":"0.75","fraction":"3/4","is_whole":false,"numerator":3,"denominator":4},"meta":{"timestamp":"2026-06-03T17:42:21.086Z","request_id":"b955a172-ef54-49af-bac3-fdba24fb91ae"},"status":"ok","message":"Decimal to fraction","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/simplify":{"get":{"operationId":"get_v1_simplify","tags":["Fraction"],"summary":"Simplify a fraction","description":"","parameters":[{"name":"fraction","in":"query","required":false,"description":"A fraction like 6/8","schema":{"type":"string"},"example":"10/4"},{"name":"numerator","in":"query","required":false,"description":"Numerator (integer)","schema":{"type":"string"}},{"name":"denominator","in":"query","required":false,"description":"Denominator (integer)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mixed":{"text":"2 1/2","whole":2,"fraction":"1/2"},"decimal":"2.5","fraction":"5/2","is_whole":false,"numerator":5,"denominator":2},"meta":{"timestamp":"2026-06-03T17:42:21.186Z","request_id":"f33900c0-d4f5-48d5-a8ad-9b4e4529583e"},"status":"ok","message":"Simplify a fraction","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":{"name":"Fraction API","notes":"Repeating decimals use parenthesis notation for the repeating part: 0.(3)=1/3, 0.1(6)=1/6. Values are exact via BigInt; very large numerators/denominators are returned as strings. This is fraction maths — for general expressions use a math-engine API and for prime factorization use a number-theory API. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/simplify","params":{"fraction":"a fraction like 6/8 (or use numerator + denominator)","numerator":"the numerator (integer)","denominator":"the denominator (integer)"},"returns":"the reduced fraction, decimal, mixed number and gcd info"},{"path":"/v1/calc","params":{"a":"first value (n/d, integer, mixed, or decimal)","b":"second value","op":"add, subtract, multiply or divide"},"returns":"the simplified result fraction"},{"path":"/v1/fromdecimal","params":{"value":"a decimal — 0.75, or repeating like 0.1(6)"},"returns":"the equivalent fraction"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Exact fraction maths with arbitrary-precision integers. The simplify endpoint reduces a fraction to lowest terms and returns its decimal value, mixed-number form and whether it is whole. The calc endpoint adds, subtracts, multiplies or divides two fractions (or whole numbers, mixed numbers or decimals) and returns the simplified result. The fromdecimal endpoint turns a decimal into a fraction — exactly for terminating decimals, and precisely for repeating decimals written with parentheses (0.1(6) → 1/6). Inputs may be n/d, an integer, a mixed number like '1 1/2', or a decimal. Pure local, no key."},"meta":{"timestamp":"2026-06-03T17:42:21.280Z","request_id":"89e90731-71cb-4f0a-83f4-8056576a6ef7"},"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":4435,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":595,"monthly_call_quota":13950,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2585,"monthly_call_quota":190500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6385,"monthly_call_quota":995000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/fraction-api"}