Load a view block into a custom page generated in a module Is it possible to programatically insert an existing view into a block generated by a custom module and pass it a parameter?

I am generating a block based on some external api data. I have been asked to add a view that pulls in related content from the website. To do this I would like pass a view to my block and pass it a parameter I extract from the api data.

Can this be done, and if so... how?
Just like in D7, using views_embed_view.

print views_embed_view('view_name','machine_name', $parameter);


In case you are wondering, this is the machine_name

Example: 

$parameter = 1;
print views_embed_view('hello_world','block_1', $parameter);