szdc / tiktok-api

Unofficial API wrapper for TikTok
MIT License
1.26k stars 279 forks source link

How can I get post information? #164

Closed frostysword closed 3 years ago

frostysword commented 4 years ago

I see you have been able to get posts using this: https://github.com/szdc/tiktok-api#getpostid

I'm trying to decipher how you do this, but I can't seem to figure it out.

I'll paste my code below. I've also tried putting aweme_id directly in the options instead of under params but it didn't work. How are you making this request?

function getTikTokStats() {
  try {
    var url = "https://api2.musical.ly/aweme/v1/aweme/detail/";
    var options = {   
      "followRedirects" : true,
      "muteHttpExceptions": true,
      "params": {
        "aweme_id": "6829058293818821893"
      }
    };
    var result = UrlFetchApp.fetch(url, options).getContentText();
    var json = JSON.parse(result);
  } catch(e) {
    Logger.log( e);
    return "ERROR";
  }
}
szdc commented 3 years ago

Closing as this project is no longer maintained.