Scrazzl API - Examples

Overview

Here you'll find some example code snippets (presented in PHP) for interacting with our API.

Your API token (referenced below as API_TOKEN), and Platform (PLATFORM) emailed to you after your application has been submitted, is required for all requests.

DOI Lookup

DOI Lookup allows a user to query the Scrazzl database using a Digital Object Identifier (DOI). DOIs are used to uniquely identify scientific articles. Returned results are a list of specific product(s) identified in that article by the Scrazzl analysis engine.

Request:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.scrazzl.com/v2/articles/10.2353%2zABCXYZ.2010.091217/products?token=API_TOKEN&p=PLATFORM");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response = curl_exec($ch);
curl_close($ch);

var_dump($response);
Response:
{
  "meta" :
  {
    "list" :
    {
      "total" : 1
    }
  },

  "list" :
  [
    {
        "id": "1234505",
        "name": "ABC Antibody",
        "catalogueId": "ABC257505",
        "vendorName": "XYZ",
        "desc": "",
        "link": "https://example.com/v2/tracker/products/1234505/platform-name"
    }
  ]
}

Product Lookup

Product Lookup can be used to query the Scrazzl product database using product catalogue ID and vendor name. Responses include product ID, product name, catalogue ID, vendor name, description, unit, product URL, target, species cross reactivity, host species...etc.

Request:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.scrazzl.com/v2/products?cid=orb5649&vname=xyzComapny&token=API_TOKEN&p=PLATFORM");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response = curl_exec($ch);
curl_close($ch);

var_dump($response);
Response:
{
  "meta":
  {
    "list":
    {
      "total": "1",
      "offset":"0",
      "limit": "1"
    }
  },
  "list":
  [
    {
      "id": "123456",
      "name": "ABC Antibody",
      "catalogueId": "xxx5649",
      "vendorName": "XYZ",
      "desc": "Rabbit polyclonal to 12 Lipoxygenase",
      "unit": "100 μg",
      "link": "https://example.com/v2/tracker/products/1234505/platform-name"
    }
  ]
}

Vendor Lookup

Vendor Lookup can be used to query the Scrazzl vendor database for required limit from a given offset.

Request:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.scrazzl.com/v2/vendors?token=API_TOKEN&p=PLATFORM&offset=0&limit=4");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$response = curl_exec($ch);
curl_close($ch);

var_dump($response);
Response:
{
    "meta":
     {
         "list":
         {
             "total": "5097",
             "offset": "0",
             "limit": "4"
         }
     },
     "list":
     [
         {
             "name": "ABC Biochemicals"
             "productCount": "1878"
         },
         {
             "name": "XYZ Scientific"
             "productCount": "0"
         },
         {
             "name": "JKL Enterprises"
             "productCount": "27"
         },
         {
             "name": "New Bio, Inc"
             "productCount": "60759"
         }
     ]
}