---
metadata:
  - name: generator
    content: Diplodoc Platform v5.44.0
alternate:
  - https://yandex.com/dev/disk-api/doc/en/reference/content.md
  - https://yandex.com/dev/disk-api/doc/ru/reference/content.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/disk-api/doc/en/llms.txt

# Downloading a file from Yandex Disk

To download a file from Yandex Disk:

1. [Request a download URL.](#url-request)
1. [Download the file](#response-upload) from the address, using the same [OAuth token](https://yandex.com/dev/disk-api/doc/en/concepts/quickstart.md#oauth) as in the original request.


## Download URL request {#url-request}
To get a direct download URL, send the current file path on Yandex Disk to the API.
### Request format {#request}

Use the GET method to send a request for a download URL.
```
https://cloud-api.yandex.net/v1/disk/resources/download
 ? [path](*popup-path)=<path to the file being downloaded>
 & [[fields](*popup-fields)=<properties to include in the response>]
```

path[*](*popup-a)
: The path to the file being downloaded. For example, `%2Fbar%2Fphoto.png`. <br>
  
  <!-- source: en/_includes/reference/parameters-warehouse/id-format/path-encoding.md -->
  The path in the parameter value should be encoded in URL format.
  <!-- endsource: en/_includes/reference/parameters-warehouse/id-format/path-encoding.md -->


fields
: List of JSON properties to include in the response. Keys not specified in this list are omitted when generating a response. If the parameter isn't specified, the response is returned in full without omitting anything. <br>
Key names should be separated by commas, and embedded keys should be separated by dots. For example: `name,_embedded.items.path`.


\* Required parameter.

### Response format {#response}

If the request is processed without errors, the API returns the `200 OK` code. The [Link](https://yandex.com/dev/disk-api/doc/en/reference/response-objects.md#link) object in the response body contains the URL generated to download the file. The URL has a limited lifetime.

<!-- source: en/_includes/reference/response-error.md -->
If the request caused an error, the relevant response code is returned, and the response body contains an [error description](https://yandex.com/dev/disk-api/doc/en/reference/response-objects.md#error).
<!-- endsource: en/_includes/reference/response-error.md -->

Sample response:

```json
{
  "href": "https://downloader.dst.yandex.ru/disk/...",
  "method": "GET",
  "templated": false
}
```

<!-- source: en/_includes/reference/response-objects/id-link/link-table.md -->


#|
|| **Element** | **Description**||
|| `href` | URL. It may be a URL template. See the `templated` key. ||
|| `method` | The HTTP method for requesting the URL from the `href` key. ||
|| `templated` | Indicates a URL template according to [RFC 6570](http://tools.ietf.org/html/rfc6570). Possible values:

- "true" — URL template. To send a request to this address, replace the placeholder values in the curly brackets with the parameter values.
- "false" — The URL can be requested without changes.||
   |#
<!-- endsource: en/_includes/reference/response-objects/id-link/link-table.md -->


## Downloading a file from a given URL {#response-upload}

Use the GET method to download the file:

```no-highlight
https://downloader.dst.yandex.ru/disk/53139aa0et584d3bac7eeab405d3574b/535320b4/YyjTJtEHob8R5WbpojJbiiUuU2HC_2JSTU0gW9qE0NHGW2uncmBjM_-IXun3Msyij96FTHQGSX-fDL-XwokDvA%3D%3D?uid=202727674&filename=photo.png&disposition=attachment&hash=&limit=0&content_type=application%2Fx-www-form-urlencoded&fsize=34524&hid=93528043563b8r55723a253f4730290a&media_type=document
```

If the request is processed without errors, the API returns the `200 OK` code.

[*popup-path]: The path to the file being downloaded. For example, `%2Fbar%2Fphoto.png`. <br>
  
  
The path in the parameter value should be encoded in URL format.

[*popup-fields]: List of JSON properties to include in the response. Keys not specified in this list are omitted when generating a response. If the parameter isn't specified, the response is returned in full without omitting anything. <br>
Key names should be separated by commas, and embedded keys should be separated by dots. For example: `name,_embedded.items.path`.

[*popup-a]: Required parameter.