https://api.qmk.fm/v1/keyboards
にアクセスするとキーボードのリストが返ってくる。
// コード例
fetch('https://api.qmk.fm/v1/keyboards')
.then(response => {
if (!response.ok) {
throw new Error('Response not success.');
}
return response.text();
})
.then(data => {
// `data` は CSV なので `split(',')` で配列に変換。
const keyboardList = data.split(',');
console.log(keyboardList);
})
.catch(error => console.error('There has been a problem with your fetch operation:', error));
> ["["0_sixty"", ""10bleoledhub"", ""1upkeyboards/1up60hse"", ""1upkeyboards/1up60hte"", ...
コード例2
curl https://api.qmk.fm/v1/keyboards | jq
[
"0_sixty",
"0_sixty/underglow",
...
"zvecr/zv48/f401",
"zvecr/zv48/f411"
]
参考情報