How to get data from a private API and add it to wordpress pages

You can fetch data using wp_remote_get().

//API URL
$url="your api url";

// API RESPONSE
$response = wp_remote_get($url, "your headers goes here / use array to set multiple headers.");

you can then access content from $response.

$response['body']; // will give you content.

wrap it with your own function name and add this code in your functions.php file. Call the function from your custom page template file.