← Back to the manual

KU Leuven Proxy Setup

Automatic import of name, credits, semester and contact hours from KU Leuven ECTS sheets.

The Study Load Planner runs entirely in your browser. For privacy and security reasons a browser app may not read the KU Leuven site directly (CORS), and KU Leuven additionally blocks non-browser requests. This small, free Cloudflare Worker fetches the course sheets server-side, extracts the data, and hands it back to the app.

Cloudflare's free plan (100,000 requests/day) is far more than enough.

1. Create the Worker (no command line)

  1. Create a free account at dash.cloudflare.com.
  2. Left menu → Workers & PagesCreateCreate Worker.
  3. Give it a name, e.g. kul-proxy, and click Deploy.
  4. Click Edit code. Delete the sample code, paste the full contents of kuleuven-proxy-worker.js, and click Deploy (top right).
  5. Your Worker URL now appears at the top, e.g. https://kul-proxy.<yourname>.workers.dev. Copy it.

2. Connect it to the app

  1. Open the Study Load Planner, tab 1 · Vakken.
  2. Paste the Worker URL into the Proxy-URL field (it is remembered).
  3. Test right away: paste a course-sheet URL such as https://onderwijsaanbod.kuleuven.be/syllabi/n/L00A2DN.htm and click Ophalen. If the course appears with contact hours, everything works.

3. How to use it

4. Security (recommended)

Near the top of kuleuven-proxy-worker.js you'll find:

const ALLOW_ORIGIN = "*"; // → set to "https://bunka.be" for production

Set this to your own domain so only your site may use the proxy, then deploy again.

5. If it doesn't work

Technical note

Parsing is validated against a real sheet: from …/syllabi/n/L00A2DN.htm the Worker correctly reads "Natuurkunde en inleiding tot de biomechanica", 6 studiepunten, 52 uren (contact hours) and Eerste semester. The sheet pages are server-side HTML (no separate data API), so extraction uses simple patterns on the HTML. If KU Leuven changes the layout of those pages, the Worker may need a small update.