Open in NPM
Install module
yarn add @subnik/socialmedia-scraper
or
npm i @subnik/socialmedia-scraper
Tiktok scraper v1
Using tiktok public api
const { tiktokV1 } = require('@subnik/socialmedia-scraper')
cons options = {
userAgents: null,
limit: 5,
downloadFile: false,
}
const res1 = await tiktokV1.getUser('lelepons', options)
const res2 = await tiktokV1.getFeedByUserId('186992876663578624', options)
const res3 = await tiktokV1.getFeedByUsername('lelepons', options)
const res4 = await tiktokV1.getFeedByTrend(options)
Instagram scraper v1
Using instagram public api
const { instagramV1 } = require('@subnik/socialmedia-scraper')
cons options = {
setUrl: (url) => url,
validateJson: false,
withDataModel: false,
downloadFile: false,
}
const res1 = await instagramV1.getProfile('lelepons', options)
const res2 = await instagramV1.getPost('CFuqxINhoRz', options)
Youtube scraper v1
Using youtube data api. Read more about (YOUTUBE DATA API Documentation)['https://developers.google.com/youtube/v3/getting-started']
NOTE: requires apiKey
from your google console
const { youtubeV1 } = require('@subnik/socialmedia-scraper')
cons options = {
apiKey: '',
withDataModel: false,
limit: 5,
downloadFile: false,
order: 'time',
searchTerm: ''
}
const res1 = await youtubeV1.getChannel('UC1KmNKYC1l0stjctkGswl6g', options)
const res2 = await youtubeV1.getChannelVideos('UC1KmNKYC1l0stjctkGswl6g', options)
const res3 = await youtubeV1.searchChannel('pewdiepie', options)
const res4 = await youtubeV1.getVideoComments('pSOOt4-40gU', options)