var md5=require('md5-node');

let appKey='appKey'

let TimeSpan=Math.round(new Date /1000);

let secretKey='secretKey';

let Token=md5(appKey+TimeSpan+secretKey).toUpperCase();

var http = require("http");
var querystring = require('querystring');

var data = {key:appKey,keyword:'您的搜索关键字'};
var content = querystring.stringify(data);

var options = {
    hostname:'api.qichacha.com',
    method:'GET',
    path:'/XXXXXX?'+content,
    headers:{
        "Token": Token,
        "Timespan":TimeSpan
    }
}

var req = http.request(options, function (res) {
    console.log('STATUS: ' + res.statusCode);
    console.log('HEADERS: ' + JSON.stringify(res.headers));
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log('BODY: ' + chunk);
    });
});

req.on('error', function (e) {
    console.log('problem with request: ' + e.message);
});

req.end();