Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

Post IDs in a category

Retrieve all post IDs as an array:
$post_ids = $query->posts;

// WP_Query arguments
$args = array (
	'category_name'          => 'a-category-slug-here',
	'posts_per_page'         => '-1',
);

// The Query
$query = new WP_Query( $args );