# TDnet/適時開示ファイル取得(/td/files)

`GET`    /v2/td/files

## APIの概要

開示番号（discNo）に対応するファイルのダウンロードURLを取得できます。\
取得したURLを使用してPDFやXBRLファイルをダウンロードできます。URLの有効期限は15分です。

### 本APIの留意点

> **Info**
>
> - 本APIはTDnet/適時開示情報アドオンが必要です。
> - データ取得可能期間は過去5年間です。
> - ダウンロードURLの有効期限は15分です。

## 適時開示ファイルのダウンロードURLを取得します

`GET` `https://api.jquants.com/v2/td/files`

### Requests

### Headers

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| x-api-key | string | Required | APIキー       |

### Query Parameters

| Parameter | Type   | Required | Description                                                                                    |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------- |
| discNo    | string | Required | 開示番号（14桁）（e.g. 20250401130100）                                                                 |
| docs      | string | Optional | 取得するファイルの種類（カンマ区切りで複数指定可能） g: 全文情報PDF、s: サマリ情報PDF、x: XBRL関連ファイル 省略時は全種類を返却します（e.g. g or g,s,x） |

### APIコールサンプルコード

/v2/td/files

**cURL**

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

**JavaScript**

```javascript
import axios from 'axios'

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

await client.get('/v2/td/files', {
  params: {
    discNo: '{{discNo}}',
  },
})
```

**Python**

```python
import requests

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

### Responses

### データ項目概要

| Parameter        | Type   | Required | Description          |
| ---------------- | ------ | -------- | -------------------- |
| discNo           | string | Required | 開示番号（14桁）            |
| files            | object | Required | ファイルのダウンロードURL一覧     |
| files.pdf        | string | Required | 全文情報PDFのダウンロードURL    |
| files.summaryPdf | string | Required | サマリ情報PDFのダウンロードURL   |
| files.xbrl       | string | Required | XBRL関連ファイルのダウンロードURL |

### レスポンスサンプル

```bash {{ title: "200:OK" }}
{
    "discNo": "20250401130100",
    "files": {
        "pdf": "https://example.com/download-url-pdf",
        "summaryPdf": "https://example.com/download-url-summary",
        "xbrl": "https://example.com/download-url-xbrl"
    }
}
```
