I'm trying to use the python API from https://portal.gdc.cancer.gov/ to select samples with DNA methylation data and/or RNA-seq data from tumour and adjacent normal tissue. I can't seem to find a metadata tag that I can use to filter the samples based on the criterion of the data being from tumour or adjacent normal tissue.
The data model does seem to represent quite a lot of things about the samples but I can't find anything about this criterion in the list of available fields, see: https://docs.gdc.cancer.gov/API/Users_Guide/Appendix_A_Available_Fields/ . I may have missed it, (it's a fairly long list some of the items on which are a bit open to interpretation, and there is no longer form disambiguation of their meaning in evidence), but scanning through and searching for likely keywords didn't yield anything unambiguous.
On the GDC, if you configure a search (like you have) and then download the manifest, you can programmatically look up the TCGA barcode (and infer tumour - normal status) by following either of these functions: