https://github.com/mubtasimf443/lib-tiktok-api-npm-package
lib-tiktok-api is a npm package what is use for handling tiktok apis from nodejs
https://github.com/mubtasimf443/lib-tiktok-api-npm-package
javascript-library nodejs tiktok tiktok-api tiktok-apis tiktok-tool tiktokbot
Last synced: 8 months ago
JSON representation
lib-tiktok-api is a npm package what is use for handling tiktok apis from nodejs
- Host: GitHub
- URL: https://github.com/mubtasimf443/lib-tiktok-api-npm-package
- Owner: Mubtasimf443
- Created: 2024-12-24T16:50:02.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-07T13:08:21.000Z (9 months ago)
- Last Synced: 2025-02-09T05:47:01.085Z (8 months ago)
- Topics: javascript-library, nodejs, tiktok, tiktok-api, tiktok-apis, tiktok-tool, tiktokbot
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/lib-tiktok-api
- Size: 454 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
this is a npm package for handling tiktok api's
## Get Started
```
let tiktok=new Tiktok({
key :TIKTOK_KEY,
secret:TIKTOK_SECRET,
redirect_uri :TIKTOK_REDIRECT_URI,
scope :['user.info.basic','video.upload','video.publish']
})```
## Auth with tiktok-api
#### First get a auth url for authentication
```
app.get('/auth',async function (req,res){
return res.redirect(tiktok.getAuthUrl());
});```
#### get access token and refresh token
```
app.get('/callback',async function (req,res){
let {access_token,refresh_token}=await tiktok.getAccessToken(req.query.code);
})
```### Tiktok video upload
#### init video upload to inbox
```
let Account=new tiktok.Account("" ,'');
let data=await Account.initVideoOnInbox('https://gojushinryu.com/video-for-download');
```access_token is required in the new tiktok.Account and refresh_token is not requied ,
refresh_token is only required when using Account.updateTokens api;#### upload video directly
```
let Account=new tiktok.Account(access_token ,refresh_token);
let response =await Account.postTiktokFromUrl({
video_url :'',
privacy_level :'SELF_ONLY',
title :"',
video_cover_timestamp_ms : 1000 // optional
})```
#### upload images to tiktok
```
let Account=new tiktok.Account(access_token ,refresh_token);
let post_id= await Account.uploadImages({
images:["https://tiktokcdn.com/obj/example-image-01.webp","https://tiktokcdn.com/obj/example-image-02.webp"],
caption :"this will be a #funny photomode on your @tiktok #fyp"
})```
#### get user info
```
let Account=new tiktok.Account(access_token ,refresh_token);
let data=await Account.getUserInfo()```
#### get new access token
```
let TIKTOK_KEY="";
let Account=new tiktok.Account(access_token ,refresh_token);
let data=await Account.updateTokens({app_key});
```Follow ME
***I will be very happy if you support me by following me or offering me a job***