{"openapi":"3.1.0","info":{"title":"Grade Calculator API","version":"1.0.0","description":"Single-course grade maths as an API, computed locally and deterministically — the everyday \"what do I need on the final\" student calculations. The needed endpoint works out the score required on the final exam (or any remaining component) to reach a target overall grade, from the current grade and the weight the final carries, and flags whether the target is achievable or already secured. The projected endpoint gives the overall grade you would finish with for a hypothetical final score. The average endpoint computes the weighted average of graded components from a simple score:weight list (such as 90:40,80:60), and reports the total and remaining weight so you can see how much of the course is still ungraded. Percentages run 0–100 and weights accept either a percentage (30) or a fraction (0.3). Everything is computed locally and deterministically, so it is instant and private. Ideal for student and study apps, learning-management tools, and tutoring and education sites. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is single-course grade mechanics; for a multi-course grade-point average from credit hours use a GPA API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/gradecalc-api","description":"oanor gateway"}],"tags":[{"name":"Grades"},{"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/average":{"get":{"operationId":"get_v1_average","tags":["Grades"],"summary":"Weighted component average","description":"","parameters":[{"name":"components","in":"query","required":true,"description":"score:weight list","schema":{"type":"string"},"example":"90:40,80:60"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Weighted average = Σ(score × weight) ÷ Σ(weight). If weights sum to under 100, the remaining weight is what is still ungraded.","input":{"components":[{"score":90,"weight":40},{"score":80,"weight":60}]},"weighted_average":84,"total_weight_percent":100,"remaining_weight_percent":0},"meta":{"timestamp":"2026-06-04T01:59:15.491Z","request_id":"9df5e408-b91e-4497-bda8-ab1105edc020"},"status":"ok","message":"Weighted component average","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/needed":{"get":{"operationId":"get_v1_needed","tags":["Grades"],"summary":"Score needed on the final","description":"","parameters":[{"name":"current_grade","in":"query","required":true,"description":"Current grade %","schema":{"type":"string"},"example":"85"},{"name":"final_weight","in":"query","required":true,"description":"Final weight (% or fraction)","schema":{"type":"string"},"example":"30"},{"name":"target_grade","in":"query","required":true,"description":"Target overall grade %","schema":{"type":"string"},"example":"88"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Score needed on the final/remaining component to reach the target overall grade.","input":{"target_grade":88,"current_grade":85,"final_weight_percent":30},"achievable":true,"needed_score":95,"already_secured":false},"meta":{"timestamp":"2026-06-04T01:59:15.588Z","request_id":"a2e47af2-83f6-43c2-bfa2-ee5d2d25c580"},"status":"ok","message":"Score needed on final","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/projected":{"get":{"operationId":"get_v1_projected","tags":["Grades"],"summary":"Projected overall grade","description":"","parameters":[{"name":"current_grade","in":"query","required":true,"description":"Current grade %","schema":{"type":"string"},"example":"85"},{"name":"final_weight","in":"query","required":true,"description":"Final weight (% or fraction)","schema":{"type":"string"},"example":"30"},{"name":"final_score","in":"query","required":true,"description":"Hypothetical final score %","schema":{"type":"string"},"example":"95"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Overall = current × (1 − final weight) + final score × final weight.","input":{"final_score":95,"current_grade":85,"final_weight_percent":30},"projected_overall_grade":88},"meta":{"timestamp":"2026-06-04T01:59:15.662Z","request_id":"bfed85b2-a581-4506-a494-5ebf84b28a90"},"status":"ok","message":"Projected overall grade","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":{"note":"Percentages 0–100; weights accept percent (30) or fraction (0.3). For multi-course GPA from credit hours, use a GPA API.","service":"gradecalc","endpoints":{"/v1/needed":"Score needed on the final/remaining work to reach a target overall grade.","/v1/average":"Weighted average of graded components (score:weight list).","/v1/projected":"Projected overall grade for a hypothetical final score."},"description":"Single-course grade maths: score needed on the final for a target, projected overall grade, and weighted component average."},"meta":{"timestamp":"2026-06-04T01:59:15.758Z","request_id":"893dfe8e-541f-4ec1-828b-e3f73b6f2c7f"},"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":11935,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":1345,"monthly_call_quota":21550,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":3335,"monthly_call_quota":265500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":7135,"monthly_call_quota":1370000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/gradecalc-api"}