Description:
This API is designed to retrieve a list of any Youtube channel's TOP 10 most viewed videos using the provided YouTube video ID, of any video belonging to that channel, and requires an API key for authentication. The API utilizes the YouTube Data API to fetch information about the channel associated with the given video ID.
Parameters:
videoId
(required): The unique identifier of the YouTube video belngs to the channel you want to fetch the top 10 videos for.apikey
(required): An API key for authentication and authorization to use the YouTube Data API.
Response Format:
The API responds with a JSON-encoded list of top 10 videos, ordered by view count in descending order.
Error Handling:
- If an invalid video ID is provided or a missing API key, the API returns an HTML response with the message: "Video id or apikey is invalid or missing. Please try again."
- If an error occurs while fetching channel information or related videos, the API may respond with the message: "Error getting videos. Try again."
Example Usage:
https://oyehoyeai.com/apis/channel-top-10?videoId=video_id&apikey=your_api_key
Example Response:
Note:
- The API requires both
videoId
andapikey
parameters for a successful request. - The API key (
apikey
) is essential for authentication and authorization to access the YouTube Data API. - The error reporting and display are configured to assist users in troubleshooting potential problems related to invalid video IDs or missing API keys.