Capturing Data on Multistep form to send to an API
You should write a custom WebformHandler that adds the return API data to $form_state and then alters the form elements as needed. There are some blog post available about writing webform handlers.

Here is how to get the current page from the $form_state.

/** @var \Drupal\webform\WebformSubmissionForm $form_object */
$form_object = $form_state-&gt;getFormObject();
$current_page = $form_state-&gt;get('current_page');