N
N
Nikita2019-11-26 10:35:33
YouTube
Nikita, 2019-11-26 10:35:33

How to check if a user is subscribed to a YouTube channel when organizing VIP access?

Hello dear, there is a site on wordpress
How to check if a user is subscribed to a channel or not? Provided that he is authorized on the site
Purpose; creation of closed content for YouTube subscribers

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2019-11-26
@otgamera

You need to ask the user to log in through your YouTube app and give permission youtube.readonlyto access their data.
See the YouTube Data API subscriptions:list method . Pay attention to the example “check whether a subscription exists” - just your task, and there are code examples, incl. in PHP (scroll to the right).
To work with PHP , you need to install the Google PHP SDK: composer require google/apiclient:^2.0, create a project in the API console , create an OAuth key, download its JSON.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question