ef83c5a7e3bb6168a91478e1b7be4318d7578a1a hiram Fri Mar 29 11:11:39 2019 -0700 adding example URLs refs #18869 diff --git src/hg/htdocs/goldenPath/help/api.html src/hg/htdocs/goldenPath/help/api.html index 2c1eb95..c939916 100755 --- src/hg/htdocs/goldenPath/help/api.html +++ src/hg/htdocs/goldenPath/help/api.html @@ -1,74 +1,158 @@ - + -

JSON data interface

+

JSON API data interface

Contents

What is JSON data ?
What is the access URL ?
-
What type of data can be accessed
-
Example endpoint access functions
+
What type of data can be accessed ?
+
Endpoint functions
+
Parameters to endpoint functions
+
Required and optional parameters
+
Supported track types
+
Example data access

Additional resources

What is JSON data ?

JSON data is a data transfer syntax from a data provider to a consumer. See also: JSON Introduction

What is the access URL ?

The gateway html page to the interface is available at -hgwdev-api.gi.ucsc.edu. This page can be used +api-test.gi.ucsc.edu. This page can be used to explore track hubs, assembly hubs, and UCSC browser data resources. Example URL links for JSON output are provided on that page for track types that are currently supported for data output. Work is underway to provide access to additional data track types.

What type of data can be accessed ?

The following data sets can be accessed at this time:

- + -

Example endpoint URLs to return data

+

Endpoint functions to return data

+ + +

Parameters to endpoint functions

+

+

+

+ + + +

Required and optional parameters

+

+ + + + + + + + + +
Endpoint functionRequiredOptional
/list/publicHubs(none)(none)
/list/ucscGenomes(none)(none)
/list/hubGenomeshubUrl(none)
/list/tracks(hubUrl and genome) or db(none)
/list/chromosomes((hubUrl and genome) or db) and track(none)
/getData/sequence(hubUrl and genome) or dbchrom, (start and end)
/getData/track((hubUrl and genome) or db) and trackchrom, (start and end)
+

+ + + +

Supported track types, at this time (April 2019), for getData functions

+

+

+

+ + + +

Example data access

+

Listing functions

+
    +
  1. list public hubs - api.genome.ucsc.edu/list/publicHubs
  2. +
  3. list UCSC database genomes - api.genome.ucsc.edu/list/ucscGenomes
  4. +
  5. list genomes from specified hub - api.genome.ucsc.edu/list/hubGenomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt
  6. +
  7. list tracks from specified hub - api.genome.ucsc.edu/list/tracks?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=_araTha1
  8. +
  9. list tracks from UCSC database genome - api.genome.ucsc.edu/list/tracks?db=ce11
  10. +
  11. list chromosomes from UCSC database genome - api.genome.ucsc.edu/list/chromosomes?db=ce11
  12. +
  13. list chromosomes from specified track in UCSC database genome - api.genome.ucsc.edu/list/chromosomes?db=ce11;track=gold
  14. +
  15. list chromosomes from assembly hub genome -
    api.genome.ucsc.edu/list/chromosomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=_araTha1
  16. +
  17. list chromosomes from specified track in assembly hub genome -
    api.genome.ucsc.edu/list/chromosomes?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=_araTha1;track=assembly_
  18. +
+

getData functions

+
    +
  1. Get DNA sequence from specified chromosome in UCSC database genome -
    api.genome.ucsc.edu/getData/sequence?db=ce11;chrom=chrM
  2. +
  3. Get DNA sequence from specified chromosome and start,end coordinates in UCSC database genome -
    api.genome.ucsc.edu/getData/sequence?db=ce11;chrom=chrM;start=4321;end=5678
  4. +
  5. TBD Get DNA sequence from specified chromosome and start,end coordinates in an assembly hub genome -
    api.genome.ucsc.edu/getData/sequence?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=_araTha1;chrom=chrCp;start=4321;end=5678
  6. +
  7. Get track data for specified track in UCSC database genome -
    api.genome.ucsc.edu/getData/track?db=ce11;track=gold;maxItemsOutput=100
  8. +
  9. Get track data for specified track and chromosome in UCSC database genome -
    api.genome.ucsc.edu/getData/track?db=ce11;track=gold;chrom=chrM
  10. +
  11. Get track data for specified track, chromosome and start,end coordinates in UCSC database genome -
    api.genome.ucsc.edu/getData/track?db=ce11;track=gold;chrom=chrI;start=47000;end=48000
  12. +
  13. Get track data for specified track in an assembly hub genome -
    api.genome.ucsc.edu/getData/track?hubUrl=http://genome-test.gi.ucsc.edu/~hiram/hubs/Plants/hub.txt;genome=_araTha1;track=assembly_
  14. +
+

+

+