make call to ORCID public api using node js

273 Views Asked by At

I am very new in ORCID and studied it's documentation from http://orcid.org/. But i have to call some of it's public api from nodejs code.I have searched a lot but not getting anything related to this. Please anyone help me. Thanks

1

There are 1 best solutions below

1
tom On

The ORCID public v2.0 API supports swagger. Although not yet complete at the time of writing (it's missing bio information), the API allows querying of activities listed on an ORCID record. As it supports swagger, you can use swagger-js to generate a client.

You can use it like this:

  var myORCID = "0000-0003-0902-4386";
  swagger = new SwaggerClient({
    url: "https://pub.orcid.org/resources/swagger.json",
    success: function() {
      swagger.apis["Public API v2.0"].viewActivities({orcid:myORCID},{responseContentType: 'application/json'}, function(data) {
        //do stuff with the JSON
      });
    }
  });

For more info and examples, read this quickstart guide to ORCID with swagger.