下载
按 ID 解析文件、物种维度下载与资源目录接口。
GET /api/v1/downloads
返回可下载资源,包括数据模板、参考 FASTA 文件与打包归档。
curl https://api.ilepbase.com/api/v1/downloads响应
{
"success": true,
"data": {
"items": [
{
"id": "template",
"label": "Data Template",
"href": "/downloads/ilepbase-data-template.xlsx",
"type": "template"
},
{
"id": "barcode-reference",
"label": "Barcode Reference FASTA",
"href": "/downloads/barcode-reference.fa",
"type": "fasta"
},
{
"id": "genome-archive",
"label": "Genome Assembly Archive",
"href": "/downloads/genome-assemblies.tar.gz",
"type": "archive"
}
]
},
"timestamp": "2026-04-23T12:00:00.000Z"
}| 字段 | 类型 | 描述 |
|---|---|---|
items[].id | string | 资源标识符。 |
items[].label | string | 面向用户的标签。 |
items[].href | string | 下载地址。 |
items[].type | string | 资源类型:template、fasta 或 archive。 |
GET /api/v1/downloads/{fileId}
按 ID 解析下载文件。返回数据集类型、存储提供方以及实际下载地址(S3 预签名 URL 或直接链接)。
curl https://api.ilepbase.com/api/v1/downloads/1响应
{
"success": true,
"data": {
"fileId": 1,
"datasetType": "genome",
"storageProvider": "s3",
"downloadUrl": "https://downloads.ilepbase.com/genome/lepidoptera-assembly-v1.fa.gz"
},
"timestamp": "2026-04-23T12:00:00.000Z"
}| 字段 | 类型 | 描述 |
|---|---|---|
fileId | int | 文件标识符。 |
datasetType | string | genome、transcriptome 或 proteome。 |
storageProvider | string | s3 或 local。 |
downloadUrl | string | 解析后的下载地址。 |
错误:404 Not Found
{
"success": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File with ID 999 does not exist."
},
"timestamp": "2026-04-23T12:00:00.000Z"
}GET /api/v1/downloads/{fileId}/stream
直接以二进制响应流式返回文件字节。
curl -L -o assembly.fa.gz "https://api.ilepbase.com/api/v1/downloads/1/stream"路径参数
| 名称 | 类型 | 描述 |
|---|---|---|
fileId | int | 文件标识符,与元数据接口相同。 |
GET /api/v1/species/{speciesSlug}/downloads
列出指定物种的所有可下载资源,并按数据集类型分组。
curl "https://api.ilepbase.com/api/v1/species/papilio-xuthus/downloads?datasetType=all"查询参数
| 名称 | 类型 | 必填 | 默认值 | 描述 |
|---|---|---|---|---|
datasetType | string | 否 | all | 筛选类型:genome、transcriptome、proteome 或 all。 |
响应
{
"success": true,
"data": {
"items": [
{
"datasetType": "genome",
"datasetId": "papilio-xuthus",
"datasetName": "Papilio xuthus genome assembly v1",
"source": "NCBI",
"file": {
"href": "/downloads/genome/papilio-xuthus-assembly.fa.gz",
"label": "assembly.fa.gz"
}
},
{
"datasetType": "transcriptome",
"datasetId": "tx-pxut-001",
"datasetName": "Larval midgut RNA-seq",
"source": "SRA",
"file": {
"href": "/downloads/transcriptome/tx-pxut-larval-midgut.fq.gz",
"label": "transcriptome.fq.gz"
}
},
{
"datasetType": "proteome",
"datasetId": "px-001",
"datasetName": "Papilio xuthus predicted proteins v2",
"source": "NCBI",
"file": {
"href": "/downloads/proteome/pxut-v2.faa.gz",
"label": "proteome.faa.gz"
}
}
]
},
"timestamp": "2026-04-23T12:00:00.000Z"
}