Accepted answer

There is nothing different (as a function I mean) in d3.json() or the other D3 fetch functions. You can put it inside a setInterval or, since this is a D3 code, inside a d3.interval.

Here is a simple demo, instead of your API I'm using an API that generates random values, so you can see that it works:

d3.interval(getData, 5000);

function getData() {
  d3.json("").then(function(data) {
<script src=""></script>

I'm calling the function the regular way the first time, otherwise it would be called only after 5 seconds. Regarding the delay, if it's called just once, you can use setTimeout (or d3.timeout).

Related Query

More Query from same tag