Using The API
This page describes the API for interacting with QMK Compiler. If you are an application developer you can use this API to compile firmware for any QMK Keyboard.
Overview
This service is an asynchronous API for compiling custom keymaps. You POST some JSON to the API, periodically check the status, and when your firmware has finished compiling you can download the resulting firmware and (if desired) source code for that firmware.
Example JSON Payload:
As you can see the payload describes all aspects of a keyboard necessary to create and generate a firmware. Each layer is a single list of QMK keycodes the same length as the keyboard's LAYOUT
macro. If a keyboard supports mulitple LAYOUT
macros you can specify which macro to use.
Submitting a Compile Job
To compile your keymap into a firmware simply POST your JSON to the /v1/compile
endpoint. In the following example we've placed the JSON payload into a file named json_data
.
Checking The Status
After submitting your keymap you can check the status using a simple HTTP GET call:
This shows us that the job has made it through the queue and is currently running. There are 5 possible statuses:
failed: Something about the compiling service has broken.
finished: The compilation is complete and you should check
result
to see the results.queued: The keymap is waiting for a compilation server to become available.
running: The compilation is in progress and should be complete soon.
unknown: A serious error has occurred and you should file a bug.
Downloading The Results
When your job has completed and the compilation was successful you can download your new firmware. To download only the .hex file for flashing append "hex" to your URL:
If you'd like to download the source code as well as the hex you can append "source" instead:
Last updated