<p>To download metadata associated with a specific data file, such as the cancer type and stage, you can use the GDC API (Application Programming Interface). The API allows you to query the GDC database and retrieve information in a structured format, such as JSON or XML.</p>
<p>To download the metadata for a specific data file, you will need the file's unique identifier, also known as its UUID. In your example, the UUID of the methylation data file is &quot;14dc6f1f-21d0-4b05-9ad5-1d52f5020b12&quot;.</p>
<p>To use the GDC API, you can construct a query using the GDC API endpoint and the file's UUID. For example, to retrieve the metadata for the methylation data file with the UUID &quot;14dc6f1f-21d0-4b05-9ad5-1d52f5020b12&quot;, you could use the following query:</p>
<p><a href="https://api.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12?expand=metadata" rel="nofollow noreferrer">https://api.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12?expand=metadata</a></p>
<p>This query uses the &quot;files&quot; endpoint of the GDC API and specifies the file's UUID. The &quot;expand=metadata&quot; parameter tells the API to return the metadata associated with the file. The response will be in json format:</p>
<pre><code>{&quot;data&quot;: {&quot;data_format&quot;: &quot;TXT&quot;, &quot;access&quot;: &quot;open&quot;, &quot;file_name&quot;: &quot;5b6353ee-af39-4bb4-a801-1454dfbc338b.methylation_array.sesame.level3betas.txt&quot;, &quot;submitter_id&quot;: &quot;d67719e6-4149-4492-a265-1f5d5689b904&quot;, &quot;data_category&quot;: &quot;DNA Methylation&quot;, &quot;acl&quot;: [&quot;open&quot;], &quot;type&quot;: &quot;methylation_beta_value&quot;, &quot;platform&quot;: &quot;Illumina Human Methylation 450&quot;, &quot;file_size&quot;: 13168876, &quot;created_datetime&quot;: &quot;2022-02-15T17:17:23.357435-06:00&quot;, &quot;md5sum&quot;: &quot;ab0c90db97a3e12634ef3f54f3ec835d&quot;, &quot;updated_datetime&quot;: &quot;2022-02-16T19:13:44.087132-06:00&quot;, &quot;file_id&quot;: &quot;14dc6f1f-21d0-4b05-9ad5-1d52f5020b12&quot;, &quot;data_type&quot;: &quot;Methylation Beta Value&quot;, &quot;state&quot;: &quot;released&quot;, &quot;experimental_strategy&quot;: &quot;Methylation Array&quot;, &quot;version&quot;: &quot;1&quot;, &quot;data_release&quot;: &quot;32.0 - 36.0&quot;}, &quot;warnings&quot;: {&quot;expand&quot;: &quot;unrecognized values: [metadata]&quot;}}
</code></pre>

CC BY-SA 4.0
2023-01-12T12:55:22.470Z
2023-01-12T12:55:22.470Z
Soerendip
<p>I've been able to download specific data types from the TCGA portal (<a href="https://portal.gdc.cancer.gov/" rel="nofollow noreferrer">https://portal.gdc.cancer.gov/</a>) using the Manifest files and the GDC Tool.</p>
<p>But it's not clear to me how to download the metadata (e.g. cancer type, stage, etc.) with the links to the UUIDs of a specific data type, e.g. the UUID of a methylation data file to the case UUID:</p>
<p><a href="https://portal.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12" rel="nofollow noreferrer">https://portal.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12</a></p>
<p>Any ideas?</p>

<public-databases><cancer>
how to download all metadata for a single TCGA dataset and link to data file UUIDs?
# how to download all metadata for a single TCGA dataset and link to data file UUIDs?

(Asked by: username_0 on 2023-01-04)

I've been able to download specific data types from the TCGA portal (<https://portal.gdc.cancer.gov/>) using the Manifest files and the GDC Tool.

But it's not clear to me how to download the metadata (e.g. cancer type, stage, etc.) with the links to the UUIDs of a specific data type, e.g. the UUID of a methylation data file to the case UUID:

<https://portal.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12>

Any ideas?

**Tags:** public-databases, cancer

---

## 1 answers

### Answer by username_1 on 2023-01-12. Score: 2

To download metadata associated with a specific data file, such as the cancer type and stage, you can use the GDC API (Application Programming Interface). The API allows you to query the GDC database and retrieve information in a structured format, such as JSON or XML.
To download the metadata for a specific data file, you will need the file's unique identifier, also known as its UUID. In your example, the UUID of the methylation data file is "14dc6f1f-21d0-4b05-9ad5-1d52f5020b12".
To use the GDC API, you can construct a query using the GDC API endpoint and the file's UUID. For example, to retrieve the metadata for the methylation data file with the UUID "14dc6f1f-21d0-4b05-9ad5-1d52f5020b12", you could use the following query:
https://api.gdc.cancer.gov/files/14dc6f1f-21d0-4b05-9ad5-1d52f5020b12?expand=metadata
This query uses the "files" endpoint of the GDC API and specifies the file's UUID. The "expand=metadata" parameter tells the API to return the metadata associated with the file. The response will be in json format:
{"data": {"data_format": "TXT", "access": "open", "file_name": "5b6353ee-af39-4bb4-a801-1454dfbc338b.methylation_array.sesame.level3betas.txt", "submitter_id": "d67719e6-4149-4492-a265-1f5d5689b904", "data_category": "DNA Methylation", "acl": ["open"], "type": "methylation_beta_value", "platform": "Illumina Human Methylation 450", "file_size": 13168876, "created_datetime": "2022-02-15T17:17:23.357435-06:00", "md5sum": "ab0c90db97a3e12634ef3f54f3ec835d", "updated_datetime": "2022-02-16T19:13:44.087132-06:00", "file_id": "14dc6f1f-21d0-4b05-9ad5-1d52f5020b12", "data_type": "Methylation Beta Value", "state": "released", "experimental_strategy": "Methylation Array", "version": "1", "data_release": "32.0 - 36.0"}, "warnings": {"expand": "unrecognized values: [metadata]"}}


---

