you can fetch the url, then convert it to json and store the result in a x, y variable:
const canvas = document.querySelector("#canvas");
async function drawBox(canvas, url) {
const {x, y} = await fetch(url).then(r => r.json());
const ctx = canvas.getContext('2d');
console.log(x, y);
ctx.fillRect(x, y, 10, 10);
}
drawBox(canvas, 'http://jacek.soc.port.ac.uk/tmp/ws/dyn2')
canvas { border: 1px dotted #000; }
<canvas id="canvas" width="300" height="200"></canvas>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…