post https://cgc-api.sbgenomics.com/v2
QUERY DATASETS > About the Datasets API > Query via the Datasets API > Example query 4...
Use the following query to return all cases that have an age at diagnosis of between 10 and 50 and also have the disease "Kidney Chromophobe". This query specifies values for multiple metadata fields: hasAgeAtDiagnosis
and hasDiseaseType
. To conjoin multiple criteria in the query, simply list them consecutively, as in this example.
Request
POST /datasets/tcga/v0/query HTTP/1.1
Host: cgc-datasets-api.sbgenomics.com
X-SBG-Auth-Token: 3210a98c1db9304ea9d9273156740f74
{
"entity":"cases",
"hasAgeAtDiagnosis": {
"filter": {
"gt": 10,
"lt": 50}
},
"hasDiseaseType": "Kidney Chromophobe"
}
Response
This request returns the following response:
{
"count": 55,
"_embedded": {
"cases": [
{
"id": "02971234-5149-4750-ABCD-483E0BEC6AC5",
"label": "02971234-5149-4750-ABCD-483E0BEC6AC5",
"_links": {
"self": {
"href": "api.sbgenomics.com/datasets/tcga/v0/cases/02971234-5149-4750-ABCD-483E0BEC6AC5"
}
}
},
{
"id": "04E9A63A-D742-456B-7890-BF9D79AA2091",
"label": "04E9A63A-D742-456B-7890-BF9D79AA2091",
"_links": {
"self": {
"href": "api.sbgenomics.com/datasets/tcga/v0/cases/04E9A63A-D742-456B-7890-BF9D79AA2091"
}
}
},
{
"id": "0B77657A-789C-456B-B9F2-5DE72E182016",
"label": "0B77657A-789C-456B-B9F2-5DE72E182016",
"_links": {
"self": {
"href": "api.sbgenomics.com/datasets/tcga/v0/cases/0B77657A-789C-456B-B9F2-5DE72E182016"
}
}
},
{
"id": "0BDE80B4-123A-443E-B386-B44D9D5E3DC2",
"label": "0BDE80B4-123A-443E-B386-B44D9D5E3DC2",
"_links": {
"self": {
"href": "api.sbgenomics.com/datasets/tcga/v0/cases/0BDE80B4-123A-443E-B386-B44D9D5E3DC2"
}
}
},
<snip>
]
}
}
For each case matching the query, the following information is listed:
- Its
href
: this is a path that can be used to obtain full information about the sample. To see all information, issue aGET
request to this path. See Example query 1: Find samples connected to a case for details. - Its TCGA
id
- Its TCGA
label