{# load django_bootstrap5#%} CCDB server
Prof. Itay Mayrose Lab - Plant Evolution, bioinformatics, & comparative genomics

   CCDB is a community resource. If you are aware of any missing data or if any of the counts are erroneous please submit it to the forms submit new counts, or report erroneous counts.

API Services

CCDB can be accessed through an Application programming interface (API), which allows easy data retrieval.
The API can be used either from a web browser or from an external program such as a Perl/Python/R script.
Data is accessible through the URL http://ccdb.tau.ac.il/services/ , followed by specific suffixes, as described below.

The URLs format is (case sensitive):
http://ccdb.tau.ac.il/services/<output type>/?<taxonomic rank>=<query>&format=<output format>
where variables in chevrons should be replaced by values according to user request, as follows:

<output type>
available values are: countsFull and statistics.
These allow retrieval of full or partial information for each row, respectively. Species statistics includes full resolved name, with the minimum, maximum, and median count, as well as a distribution of all available counts for this name. The distribution is presented as the count with its prevalence (percentage) such that, for example, in the case the recorded counts for a taxon are n = 20, 20, 30, 30, the distribution will be written as 20=0.5_30=0.5.

<taxonomic rank>
available values are: species , genus , family , majorGroup
available delimiters for species : space and underscore (examples: Aloe_vera or Aloe vera)

value must be respective to the taxonomic rank chosen, the name of a genus, family, or majorGroup

<output format>
available values are: xml,json,csv

Example 1:
To retrieve full information of all counts in the genus Aloe in json format, access the URL:

Example 2:
To retrieve full information of all counts in the family Bryaceae in xml format, access the URL:

Example 3:
To retrieve statistics of all counts of Bryophytes in csv format:

Example 4:
To retrieve statistics of all counts of Aloe vera in xml format:

Accessing the API using an automatic script is done by retrieving the data from a URL, constructed according to the format described above.
For example, in Python 3, the following function may be used to retrieve full information for a given genus in JSON format:

import urllib.request

def retrieve_genus_counts(genus):
    response = urllib.request.urlopen('http://ccdb.tau.ac.il/services/countsFull/?genus=' + genus + '&format=json')
    return response.read()

And the equivalent subroutine in Perl 5 is:

use LWP::Simple;

sub retrieve_genus_counts{
    my $genus = $_[0];
    my $response = get("http://ccdb.tau.ac.il/services/countsFull/?genus=$genus&format=json");
    return $response;

R Package

An R package written by Matt Pennell which makes API calls from the CCDB named "Chromer" is currently available on CRAN and GitHub.
This package was developed as part of the rOpenSci project.