How to get list of samples for downloadable product Magento 2?

You can retrieve the list of samples for the downloadable products in Magento 2 Programmatically by item SKU.

Samples Contain the information for the product which is downloadable with Sample title, Uploaded file or file URL. You can attach multiple samples for the single product from the Magento backend, product section with Downloadable Information Tab.

Used Interface Magento\Downloadable\Api\SampleRepositoryInterface with getList($sku) method to fetch all the samples from the product,

Call from the template or any PHP class,

samples downloadable product
Downloadable product Samples

Product SKU 240-LV09 has multiple Sample attachment in Native Magento Sample Data. You can explore that item from the admin panel to see more details.

Output with Magento Native Sample Data: \Magento\Downloadable\Api\Data\SampleInterface[]

If you are searching for the links instead of samples click the link, Get all downloadable links details from the Downloadable Product.