How can I access data programmatically?

API

HipSci has a json API which provides programmatic access to the project’s data. The API is built on Elasticsearch, and uses many of the options described in the Elasticsearch version 1.5 documentation.

Endpoints h3

Information about a cell line: http://www.hipsci.org/lines/api/cellLine/:name

Information about a donor: http://www.hipsci.org/lines/api/donor/:name

Search for cell lines: http://www.hipsci.org/lines/api/cellLine/_search

  • This endpoint supports any search option described in the Elasticsearch documentation on Full Body Search
  • Returns information in json format
  • E.g. Search for cell lines derived from fibroblasts:
POST http://www.hipsci.org/lines/api/cellLine/_search
'{
 "query": {
    "filtered": {
      "filter": {
        "term": {"sourceMaterial.cellType": "Fibroblast"}
      }
    }
  }
}'
  • E.g. Search for all cell lines and return the names of the first 100: ~~~~ POST http://www.hipsci.org/lines/api/cellLine/_search ‘{ “size”: 100, “_source”: [“name”], “query”: {“match_all”: {}} }’ ~~~~

Search for donors: http://www.hipsci.org/lines/api/donor/_search

  • This endpoint supports any search option described in the Elasticsearch documentation on Full Body Search
  • Returns information in json format
  • E.g. Search for donors in the age range 20-24:
POST http://www.hipsci.org/lines/api/donor/_search
'{
  "query": {
    "filtered": {
      "filter": {
        "term": {"age": "20-24"}
      }
    }
  }
}'
  • E.g. Search for all donors and return the names of the first 100:
POST http://www.hipsci.org/lines/api/donor/_search
'{
  "size": 100,
  "_source": ["name"],
  "query": {"match_all": {}}
}'

Search for files: http://www.hipsci.org/lines/api/file/_search

  • This is the endpoint for assay data files, including QC, genomics, proteomics, and phenotyping data.
  • The file data structure is defined by this mapping. See this guide for information on Elasticsearch mapping definitions
  • This endpoint supports any search option described in the Elasticsearch documentation on Full Body Search
  • Returns information in json format
  • E.g. Search for assay files from cell line HPSI0214i-wibj_2:
POST http://www.hipsci.org/lines/api/file/_search
'{
  "query": {
    "filtered": {
      "filter": {
        "term": {"samples.name": "HPSI0214i-wibj_2"}
      }
    }
  }
}'