2017-03-14 3 views
0

SEMRUSH API https://www.semrush.com/api-analytics/#domain_rank에서 데이터를 가져 오려고 할 때 사람들이 backlinks_refdomains 및 backlinks_refips를 사용하여이 오류를 표시합니다.TypeError : semrush.backlinks_refdomains가 함수가 아닙니다.

그리고 동일한 함수 domain_rank를 호출하면 json 형식으로 응답했습니다. 이 일에서 나를 도울 수 있니? 첨부 된 이미지는 is is domain_rank하지만 baclinks 등과 같은 다른 요소는 제공하지 않습니다. 이 코드를 사용하고 있습니다.

` 

module.exports = { 
index: function(req,res){ 

    console.log("Hello welocme!"); 
    var SEMRushAPI = require('sails-semrush'); 
    var URL = "www.flipkart.com"; 
    var database = {database:'us'}; 
    var semrush = new SEMRushAPI('XXXXXXXXXXXXXXX'); 

semrush.backlinks(URL, database, function(err, response){ 
if (err){ 

     console.log("There is some error to fetching web traffic on API !"); 
     console.log("err: ",err); 
     console.log("There is some error to fetching web traffic on API !"); 
     }else{ 
       console.log("backlinks"); 
      console.log(" Response: ",response); 
      console.log("**************** Get the web traffic successfully ***************"); 
      console.log("******zone, country, ip*******"); 
     } 

semrush.backlinks_refdomains(URL, database, function(err, response){ 
      if (err){ 

     console.log("There is some error to fetching web traffic on API !"); 
     console.log("err: ",err); 
     console.log("There is some error to fetching web traffic on API !"); 
     }else{ 

console.log("domain_score_asc, domain_score_desc, backlinks_asc, backlinks_desc, last_seen_asc, last_seen_desc, first_seen_asc, first_seen_desc"); 
console.log(" Response: ",response); 
console.log("**************** Get the web traffic successfully **************"); 
console.log("zone, country, ip"); 
} 
}); 

`

This is image of my output, where i getting domain ranks but not backlinks can some one help me in this

미리 감사드립니다!

답변

0

함수에 close()를 시도합니까?

가 놓친 괄호 ')':

1) semrush.backlinks (URL, 데이터베이스, 기능 (ERR, 응답) {

이 문제를 해결하십시오 : semrush.backlinks (URL, 데이터베이스, 기능 (ERR, 응답)) {

2) semrush.backlinks_refdomains (URL, 데이터베이스, 기능 (ERR, 응답) {

를 해결하십시오 : semrush.backlinks_refdomains (URL, 데이터베이스, 기능 (ERR, 응답)) {

+0

안녕하세요. 응답을 보내 주셔서 감사합니다. 코드 작업도 시도했지만 작동하지 않았습니다. 그 오류를 보여줍니다 : TypeError : semrush.backlinks_refdomains는 함수가 아닙니다 –

+0

제가 이해한다면 수동으로 잘 작동하지만 코드에서는 그렇지 않습니까? 이 경우 개발자에게 'sails-semrush'를 요청해야합니다. 왜 그런 일이 발생합니까? 나는 당신이 이미 자신의 질문에 대한 답변을 그들의 측면에서 받았다. > https://github.com/scott-wyatt/sails-semrush/issues/2 –

+0

그리고 그것이라면 대괄호에는 아무런 문제가 없다. SyntaxError : 예기치 않은 토큰과 같은 오류를 내 경우에는 제공해야합니다. 즉, 내 코드가 괜찮음을 의미합니다. –

관련 문제