How to load web api result data every 3 sec?

How to load web api json result data every 3 sec ?
I have realtime vehicles Position WebAPI, That api is every 3 sec lat long will update in tat api . so i need to get that latlong and pin in mapkit . How can i work that realtime feed , in the swift any option ?
or we will set api function every 3 sec ?

This is not Swift specific, but perhaps Apple Developer Documentation could help.

thank you @moiseev