Solution:
You can try the pre_post_update action to process your API data before the save, this will work only for updating posts, not creating.
function do_something_before_updating_post($post_id, $post_data) {
// Run your API
}
add_action('pre_post_update', 'do_something_before_updating_post', 10, 2);