@<1523703961872240640:profile|CrookedWalrus33> , you can use the UI as reference. Open dev tools (F12) and see the network (filter by XHR).
For example, in scalars/plots/debug samples tabs the relevant calls seem to be:
events.get_task_single_value_metrics
events.scalar_metrics_iter_histogram
events.get_task_plots
events.get_task_metrics