Get Top 10 Albums of a Category
This recipe was an interactive walkthrough in the previous portal. Each step below names the API call it makes; open it in the API Reference to try it.
Getting Started
Introduction
Welcome to this API Recipe, where we'll show you how to retrieve the Top 10 albums within a category even when you don't know the Category ID. This API Recipe will help you navigate through the API endpoints effectively, ensuring you can access the desired information efficiently.
Details
During this walkthrough, we'll be utilizing two key endpoints to achieve our goal:
-
Get Categories: This endpoint allows us to retrieve a list of available categories, crucial for identifying the category we're interested in.
-
Get a Categories Playlists: Once we've identified the desired category, we'll use this endpoint to fetch the playlists within that category. This step requires passing the Category ID obtained from the previous endpoint.
Note: For this API Recipe, we'll automatically pass the Category ID of the first Cateogry fetched in Step 1. However, you can update the Cateogry ID if needed.
By following this API Recipe, you'll gain a deeper understanding of how to efficiently retrieve album information within a category, even without prior knowledge of its Category ID. Let's dive in!
Step 1: Get Categories
Description
This endpoint allows us to retrieve a list of available categories, crucial for identifying the category we're interested in.
API call: get-categories
Step 2: Get a Categories Playlists
Description
Once we've identified the desired category, we'll use this endpoint to fetch the playlists within that category. This step requires passing the Category ID obtained from the previous endpoint.
API call: get-a-categories-playlists
Example arguments:
{
category_id: categoryId,
limit: 10,
offset: 0,
}
