# Get File Download URL (/bulk/get)

`GET`    /v2/bulk/get

## Overview

You can obtain a signed URL for downloading a file.\
You can retrieve files in two ways: by specifying the Key obtained from [List of Downloadable Files](/en/spec/bulk-list), or by specifying an endpoint and date combination.

> **Note**
>
> For information on decompression methods and restrictions for CSV files obtained via Bulk API, please see [File Download](/en/spec/bulk).

### Attention

> **Info**
>
> - The obtained URL expires in 5 minutes. Please complete the download within the validity period.
> - The URL is temporary and cannot be reused.
> - Files are compressed in gzip format.
> - Specify either `key` or the combination of `endpoint` and `date`. You cannot specify all three at the same time.

## Retrieve file download URL

`GET` `https://api.jquants.com/v2/bulk/get`

In your request message, either "key" or the combination of "endpoint" and "date" must be specified.

### Parameter and Response

In your request message, either "key" or the combination of "endpoint" and "date" must be specified.\
Combination of parameter in the request and results are as below.

- key: ✓, endpoint: –, date: – → Download URL for the file matching the specified Key

- key: –, endpoint: ✓, date: ✓ → Download URL for the file matching the specified endpoint and date

### Requests

### Headers

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| x-api-key | string | Required | API Key     |

### Query Parameters

> **Note**
>
> Either **key** or **endpoint** + **date** is required.

| Parameter | Type   | Required | Description                                                                                                                                                                          |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| key       | string | Optional | File key (Key obtained from /bulk/list).                                                                                                                                             |
| endpoint  | string | Optional | Endpoint name of the data to retrieve (e.g. /equities/bars/daily). Used in combination with `date`. For a list of available values, please see [here](/en/spec/bulk-list/endpoints). |
| date      | string | Optional | Target date (YYYY-MM, YYYYMM, YYYY-MM-DD, or YYYYMMDD). Used in combination with `endpoint`.                                                                                         |

> **Info**
>
> - By specifying `endpoint` and `date` together, you can get the download URL for the matching file.

### Sample Code

/v2/bulk/get

**cURL**

```bash
curl -G https://api.jquants.com/v2/bulk/get \
-H "x-api-key: {{apiKey}}" \
-d key="{{key}}"
```

**JavaScript**

```javascript
import axios from 'axios'

const client = axios.create({
baseURL: "https://api.jquants.com",
headers: { "x-api-key": "{{apiKey}}" },
})

await client.get("/v2/bulk/get", {
params: {
  key: "{{key}}",
},
})
```

**Python**

```python
import requests

headers = {"x-api-key": "{{apiKey}}"}
resp = requests.get(
  "https://api.jquants.com/v2/bulk/get",
  params={"key": "{{key}}"},
  headers=headers,
)
print(resp.json())
```

### Responses

### Data Item

| Parameter | Type   | Required | Description                  |
| --------- | ------ | -------- | ---------------------------- |
| url       | string | Required | Signed URL for file download |

### Response Sample

```bash {{ title: "200:OK" }}
{
    "url": "https://example.presigned-url.com/..."
}
```
