Programatically Identify the best Ingest Server

Anybody can help in this? I am looking for a solution in Javascript?