{"openapi":"3.1.0","info":{"title":"Number Theory API","version":"1.0.0","description":"An integer toolkit as an API. Factorize any number into its prime factors with exponents (and a readable 2^3 × 3^2 × 5 form), with the divisor count, the divisor sum, the full list of divisors and whether the number is perfect; find the greatest common divisor and least common multiple of two numbers (and whether they are coprime); and test primality, returning the next and previous prime. Handles numbers up to a trillion. Perfect for maths education and puzzles, cryptography demos, generating test data and any time you need the building blocks of a number. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. A focused integer toolkit, distinct from a general math-expression engine.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/numbertheory-api","description":"oanor gateway"}],"tags":[{"name":"Number Theory"},{"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/factorize":{"get":{"operationId":"get_v1_factorize","tags":["Number Theory"],"summary":"Prime factorization + divisors","description":"","parameters":[{"name":"number","in":"query","required":true,"description":"Integer 1 to 1e12","schema":{"type":"string"},"example":"360"},{"name":"divisors","in":"query","required":false,"description":"false to skip the divisor list","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"number":360,"divisors":[1,2,3,4,5,6,8,9,10,12,15,18,20,24,30,36,40,45,60,72,90,120,180,360],"is_prime":false,"is_perfect":false,"divisor_sum":1170,"divisor_count":24,"factorization":"2^3 × 3^2 × 5","prime_factors":[{"prime":2,"exponent":3},{"prime":3,"exponent":2},{"prime":5,"exponent":1}]},"meta":{"timestamp":"2026-06-03T01:09:40.581Z","request_id":"de0d9194-b95b-4471-a306-d9d2aa583cfc"},"status":"ok","message":"Prime factorization","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/gcd":{"get":{"operationId":"get_v1_gcd","tags":["Number Theory"],"summary":"GCD and LCM","description":"","parameters":[{"name":"a","in":"query","required":true,"description":"First number","schema":{"type":"string"},"example":"48"},{"name":"b","in":"query","required":true,"description":"Second number","schema":{"type":"string"},"example":"180"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"a":48,"b":180,"gcd":12,"lcm":720,"coprime":false},"meta":{"timestamp":"2026-06-03T01:09:40.674Z","request_id":"b3915559-0784-4186-9405-833222dd5a06"},"status":"ok","message":"GCD and LCM","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/is-prime":{"get":{"operationId":"get_v1_is_prime","tags":["Number Theory"],"summary":"Primality test","description":"","parameters":[{"name":"number","in":"query","required":true,"description":"Integer to test","schema":{"type":"string"},"example":"97"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"number":97,"is_prime":true,"next_prime":101,"previous_prime":89},"meta":{"timestamp":"2026-06-03T01:09:40.765Z","request_id":"64ab1eb6-d7ff-4d83-a0bd-6e04e11bd16a"},"status":"ok","message":"Primality test","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":"Number Theory API","notes":"Numbers up to 1e12. The full divisor list is returned only for n ≤ 10,000,000 (count and sum are always given). Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/factorize","params":{"number":"1 to 1e12 (required)","divisors":"false to skip the divisor list"},"returns":"prime factors, divisor count/sum, divisors, is_perfect"},{"path":"/v1/gcd","params":{"a":"required","b":"required"},"returns":"gcd, lcm, whether coprime"},{"path":"/v1/is-prime","params":{"number":"required"},"returns":"is_prime + next and previous prime"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"An integer toolkit: prime factorization with exponents, the divisors of a number (count and sum), greatest common divisor and least common multiple, and primality testing with the next and previous prime. Pure local, no key."},"meta":{"timestamp":"2026-06-03T01:09:40.840Z","request_id":"9e7a3a3a-af02-4108-810e-e36696ae8df4"},"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":1135,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":175,"monthly_call_quota":9750,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2165,"monthly_call_quota":148500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":5965,"monthly_call_quota":785000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/numbertheory-api"}