{"openapi":"3.0.1","info":{"title":"ENA Portal (Advance Search) API","description":"Advanced search and discovery of ENA data","contact":{"name":"ENA Helpdesk","url":"https://www.ebi.ac.uk/ena/browser/support"}},"servers":[{"url":"/ena/portal/api"}],"tags":[{"name":"Search & Discovery","description":"Endpoints for searching across metadata"},{"name":"File download script","description":"Endpoint to search across public metadata and get a downloader script."}],"paths":{"/search":{"get":{"tags":["Search & Discovery"],"summary":"Perform a warehouse search","operationId":"search","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory."},{"name":"query","in":"query","description":"A set of search conditions joined by logical operators (AND, OR, NOT) and bound by double quotes. If none supplied, the full result set will be returned."},{"name":"includeAccessionType","in":"query","description":"The connected data type to include accessions of"},{"name":"excludeAccessionType","in":"query","description":"The connected data type to exclude accessions of"},{"name":"includeAccessions","in":"query","description":"A list of accessions for records that you would like to be included with the results of your query"},{"name":"excludeAccessions","in":"query","description":"A list of accessions for records that you would like to be excluded from the results of your query"},{"name":"fields","in":"query","description":"A list of fields (comma separated) to be returned in the result. If none supplied, the accession and description/title of the main result object will be returned."},{"name":"limit","in":"query","description":"The maximum number of records to retrieve. This interface sets a limit of 10 for usability. Remove it for real use cases.If the full result set is to be fetched, the limit may be set to 0, or omitted.","schema":{"type":"integer","default":10}},{"name":"dataPortal","in":"query","description":"The data portal ID. Defaults to 'ena'.","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"dccDataOnly","in":"query","description":"Whether to limit the search to only DCC records. By default, all public data is also included in the search.","schema":{"type":"boolean"}},{"name":"includeMetagenomes","in":"query","description":"Whether to include public metagenome data in the search. By default, these are not included. Note that any metagenome data associated with a DCC hub will always be included in a search against that DCC.","schema":{"type":"boolean"}},{"name":"searchCurations","in":"query","description":"Search in curations.","schema":{"type":"boolean"}},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","required":false,"schema":{"type":"string","default":"tsv","enum":["json","tsv"]}},{"name":"download","in":"query","description":"Whether to download the result as a file, rather than read it from the stream. By default, this is false.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]},"post":{"tags":["Search & Discovery"],"summary":"Perform a warehouse search with POST","operationId":"searchPost","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory.","required":true},{"name":"query","in":"query","description":"A set of search conditions joined by logical operators (AND, OR, NOT) and bound by double quotes. If none supplied, the full result set will be returned."},{"name":"includeAccessionType","in":"query","description":"The connected data type to include accessions of"},{"name":"excludeAccessionType","in":"query","description":"The connected data type to exclude accessions of"},{"name":"includeAccessions","in":"query","description":"A list of accessions for records that you would like to be included with the results of your query"},{"name":"excludeAccessions","in":"query","description":"A list of accessions for records that you would like to be excluded from the results of your query"},{"name":"fields","in":"query","description":"A list of fields (comma separated) to be returned in the result. If none supplied, the accession and description/title of the main result object will be returned."},{"name":"limit","in":"query","description":"The maximum number of records to retrieve. This interface sets a limit of 10 for usability. Remove it for real use cases.If the full result set is to be fetched, the limit may be set to 0, or omitted.","schema":{"type":"integer","default":10}},{"name":"dataPortal","in":"query","description":"The data portal ID. Defaults to 'ena'.","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"dccDataOnly","in":"query","description":"Whether to limit the search to only DCC records. By default, all public data is also included in the search.","schema":{"type":"boolean","default":false}},{"name":"includeMetagenomes","in":"query","description":"Whether to include public metagenome data in the search. By default, these are not included. Note that any metagenome data associated with a DCC hub will always be included in a search against that DCC.","schema":{"type":"boolean","default":false}},{"name":"searchCurations","in":"query","description":"Search in curations.","schema":{"type":"boolean","default":false}},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","default":"tsv","enum":["json","tsv"]}},{"name":"download","in":"query","description":"Whether to download the result as a file, rather than read it from the stream. By default, this is false.","schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{}}},"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]}},"/files":{"post":{"tags":["File download script"],"summary":"Perform a search to get a script to download data files for the matched records.","operationId":"getDownloadFilesCommandsOrSize","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"result":{"type":"string","description":"The result type (data set) to search against. Is mandatory."},"query":{"type":"string","description":"A set of search conditions joined by logical operators (AND, OR, NOT) and bound by double quotes. If none supplied, the full result set will be returned."},"field":{"type":"string","description":"The name of the file field to be downloaded."},"limit":{"type":"integer","description":"The maximum number of records to retrieve. This interface sets a limit of 10 for usability. Remove it for real use cases.If the full result set is to be fetched, the limit may be set to 0, or omitted.","default":"10"},"dataPortal":{"type":"string","description":"The data portal ID. Defaults to 'ena'.","enum":["ena","faang","metagenome","pathogen"]},"files":{"type":"array","description":"A list of files"},"count":{"type":"boolean","description":"If true, returns only the total number and size of files. Default is false. Is ignored if the 'files' list is provided."},"accession":{"type":"string","description":"Accession of record to get files for."},"dccDataOnly":{"type":"boolean","default":"false"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamingResponseBody"}},"text/plain":{"schema":{"$ref":"#/components/schemas/StreamingResponseBody"}}}}},"security":[{"basicAuth":[]}]}},"/count":{"get":{"tags":["Search & Discovery"],"summary":"Count rows matching search parameters","operationId":"count","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory.","required":true},{"name":"query","in":"query","description":"A set of search conditions joined by logical operators (AND, OR, NOT) and bound by double quotes. If none supplied, the full result set will be returned."},{"name":"includeAccessionType","in":"query","description":"The connected data type to include accessions of"},{"name":"excludeAccessionType","in":"query","description":"The connected data type to exclude accessions of"},{"name":"includeAccessions","in":"query","description":"A list of accessions for records that you would like to be included with the results of your query"},{"name":"excludeAccessions","in":"query","description":"A list of accessions for records that you would like to be excluded from the results of your query"},{"name":"dataPortal","in":"query","description":"The data portal ID. Defaults to 'ena'.","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"dccDataOnly","in":"query","description":"Whether to limit the search to only DCC records. By default, all public data is also included in the search.","schema":{"type":"boolean"}},{"name":"includeMetagenomes","in":"query","description":"Whether to include public metagenome data in the search. By default, these are not included. Note that any metagenome data associated with a DCC hub will always be included in a search against that DCC.","schema":{"type":"boolean"}},{"name":"searchCurations","in":"query","description":"Search in curations.","schema":{"type":"boolean"}},{"name":"field","in":"query","description":"The field to count values of. Only works on controlled value type fields.","schema":{"type":"string"}},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]},"post":{"tags":["Search & Discovery"],"summary":"Count rows matching search parameters","operationId":"countPost","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory.","required":true},{"name":"query","in":"query","description":"A set of search conditions joined by logical operators (AND, OR, NOT) and bound by double quotes. If none supplied, the full result set will be returned."},{"name":"includeAccessionType","in":"query","description":"The connected data type to include accessions of"},{"name":"excludeAccessionType","in":"query","description":"The connected data type to exclude accessions of"},{"name":"includeAccessions","in":"query","description":"A list of accessions for records that you would like to be included with the results of your query"},{"name":"excludeAccessions","in":"query","description":"A list of accessions for records that you would like to be excluded from the results of your query"},{"name":"dataPortal","in":"query","description":"The data portal ID. Defaults to 'ena'.","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"dccDataOnly","in":"query","description":"Whether to limit the search to only DCC records. By default, all public data is also included in the search.","schema":{"type":"boolean","default":false}},{"name":"includeMetagenomes","in":"query","description":"Whether to include public metagenome data in the search. By default, these are not included. Note that any metagenome data associated with a DCC hub will always be included in a search against that DCC.","schema":{"type":"boolean","default":false}},{"name":"searchCurations","in":"query","description":"Search in curations.","schema":{"type":"boolean","default":false}},{"name":"field","in":"query","description":"The field to count values of. Only works on controlled value type fields.","schema":{"type":"string"}},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{}}},"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]}},"/searchFields":{"get":{"tags":["Search & Discovery"],"summary":"Get a list of searchable fields for a result type.","operationId":"getSearchFields","parameters":[{"name":"dataPortal","in":"query","description":"Data portal Id","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"result","in":"query","description":"Result","required":true},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"responses":{"200":{"description":"OK"}}}},"/returnFields":{"get":{"tags":["Search & Discovery"],"summary":"Get a list of fields that can be returned for a result type.","operationId":"getReturnFields","parameters":[{"name":"dataPortal","in":"query","description":"Data portal Id","schema":{"type":"string","enum":["ena","faang","metagenome","pathogen"]}},{"name":"result","in":"query","description":"Result","required":true},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"responses":{"200":{"description":"OK"}}}},"/results":{"get":{"tags":["Search & Discovery"],"summary":"Get a list of available result types (data sets) to search against.","operationId":"getResults","parameters":[{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"responses":{"200":{"description":"OK"}}}},"/relations/{dataClass}/{accession}":{"get":{"tags":["graph-controller"],"summary":"Get the relations for the given record to display in the UI.","operationId":"getRelationByDataClassAndAccession","parameters":[{"name":"dataClass","in":"path","description":"ENA DataClass","required":true,"schema":{"type":"string"}},{"name":"accession","in":"path","description":"ENA Accession","required":true,"schema":{"type":"string"}},{"name":"hopCount","in":"query","description":"Number of nodes to be traversed.","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/D3Result"}}}}}}},"/relations/TAXON/{accession}":{"get":{"tags":["graph-controller"],"summary":"Get the relations for the given taxon to display in the UI.","operationId":"getTaxonHierarchyByAccession","parameters":[{"name":"accession","in":"path","description":"Tax ID","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"ancestorLevel","in":"query","description":"Number of levels traverses up the taxonomy hierarchy. 0 to bring all the ancestors","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"childCount","in":"query","description":"Number of children to be retrieved. Use 0 to retrieve all the the children","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/D3Result"}}}}}}},"/relations/taxon/{accession}":{"get":{"tags":["graph-controller"],"summary":"Get the relations for the given taxon to display in the UI.","operationId":"getTaxonHierarchyByAccession_1","parameters":[{"name":"accession","in":"path","description":"Tax ID","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"ancestorLevel","in":"query","description":"Number of levels traverses up the taxonomy hierarchy. 0 to bring all the ancestors","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"childCount","in":"query","description":"Number of children to be retrieved. Use 0 to retrieve all the the children","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/D3Result"}}}}}}},"/links/{dataType}":{"get":{"tags":["Search & Discovery"],"summary":"Get links","operationId":"getLinks","parameters":[{"name":"accession","in":"query","description":"Accession","required":true,"schema":{"type":"string"}},{"name":"result","in":"query","description":"The result type of links.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The maximum number of records to retrieve. This interface sets a limit of 10 for usability. Remove it for real use cases.If the full result set is to be fetched, the limit may be set to 0, or omitted.","required":false,"schema":{"type":"integer","default":10}},{"name":"subtree","in":"query","description":"Include subtree"},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","required":false,"schema":{"type":"string","default":"tsv","enum":["json","tsv"]}},{"name":"download","in":"query","description":"Whether to download the result as a file, rather than read it from the stream. By default, this is false.","required":false,"schema":{"type":"boolean","default":false}},{"name":"dataType","in":"path","required":true,"schema":{"type":"string"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StreamingResponseBody"}}}}}}},"/filereportcount":{"get":{"tags":["Search & Discovery"],"summary":"Get row count for file report from warehouse search","operationId":"fileReportCount","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory.","required":true},{"name":"accession","in":"query","description":"Accession","required":true},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","schema":{"type":"string","enum":["json","tsv"]}}],"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]}},"/filereport":{"get":{"tags":["Search & Discovery"],"summary":"Get file report from warehouse search","operationId":"fileReport","parameters":[{"name":"result","in":"query","description":"The result type (data set) to search against. Is mandatory.","required":true,"schema":{"type":"string"}},{"name":"accession","in":"query","description":"Accession","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","description":"A list of fields (comma separated) to be returned in the result. If none supplied, the accession and ftp information for fastq,submitted and sra files will be returned.","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"The maximum number of records to retrieve. This interface sets a limit of 10 for usability. Remove it for real use cases.If the full result set is to be fetched, the limit may be set to 0, or omitted.","required":false,"schema":{"type":"integer","default":10}},{"name":"format","in":"query","description":"What format the results should be returned as: TSV (Tab Separated Values) or JSON. By default, a TSV report is provided.","required":false,"schema":{"type":"string","enum":["json","tsv"]}},{"name":"download","in":"query","description":"Whether to download the result as a file, rather than read it from the stream. By default, this is false.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK"}},"security":[{"basicAuth":[]}]}},"/doc":{"get":{"tags":["Search & Discovery"],"summary":"Download the documentation as a PDF file.","operationId":"downloadDoc","responses":{"200":{"description":"OK"}}}},"/controlledVocab":{"get":{"tags":["Search & Discovery"],"summary":"Get a list of available values for a controlled vocabulary field.","operationId":"getControlledVocab","parameters":[{"name":"field","in":"query","description":"Field name","required":true}],"responses":{"200":{"description":"OK"}}}},"/accessionTypes":{"get":{"tags":["Search & Discovery"],"summary":"Get a list of accession types that can be used in the search query.","operationId":"getAccessionTypes","parameters":[{"name":"result","in":"query","description":"Result","required":true}],"responses":{"200":{"description":"OK"}}}}},"components":{"schemas":{"StreamingResponseBody":{"type":"object"},"D3Link":{"type":"object","properties":{"source":{"type":"string"},"sourceDataClass":{"type":"string"},"target":{"type":"string"},"targetDataClass":{"type":"string"},"relation":{"type":"string","enum":["PARENT","CHILD","LINKED"]}}},"D3Node":{"type":"object","properties":{"acc":{"type":"string"},"name":{"type":"string"},"dataClass":{"type":"string"},"root":{"type":"boolean"}}},"D3Result":{"type":"object","properties":{"nodes":{"type":"array","items":{"$ref":"#/components/schemas/D3Node"}},"links":{"type":"array","items":{"$ref":"#/components/schemas/D3Link"}},"totalChildren":{"type":"integer","format":"int32"}}}},"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}}}}