Every semester, students ask the same question: how many more classes can I miss? The arithmetic is easy. The hard part is the rule itself. Is it 75%, 80% or 85%? Counted per course or overall? Is there condonation, and how much?
Those answers live in PDF regulations scattered across university websites, and they differ more than most people expect. VTU needs 85% per course. Delhi University needs two-thirds. FAST-NUCES formally expects 100% with up to 20% condonable by the Head of Department.
I maintain attendancecalculator.org, where each university page is checked against the official regulation and links to it. I've now opened that data as a small, free API, so anyone building a student app, a Discord bot or a college portal can use it.
What's in it
- 26 universities in India, Pakistan and Malaysia
- For each: minimum attendance %, whether it's counted per course or in aggregate, what happens below the line, condonation rules, tiers where they exist, and a link to the official source with a
lastCheckeddate - A calculation endpoint that returns the current percentage and either how many classes you can still miss or how many you must attend in a row
No API key, HTTPS, CORS enabled, JSON. Responses are cached for an hour. Data is CC BY 4.0.
Endpoints
GET https://attendancecalculator.org/api/v1/universities GET https://attendancecalculator.org/api/v1/universities?country=Pakistan GET https://attendancecalculator.org/api/v1/universities/vtu-attendance-calculator GET https://attendancecalculator.org/api/v1/calculate?held=40&attended=28&target=75 Calculate
curl "https://attendancecalculator.org/api/v1/calculate?held=40&attended=28&target=75" { "input": { "held": 40, "attended": 28, "target": 75 }, "currentPercent": 70, "status": "warning", "canStillMiss": 0, "mustAttendInARow": 8, "explanation": "70% now; attend the next 8 classes without missing any to reach 75%." } Why 8 and not 2? 75% of 40 is 30, so it's tempting to say you need 2 more. But every class you attend also adds to the total. After x more classes in a row you have (28 + x) / (40 + x), and that only reaches 0.75 at x = 8.
Invalid input returns HTTP 400 with a readable error, e.g. attended must be an integer from 0 to held.
Use a university's own rule as the target
This is the part that makes the data useful. Instead of hard-coding 75%, pull the real rule:
const BASE = "https://attendancecalculator.org/api/v1"; const get = (p) => fetch(BASE + p).then((r) => r.json()); const vtu = await get("/universities/vtu-attendance-calculator"); const res = await get(`/calculate?held=40&attended=33&target=${vtu.minimumAttendancePercent}`); console.log(`${vtu.shortName} needs ${vtu.minimumAttendancePercent}% ${vtu.basis}`); console.log(res.explanation); // VTU needs 85% per course // 82.5% now; attend the next 7 classes without missing any to reach 85%. Or list every university stricter than 75%, with its source:
import json, urllib.request url = "https://attendancecalculator.org/api/v1/universities" data = json.load(urllib.request.urlopen(url)) for u in data["universities"]: if u["minimumAttendancePercent"] > 75: print(u["shortName"], u["minimumAttendancePercent"], u["basis"], u["source"]["url"]) A few things the data shows
- Per course is the norm. All 12 Pakistani universities in the dataset apply the rule to each course separately. A 90% overall average doesn't protect a single weak subject.
- "75%" isn't universal. VTU, KLU and Christ University use 85%; FAST-NUCES, COMSATS, QAU and TAR UMT use 80%; Delhi University uses 66.67%.
- Condonation varies the most. Some universities have none beyond the built-in buffer; others allow 5–10% on documented grounds, sometimes with a fee.
Examples repo
Working curl, JavaScript (Node 18+, no dependencies) and Python (standard library only) examples:
👉 github.com/attendancecalculator-hub/attendance-api-examples
Full docs: attendancecalculator.org/developers
Caveats
Rules change. Every record carries lastChecked and the official source link, so check the source before relying on a figure for anything important. If you spot an outdated rule, send the official document to support@attendancecalculator.org and I'll update it.
If you'd rather not write code at all, there's also a one-line embeddable calculator for college or club websites.
Feedback on the API shape is welcome in the comments.