I would like to add to davemac's answer to complete it.
You would have to programmatically insert post with wp_insert_post() and save the post id that will be returned by the function.
You would then run media_sideload_image() to download the image from the url to the wp site, save the returned value as a variable, which is html element of the image eg <img src="http:mywpsite/wp-content/....">
.
Strip the variable so youre only left with the src eg http:mywpsite/wp-content/....
and use this for attachment_url_to_postid() which will return the attachment id.
With this, we have all the necessary components to meet our objective. Now use the post id and the attachment id to set the featured images using set_post_thumbnail()
That's it!
The code would look a bit like
$post_id = wp_insert_post($array);//create new post and save its id
$img = media_sideload_image( $url, $post_id);//download image to wpsite from url
$img = explode("'",$img)[1];// extract http.... from <img src'http...'>
$attId = attachment_url_to_postid($img);//get id of downloaded image
set_post_thumbnail( $post_id, $attId );//set the given image as featured image for the post