Request the latest top podcasts from the Apple chart API. This endpoint provides the current rankings of podcasts on Apple Podcasts for a specific country.
The chart data includes:
- Chart metadata (type, country, date)
- List of podcasts with their rankings
- Basic podcast information (title, Apple ID, etc.)
Fetch Top Podcasts Chart
No authentication required for this public endpoint
const options = {
method: "GET"
// note no authorization required for this endpoint
};
const result = await fetch(
"http://localhost:4000/api/v1/charts/latest?category=top+podcasts&chartType=apple&country=us",
options
);
const json = await result.json(); Notes
- The chart is updated daily
- Country parameter accepts ISO 3166-1 alpha-2 codes (e.g., "us", "gb", "ca")
- Category parameter supports various genres like "true-crime", "comedy", etc.
Now that you have the list of top podcasts, iterate through each one to fetch their reviews. Each podcast has a unique ID that can be used to retrieve detailed review information.
The reviews endpoint provides:
- User ratings and written reviews
- Review metadata (date, username, rating)
- Pagination support for large review sets
Fetch Reviews for Each Podcast
Requires authentication token
const { chart, podcasts } = json.data.chart;
for (const podcast of podcasts) {
const { id, title, appleId } = podcast;
const options = {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "YOUR_API_TOKEN"
}
};
const reviewsResponse = await fetch(
`http://localhost:4000/api/v1/podcasts/${id}/reviews?country=us&limit=100`,
options
);
const reviewData = await reviewsResponse.json();
const reviews = reviewData.data.podcastReviews.applePodcastReview;
console.dir(reviews, { depth: null });
} Warning
- This endpoint requires authentication - ensure your API token is valid
- Be mindful of rate limits when fetching reviews for many podcasts
- The limit parameter maximum is 100 reviews per request
Notes
- Reviews are returned in reverse chronological order (newest first)
- Use pagination parameters (offset, limit) for large review sets
- Consider implementing retry logic for network failures