Views From $ 3.40 High retention views From $ 3.00 Subscribers From $ 0.50 Likes From $ 7.50 Watch Time From $ 66.50 Comments From $ 8.50 Live Stream views From $ 7.50 Packages From $ 8.13 CTR Views From $ 12.50 Views AdWords From $ 12.00 SEO Keyword Ranking From $ 20.00 Shares From $ 6.00 Video SEO Optimization From $ 20.00 Comment Likes From $ 1.60 Channel/Video Production From $ 16.00 Virtual Assistants From $ 80.00 Comment Replies From $ 2.25 Live Stream Reactions From $ 2.65 Followers From $ 9.75 Likes From $ 3.00 Views From $ 7.65 Reel Likes From $ 3.60 Packages From $ 21.60 Comments From $ 1.28 Impressions From $ 2.55 Live Video Views From $ 1.25 Reel Views From $ 3.40 Saves From $ 4.25 Story Views From $ 2.70 Data scraper From $ 0.30 Channel Members From $ 2.00 Followers From $ 8.40 Views From $ 0.96 Likes From $ 4.50 Live Views From $ 8.50 Packages From $ 12.80 Shares From $ 4.20 Comments From $ 4.05 Channel Subscribers From $ 0.50 Private Group/Channel Members From $ 9.00 Post Views From $ 0.50 Channel Boost From $ 0.09 Reactions From $ 0.96 Comments From $ 1.00 Shares From $ 1.00 Packages From $ 2.20 Referrals for Hamster From $ 2.30 Referrals for Telegram bots From $ 0.10 First comments on post From $ 20.00 Page Likes From $ 18.00 Photo/Post Likes From $ 6.80 Post Likes From $ 6.00 Subscribers From $ 12.00 Live Stream views From $ 15.00 Shares From $ 4.00 Reels views From $ 3.27 Group Followers From $ 8.00 Comments From $ 0.30 Video Views From $ 4.50 Page Reviews From $ 4.00 Post Likes Emoji From $ 1.75 Add to Friends From $ 23.00 Packages From $ 5.40 Traffic from Google From $ 0.23 Traffic from Other Sources From $ 0.23 Traffic from Facebook From $ 0.29 Traffic from Youtube From $ 0.29 Traffic from Instagram From $ 0.29 Traffic from Amazon From $ 0.23 Traffic from Twitter From $ 0.29 Traffic from Bing.com From $ 0.29 Traffic from Twitch.tv From $ 0.23 Traffic from Wikipedia From $ 0.23 Traffic from Reddit From $ 0.23 Traffic from Yahoo From $ 0.23 Traffic from Quora From $ 0.23 Traffic from Ebay From $ 0.23 Traffic from LinkedIn From $ 0.23 Followers From $ 40.00 Likes From $ 21.00 Impressions From $ 1.20 Retweets From $ 10.00 Comments From $ 4.50 Video Views From $ 5.00 Packages From $ 19.80 Live Stream views From $ 3.00 Followers From $ 6.00 Channel Design From $ 42.75 Packages From $ 64.80 Followers From $ 17.85 Chatters From $ 7.00 Live views From $ 14.00 Package From $ 2.43 Monthly Listeners From $ 8.40 Plays From $ 1.50 Followers From $ 20.00 Likes From $ 3.00 Playlist reposts From $ 17.40 Reposts From $ 7.80 Package From $ 8.92 Live Stream Viewers From $ 2.40 Followers From $ 25.20 Views From $ 6.00 Followers From $ 30.00 Post Likes From $ 2.80 Post Shares From $ 2.70 Custom Comments From $ 5.20 Add coin to favorites From $ 100.00 Post likes From $ 45.00 Reposts From $ 45.00 Followers From $ 35.00 Package From $ 78.00 Add coin to favorites From $ 6.00 Views From $ 2.00 Likes From $ 1.75 Followers From $ 2.24 Views From $ 2.36 Reviews From $ 2.20

How can I use the JS API for a widget?

Advice and answers from the Views.biz Team

Ask us a question

Using the widget's JS API, the site owner has the ability to programmatically control the widget.


For example: On your site (in the header of the site) there is an input field for the URL and a "Buy Views" button. Using the setUrl method, you can copy data from your field to a similar field on the widget.


Use this to return all networks with their id:


widget.getNetworks()

In each network you will see the serviceTypes field. From there you need to take the services id.


Usage example:

window.vastServiceOrderWidget({ 
mountTargetSelector: '#order-widget', 
apiUrl: 'https:/api.url/', 
apiToken: 'sometoken', 
language: 'ru', 
currency: 'RUB' 
}) 
.onInit((widget, event) => { 
widget.selectNetwork(1) 
widget.selectServices([1, 3]) 
widget.setURL('via API') 
widget.setEmail('[email protected]') 
console.log('getNetworks', widget.getNetworks()) 
console.log('getSelectedNetwork', widget.getSelectedNetwork())
console.log('getServices', widget.getServices()) 
сonsole.log('getSelectedServices', widget.getSelectedServices()) 
}) 
.onNetworkSelected((widget, id) => { 
console.log('onNetworkSelected', id); 
}) 
.onServicesSelected((widget, ids) => { 
console.log('onServicesSelected', ids); 
}) 
.onInvoiceCreated((widget, event) => { 
console.log('onInvoiceCreated', event) 
}) 
.onURLInput((widget, url) => { 
console.log('onURLInput', 'getURL', widget.getURL()) 
}) 
.onEmailInput((widget, email) => { 
console.log('onEmailInput', 'getEmail', widget.getEmail()) 
}) 
.onCost((widget, event) => { 
console.log('onCost', event) 
}) 
.onFormSend((widget) => { 
console.log('onFormSend')