
GPA Calculator API
Calculate your GPA on the 4.0 scale from letter grades or percentages, weighted by credits, and combine it with your current GPA for a cumulative result.
Send your API key as a Bearer token in the Authorization header (Authorization: Bearer YOUR_API_KEY), or in an X-API-Key header.
120 requests per minute
1 endpoint available
Overview
Works out a credit-weighted GPA: the sum of grade points times credits, divided by the sum of credits. Each course has credits and either a letter grade or a percentage. Add a previous GPA and credits to get a cumulative GPA.
Scale
A+ and A are 4.0, A- 3.7, B+ 3.3, B 3.0, B- 2.7, C+ 2.3, C 2.0, C- 1.7, D+ 1.3, D 1.0, D- 0.7, F 0.0. Set aPlusPoints to 4.3 if your school counts an A+ as 4.3.
Percentages become letters with the common US cut-offs: 97 and up A+, 93 A, 90 A-, 87 B+, 83 B, 80 B-, 77 C+, 73 C, 70 C-, 67 D+, 63 D, 60 D-, below 60 F. A fraction counts toward the band it reaches, so 92.5 is A-.
Notes
- Give each course
letterorpercent, not both. A course with no grade, or with 0 credits, is left out and comes back withcounted: false. term.averagePercentis the credit-weighted average of the courses given as percentages. It isnullwhen none were.priorGpaandpriorCreditsgo together.priorGpacannot be above 4.0 (or 4.3 withaPlusPoints4.3).letternext to a GPA is a rough equivalent, using the midpoint between grade points as the cut-off.- GPA values are rounded to 4 decimal places. Up to 200 courses.
Endpoints
https://opentools.ca/api/v1/tools/gpa-calculatorRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| courses | array | Required | Courses to include, 1 to 200. |
| courses[].name | string | Optional | Course name, used only in the response. |
| courses[].credits | number | Required | Credits or weight, 0 or more. |
| courses[].letter | string Enum: A+, A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F | Optional | Letter grade, A+ to F. |
| courses[].percent | number | Optional | Percentage grade, 0 to 100. Use instead of letter. |
| aPlusPoints | number Enum: 4, 4.3 | Optional | Grade points for an A+.Default: 4 |
| priorGpa | number | Optional | Your GPA before this term. Send with priorCredits. |
| priorCredits | number | Optional | Credits behind priorGpa. Send with priorGpa. |
Response Example
{
"success": true,
"term": {
"gpa": 3.63,
"letter": "A-",
"credits": 10,
"qualityPoints": 36.3,
"coursesCounted": 3,
"averagePercent": 94
},
"cumulative": {
"gpa": 3.3075,
"letter": "B+",
"priorGpa": 3.2,
"priorCredits": 30
},
"courses": [
{
"name": "English",
"credits": 3,
"letter": "A-",
"points": 3.7,
"percent": null,
"counted": true
},
{
"name": "Calculus",
"credits": 4,
"letter": "B+",
"points": 3.3,
"percent": null,
"counted": true
},
{
"name": "Biology",
"credits": 3,
"letter": "A",
"points": 4,
"percent": 94,
"counted": true
}
]
}Error Codes
Code Examples
# Term GPA and cumulative GPA
curl -X POST https://opentools.ca/api/v1/tools/gpa-calculator \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"courses": [
{
"name": "English",
"credits": 3,
"letter": "A-"
},
{
"name": "Calculus",
"credits": 4,
"letter": "B+"
},
{
"name": "Biology",
"credits": 3,
"percent": 94
}
],
"priorGpa": 3.2,
"priorCredits": 30
}'Rather use it in your browser? Open the GPA Calculator