Mat RESTful API

Material data center provides data and scientific analysis based on the open-source pakage. MAT API (Application Programming Interface) can make for users access database easily, and it's powerful because of intuitiveness. API is based on RESTful(REpresentational State Transfer) architecture that is suitable for analyze and get the materials. For more details on Mat RESTful API, please touch in our web site.

AUTHORIZATION

AUTH

v1/auth

Get Api key for searching
Output : Auth token (for 24hr)

                # GET user key
                # in PHP
                $curl = curl_init();

                curl_setopt_array($curl, array(
                  CURLOPT_URL => "https://api.snumat.com/v1/auth",
                  ...
                  CURLOPT_CUSTOMREQUEST => "GET",
                  CURLOPT_HTTPHEADER => array(
                    "authorization: Basic { YOUR-KEY(ID:YOUR ID, PW:YOUR PW) }",
                    "cache-control: no-cache",
                  ),
                ));
                $response = curl_exec($curl);
                $err = curl_error($curl);
                curl_close($curl);

                # Return
                # {
                #  key : "{ KEY }",
                #  date : "{ YYYY.MM.DD, hh:mm:ss }"
                # }
              
                # GET user key
                # in javascript
                var settings = {
                  "async": true,
                  "crossDomain": true,
                  "url": "https://api.snumat.com/v1/auth",
                  "method": "GET",
                  "headers": {
                    "authorization": "Basic { YOUR-KEY(ID:YOUR ID, PW:YOUR PW) }",
                  }
                }

                $.ajax(settings).done(function (response) {
                  console.log(response);
                });
                # Return
                # {
                #  key : "{ KEY }",
                #  date : "{ YYYY.MM.DD, hh:mm:ss }"
                # }
              
                # GET user key
                # in python
                import http.client

                conn = http.client.HTTPSConnection("api.snumat.com")
                headers = {
                    'authorization': "Basic { YOUR-KEY(ID:YOUR ID, PW:YOUR PW) }",
                    }

                conn.request("GET", "/v1/auth", , headers)

                res = conn.getresponse()
                data = res.read()

                print(data.decode("utf-8"))

                # Return
                # {
                #  key : "{ KEY }",
                #  date : "{ YYYY.MM.DD, hh:mm:ss }"
                # }
              
                # GET user key
                # in C#
                var client = new RestClient("https://api.snumat.com/v1/auth");
                var request = new RestRequest(Method.GET);
                request.AddHeader("authorization", "Basic { YOUR-KEY(ID:YOUR ID, PW:YOUR PW) }");
                # Return
                # {
                #  key : "{ KEY }",
                #  date : "{ YYYY.MM.DD, hh:mm:ss }"
                # }
              

GET

GET

v1/material/{indication}/{value}

Get material data by indications
Ex. ICSD, MDC-ID, Formula, Name

                # GET api for ICSD number
                # in PHP
                $curl = curl_init();

                curl_setopt_array($curl, array(
                  CURLOPT_URL => "https://api.snumat.com/v1/material/icsd/number",
                  ...
                  CURLOPT_CUSTOMREQUEST => "GET",
                  CURLOPT_HTTPHEADER => array(
                    "authorization: Basic {YOUR-KEY }",
                    "cache-control: no-cache",
                  ),
                ));
                $response = curl_exec($curl);
                $err = curl_error($curl);
                curl_close($curl);
              
                # GET api for ICSD number
                # in Javascript
                var settings = {
                  "async": true,
                  "crossDomain": true,
                  "url": "https://api.snumat.com/v1/material/icsd/number",
                  "method": "GET",
                  "headers": {
                    "authorization": "Basic {YOUR-KEY }",
                  }
                }

                $.ajax(settings).done(function (response) {
                  console.log(response);
                });
              
                # GET api for ICSD number
                # in Python
                import http.client

                conn = http.client.HTTPSConnection("api.snumat.com")

                headers = {
                    'authorization': "Basic {YOUR-KEY }",
                    }

                conn.request("GET", "/v1/material/icsd/number",, headers)

                res = conn.getresponse()
                data = res.read()

                print(data.decode("utf-8"))
              
                # GET api for ICSD number
                # in C#
                var client = new RestClient("https://api.snumat.com/v1/material/icsd/number");
                var request = new RestRequest(Method.GET);
                request.AddHeader("authorization", "Basic {YOUR-KEY }");
                IRestResponse response = client.Execute(request);