Skip to main content
Published: December 04 2014, 2:00:00 AMUpdated: August 29 2022, 3:56:27 PM


The below code sample shows how to make an HTTP POST call using node.js to execute GetItem API call.

You need to replace the text "INSERT_YOUR_USER_TOKEN" with your production user token and insert a valid ItemID.


var xml = '<?xml version="1.0" encoding="utf-8"?>'+
'<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">'+

var https = require('https');

var options = {
host: "",
path: "/ws/api.dll",
method: "POST",
headers: {
    'X-EBAY-API-CALL-NAME': 'GetItem',
    'Content-Type' : 'text/xml',

var req = https.request(options, function (res)
   console.log("statusCode: ", res.statusCode);
   console.log("headers: ", res.headers);

   res.on('data', function (d)




req.on('error', function (e)
   console.error('error=======', e);


How well did this answer your question?
Answers others found helpful