Unsplashed background img 1
  • code Information about REST API

    • codeWhat is a REST API?

      REST is an abbreviation for representational state transfer. It can be used to retrieve data from ArachisPheno using a specially formatted URL. You also can write custom scripts (e.g. in Python, Perl, Java, etc.) to request and download the information you need.

      All REST commands will start with the following prefix: /rest/

      More information can be found at Wikipedia: What is REST?

    • codeHow to get a list of all phenotypes?

      You can use one of the following URLs to retrieve a list of phenotypes.

      For CSV format: <BASE_URL>/rest/phenotype/list.csv

      For JSON format: <BASE_URL>/rest/phenotype/list.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get details for a certain phenotype?

      You can use either the primary id or DOI to access certain details for a phenotype. Just replace <q> with the phenotype id or DOI.

      For CSV format: <BASE_URL>/rest/phenotype/<q>.csv

      For JSON format: <BASE_URL>/rest/phenotype/<q>.json

      Example: <BASE_URL>/rest/phenotype/1.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get all phenotype values and accession information for a certain phenotype?

      You can use either the primary id or DOI to get all phenotype values for a certain phenotype. Just replace <q> with the study id or DOI and extend URL with /phenotypes and extend the URL with /values

      For CSV format: <BASE_URL>/rest/phenotype/<q>/values.csv

      For JSON format: <BASE_URL>/rest/phenotype/<q>/values.json

      Example: <BASE_URL>/rest/phenotype/1/values.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get transformed phenotype values for a certain phenotype?

      You can use either the primary id or DOI to get transformed phenotype values for a certain phenotype. Just replace <q> with the phenotype id or DOI. This will return transformed phenotype values for all transformations (sqrt, Box-Cox, log)

      For CSV format: <BASE_URL>/rest/phenotype/<q>/transformations.csv

      For JSON format: <BASE_URL>/rest/phenotype/<q>/transformations.json

      Example: <BASE_URL>/rest/phenotype/1/transformations.json

      It is also possible to retrieve the transformed phenotype values for a specific transformation by extending the URL with the desired transformation name: <BASE_URL>/rest/phenotype/1/transformations/box_cox.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get a list of all studies?

      You can use one of the following URL to retrieve a list of studies.

      For CSV format: <BASE_URL>/rest/study/list.csv

      For JSON format: <BASE_URL>/rest/study/list.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get details for a certain study?

      You can use either the primary id or DOI to access certain details for a study. Just replace <q> with the study id or DOI.

      For CSV format: <BASE_URL>/rest/study/<q>.csv

      For JSON format: <BASE_URL>/rest/study/<q>.json

      Example: <BASE_URL>/rest/study/1.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get all phenotypes for a certain study?

      You can use either the primary id or DOI to access a list of all phenotypes for a study. Just replace <q> with the study id or DOI and extend URL with /phenotypes.

      For CSV format: <BASE_URL>/rest/study/<q>/phenotypes.csv

      For JSON format: <BASE_URL>/rest/study/<q>/phenotypes.json

      Example: <BASE_URL>/rest/study/1/phenotypes.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get a list of all accessions?

      You can use one of the following URL to retrieve a list of accessions.

      For CSV format: <BASE_URL>/rest/accession/list.csv

      For JSON format: <BASE_URL>/rest/accession/list.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get details for a certain accession?

      You can use the accession id to access certain details for an accession. Just replace <q> with the accession id.

      For CSV format: <BASE_URL>/rest/accession/<q>.csv

      For JSON format: <BASE_URL>/rest/accession/<q>.json

      Example: <BASE_URL>/rest/accession/PI 497318.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get all phenotypes for a certain accession?

      You can use the accession id to access a list of all phenotypes for this accession. Just replace <q> with the accession id and extend URL with /phenotypes.

      For CSV format: <BASE_URL>/rest/accession/<q>/phenotypes.csv

      For JSON format: <BASE_URL>/rest/accession/<q>/phenotypes.json

      Example: <BASE_URL>/rest/accession/PI 497318/phenotypes.json

      A more detailed API description can be found here: API Documentation

    • codeHow to get all phenotypes for a list of accessions?

      You send a POST request with a list of accession ids (comma-separated) and the REST endpoint will return a map with accession_id → list of phenotypes.
      Example (cURL): curl --request POST --url <BASE_URL>/rest/accession/phenotypes/ --header 'content-type: text/plain' --data 'PI 497318,PI 497395'

      The response will contain a JSON dict with the following format:

          {
              "PI 497318": [
                  {...,"phenotype_id":1,"name":"#1_kernel_weight",...},
                  {...,"phenotype_id":2,"name":"all_other_seed_types_weight",...},
                  ...
              ],
              "PI 497395": [
                  {...,"phenotype_id":1,"name":"#1_kernel_weight",...},
                  {...,"phenotype_id":2,"name":"all_other_seed_types_weight",...},
                  ...
              ],
              ...
          }
                              

      A more detailed API description can be found here: API Documentation

    • codeHow to do a database search with REST?

      You can use the following URL to perform a search. Just replace <query> with your search query (e.g. with a phenotype name). If the search query is empty you will get a list with all phenotypes and studies.

      For CSV format: <BASE_URL>/rest/search/<query>.csv

      For JSON format: <BASE_URL>/rest/search/<query>.json

      Example: <BASE_URL>/rest/search/at.json

      A more detailed API description can be found here: API Documentation

    • codeHow to retrieve phenotype correlations via REST?

      You can use the following URL to compute phenotype-phenotype correlations. Just replace <query> with a comma-separated list of phenotype ids. Note that for this query we only support JSON as output format.

      <BASE_URL>/rest/correlation/<query>/

      Example: <BASE_URL>/rest/correlation/2,3,5,7,11,13,17,19,23,29/

      A more detailed API description can be found here: API Documentation

    • codeHow to submit your study via REST?

      You can submit a study by sending a POST request containing the study file in ISA-TAB or PLINK format and additional form fields (i.e. firstname, lastname, email) to the following URL: <BASE_URL>/rest/submission/
      The response will contain information about the submission (see below)

      Example (cURL): curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "file=@" -F "firstname=John" -F "lastname=Doe" -F "email=john@doe.com" "<BASE_URL>/rest/submission/"

      A more detailed API description can be found here: API Documentation

    • codeHow to get details for a submission?

      You can use the submission_id to view details such as its status and curation. Just replace <q> with the submission_id:

      <BASE_URL>/rest/submission/<q>.json

      A more detailed API description can be found here: API Documentation

    • codeHow to delete a submission?

      You can use the submission_id to delete by sending a DELETE request. Just replace <q> with the submission_id:

      <BASE_URL>/rest/submission/<q>/delete

      Example (cURL): curl -X DELETE -H "Cache-Control: no-cache" "<BASE_URL>/rest/submission/[SUBMISSION_ID]/delete"

      A more detailed API description can be found here: API Documentation