TRAFIKVERKET EARLIEST LICENCE-TEST FINDER
Version 2 — 9 September 2026

GET STARTED
1. Open START-HERE.html in a desktop browser (for example Chrome or Edge).
2. Follow the instructions to drag “Find licence tests” onto your bookmarks bar.
3. Sign in at https://fp.trafikverket.se/Boka/ using your own account.
4. Click the bookmark and enter your own 12-digit personal number.
5. Choose theory/knowledge test and language, or driving test and transmission.
6. Start the search.

UPDATING FROM VERSION 1
Remove the old bookmark and add the new one from this START-HERE.html.
Existing bookmarks do not update automatically.

SHARE WITH OTHERS
Share this ZIP or just START-HERE.html. That HTML file includes everything
needed to install the bookmark and can be opened offline.
No personal number, cookies, or account details are embedded in these files.

COOKIES
The tested API requires authentication. Sending the same valid search without
Cookie produced HTTP 400 with type LoginRequiredException. An empty personal
number was also rejected. The helper uses the user's current browser login;
it never asks users to copy cookies. If a session expires, sign in again.
This does not mean every analytics cookie is required; the helper simply lets
the browser handle the existing first-party login cookies.

WHAT IT DOES
- Selects B theory/knowledge test (Kunskapsprov) or driving test (Körprov).
- For theory: choose a language; the API validates its availability.
- For driving: choose a Trafikverket automatic or manual car.
- Matches the locations to the selected test type and language.
- Uses the API's current “as soon as possible” start date.
- Discovers locations rather than using a fixed list.
- Searches up to four locations per request, respecting the returned limit.
- Continues searching empty locations using the returned searchedMonths
  cursor, up to the API's search-period limit (currently 12 months).
- Shows the earliest returned future appointment for each location.
- Displays incomplete, stopped, and no-result locations separately.
- Stops for login errors, rate limits, unexpected responses, and timeouts.
- Saves a JSON results file without personal numbers or cookies.
- Makes no reservations, bookings, cancellations, or payments.

FILES
START-HERE.html       Self-contained setup and instructions; share this alone.
earliest-tests.js    Readable source of the bookmark script.
bookmarklet-url.txt   The entire bookmark URL for manual installation.
README.txt           These instructions.

LIMITS AND VALIDATION
Availability is a snapshot and may change. A successful search is not a
booking or a guarantee of eligibility. No results means none returned within
the search period and selected settings.

Driving-test API searches and theory search settings were verified directly
against Trafikverket. The live theory availability check returned an expired
login; that end-to-end flow remains unverified. The browser
helper was tested with simulated responses for grouping, pagination, earliest
sorting, theory selection, language filtering, matching locations, switching
back to driving, expired login, rate limits, rejected input, stopping, and export
privacy. This package has not been run end-to-end in a signed-in browser.
It uses the website's undocumented API, which may change. Some managed
browsers disable bookmark scripts. Installation is intended for desktop use.

The source only contacts same-origin /Boka/search-information and
/Boka/occasion-bundles. Personal numbers are held in memory while the panel
is open and sent to Trafikverket; they are not written to browser storage,
logged, or included in exported results. Browser cookies remain managed by
the browser. No third-party libraries, remote scripts, or trackers are loaded.
