---
title: "Magento 2: How to Get All Downloadable Links Details from the Downloadable Product Programmatically"
url: "https://magecomp.com/blog/magento-2-get-all-downloadable-links-details-from-the-downloadable-product-programmatically/"
date: "2023-01-23T15:03:01+00:00"
modified: "2025-02-13T12:33:06+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 286
reading_time: "2 min read"
summary: "Hello Magento Friends,"
description: "Get All Downloadable Links Details from the Downloadable Product Programmatically in Magento 2. Check out the solution"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Add Custom Attributes in Laravel Model?"
    url: "https://magecomp.com/blog/add-custom-attributes-in-laravel-model/"
  - title: "How to Display Star Rating into Magento 2 Admin Grid?"
    url: "https://magecomp.com/blog/display-star-rating-into-magento-2-admin-grid/"
  - title: "Magento 2: How to Get Estimated Shipping Methods using REST API?"
    url: "https://magecomp.com/blog/magento-2-get-estimated-shipping-methods-using-rest-api/"
---

# Magento 2: How to Get All Downloadable Links Details from the Downloadable Product Programmatically

_Published: January 23, 2023_  
_Author: Dhiren Vasoya_  

![](https://magecomp.com/blog/wp-content/uploads/2023/01/How-to-Get-All-Downloadable-Links-Details-from-the-Downloadable-Product-Programmatically-in-M2-1024x512.webp)

**Hello Magento Friends,**

In the current tutorial blog, I will explain How to Get All Downloadable Links Details from the Downloadable Product Programmatically in Magento 2.
Downloadable products include e-books, music, video, software, file and more. Customers can download or purchase downloadable products from the product details page. With Magento 2, you can [**create downloadable products**](https://magecomp.com/blog/create-downloadable-product-programmatically-magento-2/) for your store.
[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

The Downloadable Products link details are stored in the database table with information like product_id, download link file, download link URL, number of downloads, link type, etc. To retrieve all downloadable links details from the Downloadable Product in Magento 2, check out the below steps.
## Steps to Get All Downloadable Links Details from the Downloadable Product Programmatically in Magento 2:
**Step 1:** We are getting data in the root script.
Path of file: **magento_root_directory\pub\downloadablelink.php**

Add below code snippet
```
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '5G');
error_reporting(E_ALL);

use MagentoFrameworkAppBootstrap;
use MagentoStoreModelScopeInterface;

require '../app/bootstrap.php';
echo "start";
$bootstrap = Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();
$resource = $objectManager->get('MagentoFrameworkAppResourceConnection');
$connection = $resource->getConnection();
$state = $objectManager->get('MagentoFrameworkAppState');
$state->setAreaCode('frontend');

$sku = 'Downloadable'; //Downloadable item sku

$downloadableProductLink = $objectManager->get('MagentoDownloadableApiLinkRepositoryInterface');
$downloadableLinkdetails = $downloadableProductLink->getList($sku);

foreach ($downloadableLinkdetails as $link)
{
     echo "";
     print_r($link->getData());
     echo "";
}
```

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-1.webp)](https://magecomp.com/services/magento-upgrade-services/)

**Output:**

[![Magento 2 Downloadable Links Details](https://magecomp.com/blog/wp-content/uploads/2023/01/Magento-2-Downloadable-Links-Details.png)](https://magecomp.com/blog/wp-content/uploads/2023/01/Magento-2-Downloadable-Links-Details.png)

## Conclusion:
Accordingly, you can Get All Downloadable Links Details from the Downloadable Product Programmatically in Magento 2. If you have difficulty in the above steps, kindly share them with me through the comment box. Stay abreast for more Magento solutions.
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-3.webp)](https://magecomp.com/magento-malware-removal.html)

**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/magento-2-get-all-downloadable-links-details-from-the-downloadable-product-programmatically/](https://magecomp.com/blog/magento-2-get-all-downloadable-links-details-from-the-downloadable-product-programmatically/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-10-30 23:10:24 UTC_  
