## API

Beacon Network was designed with ease of programmatic access in mind. It provides XML, JSON and plaintext responses to accommodate needs of all the clients across all the programming languages. The API to use is determined using the header supplied by the client in its GET request, e.g.:

    Accept: application/json

A beacon "Accepts a query of the form Do you have any genomes with an 'A' at position 100,735 on chromosome 3?" and responds with one of 'Yes' or 'No' (http://ga4gh.org/#/beacon). This is provided by the following API endpoint:

    GET http://localhost:8080/beacon-of-beacons/rest/responses?chrom={chromosome}&pos={position}&allele={allele}&beacon={beacon}&ref={reference}

where the (chrom, pos, allele) parameters tuple describes the query you want to ask with the following syntax/semantics:

- {chromosome}: Chromosome ID, one of the 1-22, X, Y, MT. For compatibility with conventions set by some of the existing beacons, an arbitrary prefix is accepted as well (e.g. chr1 is equivalent to chrom1 and 1).
- {position}: Coordinate within a chromosome. Position is a number and is 1-based.
- {allele}: Any string of nucleotides A,C,T,G or D, I for deletion and insertion. For compatibility with conventions set by some of the existing beacons, DEL and INS identifiers are also accepted.
- {beacon}: Beacon ID. Optional parameter. Filters the responses to specific beacons. Unless it is specified, the responses from all the supported beacons are obtained.
- {reference}: Genome ID. Optional parameter. Unless it is specified, all the genomes supported by the specific beacons are queried.

Bob currently supports over 18 publicly available beacons and converts the input information into the queries they can understand. This may include a change of chromosome identifier, using a 0-based position instead of a 1-based one as well as using a different allele representation. Some beacons support multiple projects or tracks, in which case Beacon Network queries all of them and look for a positive response from almost one of them.

To see more queries, go to the queries page.