How to create field type that the value load from external API?

I’ve this example

Form example

As you can see from above video, every time a user inputs text, it sends a request to the server to retrieve data from an external URL and return back the response. However, I want to create a field within the docType that provides options or data obtained from an external API. how can i do that?