4de18188ae5bb1336c3f49ad155358ee8f94db00
hiram
  Wed May 3 10:20:58 2023 -0700
adding new endpoint /list/files definitions and examples refs #23589

diff --git src/hg/htdocs/goldenPath/help/api.html src/hg/htdocs/goldenPath/help/api.html
index 54923a2..5f76c3f 100755
--- src/hg/htdocs/goldenPath/help/api.html
+++ src/hg/htdocs/goldenPath/help/api.html
@@ -49,59 +49,61 @@
 This access URL: <b>https://api.genome.ucsc.edu/</b> is used to access
 the endpoint functions.  For example:
 <pre>
     wget -O- 'https://api.genome.ucsc.edu/list/publicHubs'
 </pre>
 </p>
 
 <!-- ========== What type of data can be accessed? ===================== -->
 <a id="Return"></a>
 <h2>What type of data can be accessed?</h2>
 <p>
 The following data sets can be accessed at this time:
 <ul>
 <li>List of available public hubs</li>
 <li>List of available UCSC Genome Browser genome assemblies</li>
+<li>List of files available for download for UCSC Browser genome assemblies</li>
 <li>List of genomes from a specified assembly or track hub</li>
 <li>List of available data tracks from a specified hub or UCSC Genome Browser genome assembly
 (see also: <a
  href='trackDb/trackDbHub.html' target=_blank>track definition help</a>)</li>
 <li>List of chromosomes contained in an assembly hub or UCSC Genome Browser genome assembly</li>
 <li>List of chromosomes contained in a specific track of an assembly or track hub, or UCSC Genome
 Browser genome assembly</li>
 <li>Return DNA sequence from an assembly hub 2bit file, or UCSC Genome Browser assembly</li>
 <li>Return track data from a specified assembly or track hub, or UCSC Genome Browser assembly</li>
 </ul>
 <b>Note:</b> BLAT also supports programmatic URL queries which return in JSON format. See our
 <a href="/FAQ/FAQblat.html#blat14">BLAT FAQ</a> for more info.
 </p>
 
 <!-- ========== Endpoint functions ======================= -->
 <a id="Endpoint"></a>
 <h2>Endpoint functions to return data</h2>
 <p>
 The URL <b>https://api.genome.ucsc.edu/</b> is used to access
 the endpoint functions.  For example:
 <pre>
     curl -L 'https://api.genome.ucsc.edu/list/ucscGenomes'
 </pre>
 </p>
 <p>
 <ul>
 <li><b>/list/publicHubs</b> - list public hubs</li>
 <li><b>/list/ucscGenomes</b> - list UCSC Genome Browser database genomes</li>
 <li><b>/list/hubGenomes</b> - list genomes from specified hub</li>
+<li><b>/list/files</b> - list download files available for specified genome</li>
 <li><b>/list/tracks</b> - list data tracks available in specified hub or database genome
 (see also: <a href='trackDb/trackDbHub.html' target=_blank>track definition help</a>)</li>
 <li><b>/list/chromosomes</b> - list chromosomes from a data track in specified hub or database
 <li><b>/list/schema</b> - list the schema for a data track in specified hub or database
 genome</li>
 <li><b>/getData/sequence</b> - return sequence from specified hub or database genome</li>
 <li><b>/getData/track</b> - return data from specified track in hub or database genome</li>
 </ul>
 </p>
 
 <!-- ========== Parameters to endpoint functions ======================= -->
 <a id="Parameters"></a>
 <h2>Parameters to endpoint functions</h2>
 <p>
 <ul>
@@ -112,72 +114,79 @@
 <li>chrom=&lt;chrN&gt; - specify chromosome name for sequence or track data</li>
 <li>start=&lt;123&gt; - specify start coordinate (0 relative) for data from track or sequence
 retrieval (start and end required together). See also: <a
  href='http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/'
 target=_blank>UCSC browser coordinate counting systems</a></li>
 <li>end=&lt;456&gt; - specify end coordinate (1 relative) for data from track or sequence
 retrieval (start and end required together). See also: <a
  href='http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/'
 target=_blank>UCSC browser coordinate counting systems</a></li>
 <li>maxItemsOutput=1000 - limit number of items to output, default: 1,000, maximum limit:
 1,000,000 (use <em>-1</em> to get maximum output)</li>
 <li>trackLeavesOnly=1 - on <em>/list/tracks</em> function, only show tracks, do not show
 composite container information</li>
 <li>jsonOutputArrays=1 - on <em>/getData/track</em> function, JSON format is array type
 for each item of data, instead of the default object type</li>
+<li>format=text - on <em>/list/files</em> function, return plain text listing
+of download files instead of JSON format output (which includes more meta-data information).  Text output contains less meta-data in comment lines prefixed by the '#' hash character.</li>
 </ul>
 </p>
 <p>
 The parameters are added to the endpoint URL beginning with a
 question mark <b>?</b>, and multiple parameters are separated with
 the semi-colon <b>;</b>.  For example:
 <pre>
 https://api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM
 </pre>
 </p>
 
 <!-- ========== Required and optional parameters  ======================= -->
 <a id="Parameter_use"></a>
 <h2>Required and optional parameters</h2>
 <p>
 <table>
 <tr><th>Endpoint function</th><th>Required</th><th>Optional</th></tr>
 <tr><th>/list/publicHubs</th><td>(none)</td><td>(none)</td></tr>
 <tr><th>/list/ucscGenomes</th><td>(none)</td><td>(none)</td></tr>
 <tr><th>/list/hubGenomes</th><td>hubUrl</td><td>(none)</td></tr>
+<tr><th>/list/files</th><td>genome</td><td>format=text, maxItemsOutput</td></tr>
 <tr><th>/list/tracks</th><td>genome or (hubUrl and genome)</td><td>trackLeavesOnly=1</td></tr>
 <tr><th>/list/chromosomes</th><td>genome or (hubUrl and genome)</td><td>track</td></tr>
 <tr><th>/list/schema</th><td>(genome or (hubUrl and genome)) and track</td><td>(none)</td></tr>
 <tr><th>/getData/sequence</th><td>(genome or (hubUrl and genome)) and chrom</td><td>start and
 end</td></tr>
 <tr><th>/getData/track</th><td>(genome or (hubUrl and genome)) and track</td><td>chrom,
 (start and end), maxItemsOutput, jsonOutputArrays</td></tr>
 </table>
 </p>
 <p>
 The <b>hubUrl</b> and <b>genome</b> parameters are required together to
 specify a unique genome in an assembly or track hub.  The <b>genome</b> for
 a track hub will usually be a UCSC database genome.  Assembly hubs will
 have their own unique <b>genome</b> sequences.  Specify <b>genome</b> without
 a <b>hubUrl</b> to refer to a UCSC Genome Browser assembly.
 </p>
 <p>
 Using the <b>chrom=&lt;name&gt;</b> parameter will limit the request
 to the single specified chromosome.  To limit the request to a specific
 position, both <b>start=4321</b> and <b>end=5678</b> must be given together.
 </p>
 <p>
+The <b>/list/files</b> endpoint only works for UCSC hosted genome assemblies,
+not for external hosted assembly hubs.
+</p>
+<p>
 Any extra parameters not allowed in a function will be flagged as an error.
 </p>
 
 <!-- ========== Supported track types ======================= -->
 <a id="Track_types"></a>
 <h2>Supported track types for getData functions</h2>
 <p>
 <ul>
 <li><a href='/FAQ/FAQformat.html#format21' target=_blank>barChart</a></li>
 <li><a href='/FAQ/FAQformat.html#format1' target=_blank>bed</a></li>
 <li><a href='/FAQ/FAQformat.html#format1.5' target=_blank>bigBed</a></li>
 <!--  not yet
 <li><a href='/FAQ/FAQformat.html#format9.1' target=_blank>bigGenePred</a></li>
 -->
 <li><a href='/FAQ/FAQformat.html#format9.5' target=_blank>bigNarrowPeak</a></li>
@@ -243,30 +252,36 @@
 <b>api.genome.ucsc.edu/list/tracks?genome=hg38</b></li>
 <li><a href='https://api.genome.ucsc.edu/list/chromosomes?genome=hg38' target=_blank>list chromosomes from UCSC database genome</a> -
 <b>api.genome.ucsc.edu/list/chromosomes?genome=hg38</b></li>
 <li><a href='https://api.genome.ucsc.edu/list/chromosomes?genome=hg38;track=gold'
 target=_blank>list chromosomes from specified track in UCSC database genome</a> -
 <b>api.genome.ucsc.edu/list/chromosomes?genome=hg38;track=gold</b></li>
 <li><a href='https://api.genome.ucsc.edu/list/chromosomes?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=CAST_EiJ'
 target=_blank>list chromosomes from assembly hub genome</a> -
 <br><b>api.genome.ucsc.edu/list/chromosomes?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=CAST_EiJ</b></li>
 <li><a href='https://api.genome.ucsc.edu/list/chromosomes?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=CAST_EiJ;track=assembly'
 target=_blank>list chromosomes from specified track in assembly hub genome</a> -
 <br><b>api.genome.ucsc.edu/list/chromosomes?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=CAST_EiJ;track=assembly</b></li>
 <li><a href='https://api.genome.ucsc.edu/list/schema?genome=hg38;track=knownGene'
 target=_blank>list schema from specified track in UCSC database genome</a> -
 <br><b>api.genome.ucsc.edu/list/schema?genome=hg38;track=knownGene</b></li>
+<li><a href='https://api.genome.ucsc.edu/list/files?genome=GCF_000955945.1;maxItemsOutput=5'
+target=_blank>list download files for UCSC GenArk genome 'GCF_000955945.1' in JSON format limit 5 items output</a> -
+<br><b>api.genome.ucsc.edu/list/files?genome=GCF_000955945.1;maxItemsOutput=5</b></li>
+<li><a href='https://api.genome.ucsc.edu/list/files?genome=hs1;format=text;maxItemsOutput=5'
+target=_blank>list download files for UCSC genome 'hs1' in plain text format limit 5 items output</a> -
+<br><b>api.genome.ucsc.edu/list/files?genome=hs1;format=text;maxItemsOutput=5</b></li>
 </ol>
 <a id="getData_examples"></a>
 <h3>getData functions</h3>
 <ol>
 <li><a href='https://api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM'
 target=_blank>Get DNA sequence from specified chromosome in UCSC database genome</a> -
 <br><b>api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM</b></li>
 <li><a href='https://api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM;start=4321;end=5678'
 target=_blank>Get DNA sequence from specified chromosome and start,end coordinates in UCSC database genome</a> -
 <br><b>api.genome.ucsc.edu/getData/sequence?genome=hg38;chrom=chrM;start=4321;end=5678</b></li>
 <li><a href='https://api.genome.ucsc.edu/getData/sequence?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=mm10;chrom=chrM;start=4321;end=5678'
 target=_blank>Get DNA sequence from a track hub where 'genome' is a UCSC database</a> -
 <br><b>api.genome.ucsc.edu/getData/sequence?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=mm10;chrom=chrM;start=4321;end=5678</b></li>
 <li><a href='https://api.genome.ucsc.edu/getData/sequence?hubUrl=http://hgdownload.soe.ucsc.edu/hubs/mouseStrains/hub.txt;genome=CAST_EiJ;chrom=chr1;start=4321;end=5678'
 target=_blank>Get DNA sequence from specified chromosome and start,end coordinates in an assembly hub genome</a> -