CoolFace
Datasetpublic

Kossisoroyce/Spotify-Africa-Dataset

Spotify-Africa Music Dataset 🎡🌍 A comprehensive, research-grade dataset documenting African music from Spotify spanning 1,600+ tracks, 650+ artists, and 67 years of musical history (1958-2025). Dataset Summary This dataset provides rich metadata about African music across multiple genres, regions, and time periods. It includes track-level information, artist metadata, temporal trends, regional summaries, and network relationships. The data was collected via the… See the full description on the dataset page: https://huggingface.co/datasets/Kossisoroyce/Spotify-Africa-Dataset.

sourceHugging Facecc-by-4.0updated 11mo agoView on Hugging Face
0likes75downloads
Dataset Card

Spotify-Africa Music Dataset 🎡🌍

A comprehensive, research-grade dataset documenting African music from Spotify spanning 1,600+ tracks, 650+ artists, and 67 years of musical history (1958-2025).

Dataset Summary

This dataset provides rich metadata about African music across multiple genres, regions, and time periods. It includes track-level information, artist metadata, temporal trends, regional summaries, and network relationships. The data was collected via the Spotify Web API and enriched with derived features for immediate research use.

Key Statistics

  • β€”Total Tracks: 1,600+ unique tracks
  • β€”Artists: 650+ African artists
  • β€”Geographic Coverage: 5 regions (West, East, Southern, Central, North Africa)
  • β€”Temporal Span: 1958-2025 (67 years)
  • β€”Genres: 15+ African music genres including Afrobeats, Amapiano, Bongo Flava, Highlife, Gqom
  • β€”Data Quality: 92% metadata completeness
  • β€”Popular Tracks: 314 tracks with popularity >50

Supported Tasks

  • β€”Music Genre Classification: Train models to identify African music genres
  • β€”Popularity Prediction: Predict track success based on metadata
  • β€”Temporal Trend Analysis: Study the evolution of African music over decades
  • β€”Regional Comparison: Compare music characteristics across African regions
  • β€”Artist Network Analysis: Map collaboration and influence patterns
  • β€”Market Analysis: Study track availability and penetration across markets

Dataset Structure

Available Datasets

The collection is organized into 20 curated datasets, each optimized for specific research tasks:

Core Track Datasets
  1. 1.master_tracks - Unified dataset merging all collections with enriched features (1,217 tracks)
  2. 2.analysis_ready_tracks - Clean, high-quality subset from top 30 artists (155 tracks)
  3. 3.scaled_tracks - Large-scale collection via genre/market searches (979 tracks)
  4. 4.comprehensive_tracks - Regional diversity focus (355 tracks)
  5. 5.popular_tracks - Top tracks from leading artists (100 tracks)
Enriched Datasets
  1. 1.enriched_tracks - Tracks with regional, temporal, and popularity annotations
  2. 2.enriched_artist_summary - Artist-level aggregations with hit ratios and recency
  3. 3.enriched_region_summary - Regional roll-ups with volume and popularity metrics
Artist Datasets
  1. 1.analysis_ready_artists - Artist metadata for top-tier acts
  2. 2.popular_artists - Follower and popularity data for influential artists
  3. 3.artist_summary - Legacy artist aggregations
Specialized Datasets
  1. 1.genre_analysis - Genre-tagged subset for classification tasks
  2. 2.ml_training_popular - High-popularity tracks for supervised learning
  3. 3.temporal_analysis - Year-level aggregations for trend studies
  4. 4.temporal_trends - Time-series data from scaled collection
Network Datasets
  1. 1.artist_network - Curated collaboration networks (JSON)
  2. 2.artist_networks - Raw related-artist mappings (JSON)

Each dataset is available in both CSV and Parquet formats, with accompanying documentation in dataset_card.md.

Data Fields

Track-Level Fields (mastertracks, enrichedtracks, etc.)
  • β€”track_id: Spotify track ID
  • β€”track_name: Track title
  • β€”artist_id: Spotify artist ID
  • β€”artist_name: Artist name
  • β€”album_id: Spotify album ID
  • β€”album_name: Album title
  • β€”album_type: album/single/compilation
  • β€”release_date: Release date (YYYY-MM-DD or YYYY)
  • β€”release_year: Extracted release year
  • β€”popularity: Spotify popularity score (0-100)
  • β€”duration_ms: Track duration in milliseconds
  • β€”explicit: Boolean explicit content flag
  • β€”available_markets: Number of markets where track is available
  • β€”preview_url: URL to 30-second preview
  • β€”spotify_url: Link to Spotify track page
Enriched Fields (enrichedtracks, mastertracks)
  • β€”country: Inferred artist country
  • β€”region: Geographic region (West/East/Southern/Central/North Africa)
  • β€”release_decade: Decade of release
  • β€”release_era: Era classification (Classic/Early Digital/Modern/Contemporary)
  • β€”track_age_years: Age relative to 2025
  • β€”popularity_tier: Hit/Popular/Emerging/Niche
  • β€”market_scope: Global/Regional/Local
  • β€”region_popularity_percentile: Percentile rank within region
  • β€”is_hit: Boolean (popularity >= 70)
  • β€”is_recent: Boolean (released >= 2022)
  • β€”is_classic: Boolean (released < 2000)
Artist-Level Fields
  • β€”artist_id: Spotify artist ID
  • β€”artist_name: Artist name
  • β€”artist_genres: Comma-separated genre list
  • β€”popularity: Artist popularity score (0-100)
  • β€”followers: Total Spotify followers
  • β€”track_count: Number of tracks in dataset
  • β€”avg_popularity: Average track popularity
  • β€”hit_count: Number of hit tracks
  • β€”hit_ratio: Proportion of tracks that are hits

Data Splits

No predefined train/validation/test splits are provided. Users should create splits appropriate to their research questions, considering:

  • β€”Temporal splits: Train on pre-2020, test on 2020+
  • β€”Regional splits: Train on specific regions, test on others
  • β€”Artist-based splits: Prevent artist leakage across splits
  • β€”Popularity-stratified splits: Ensure balanced representation

Dataset Creation

Source Data

Data was collected from the Spotify Web API between October 2025, targeting African music across multiple collection strategies:

  1. 1.Curated Artist Lists: Top 30 African superstars (Burna Boy, Wizkid, Davido, etc.)
  2. 2.Genre-Based Search: 15+ African genres (Afrobeats, Amapiano, Bongo Flava, etc.)
  3. 3.Market-Based Search: 10 African markets (Nigeria, South Africa, Kenya, Ghana, etc.)
  4. 4.Regional Crawl: Systematic coverage of 5 geographic regions
  5. 5.Network Expansion: Related artist mappings for collaboration analysis

Collection Methodology

  • β€”Rate-Limited API Calls: Respectful polling with exponential backoff
  • β€”Deduplication: Track IDs deduplicated across collection runs
  • β€”Quality Filtering: Manual curation of artist lists for regional representation
  • β€”Enrichment Pipeline: Post-processing to infer geographic and temporal metadata

Annotations

Regional Inference

Artist countries and regions were inferred using:

  1. 1.Manual mapping of 60+ headline African artists
  2. 2.ISO market code lookups from search context
  3. 3.Spotify market availability heuristics
Temporal Annotations

Release eras classified as:

  • β€”Classic (pre-2000): Traditional and heritage music
  • β€”Early Digital (2000-2009): Transition to digital distribution
  • β€”Modern (2010-2019): Golden age of Afrobeats globalization
  • β€”Contemporary (2020-2025): Current streaming era
Popularity Tiers

Tracks categorized by Spotify popularity scores:

  • β€”Hit (70-100): Mainstream chart success
  • β€”Popular (50-69): Strong audience engagement
  • β€”Emerging (30-49): Growing traction
  • β€”Niche (0-29): Specialized or catalog content

Data Quality

  • β€”Metadata Completeness: 92%
  • β€”Popularity Scores Available: 85% of tracks
  • β€”Release Date Coverage: 98% of tracks
  • β€”Genre Labels: 70% of tracks
  • β€”Regional Tagging: 100% (via inference)

Known Limitations:

  • β€”Audio features (tempo, danceability, energy, etc.) unavailable due to Spotify API restrictions
  • β€”Central and North Africa underrepresented (Spotify penetration lower)
  • β€”Pre-2000 historical music coverage limited (150 tracks)
  • β€”Focus on mainstream artists; independent/underground scenes undersampled

Usage

Loading the Dataset

Using Pandas
python
import pandas as pd

# Load master track dataset (CSV)
df = pd.read_csv('data/datasets/master_tracks/master_tracks_20251030_135608.csv')

# Or use Parquet for faster loading
df = pd.read_parquet('data/datasets/master_tracks/master_tracks_20251030_135608.parquet')

print(f"Loaded {len(df):,} tracks")
print(df.head())
Using Hugging Face Datasets
python
from datasets import load_dataset

# Load specific dataset
dataset = load_dataset('Kossisoroyce/Spotify-Africa-Dataset', data_files='data/datasets/master_tracks/*.parquet')

# Access as pandas DataFrame
df = dataset['train'].to_pandas()

Example Analyses

1. Genre Distribution
python
import matplotlib.pyplot as plt

# Load genre-tagged tracks
df = pd.read_parquet('data/datasets/genre_analysis/genre_analysis_20251030_134044.parquet')

# Count tracks per genre
genres = df['artist_genres'].str.split(', ', expand=True).stack()
top_genres = genres.value_counts().head(10)

top_genres.plot(kind='barh', title='Top 10 African Music Genres')
plt.xlabel('Track Count')
plt.show()
2. Popularity Prediction
python
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestRegressor

# Load ML training set
df = pd.read_parquet('data/datasets/ml_training_popular/*.parquet')

# Prepare features
X = df[['release_year', 'duration_ms', 'explicit', 'available_markets']]
y = df['popularity']

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Train model
model = RandomForestRegressor(n_estimators=100, random_state=42)
model.fit(X_train, y_train)

print(f"RΒ² Score: {model.score(X_test, y_test):.3f}")
3. Temporal Trends
python
import seaborn as sns

# Load temporal analysis
df = pd.read_csv('data/datasets/temporal_analysis/*.csv')

plt.figure(figsize=(12, 6))
plt.plot(df['release_year'], df['avg_popularity'], marker='o')
plt.title('Average Track Popularity Over Time')
plt.xlabel('Year')
plt.ylabel('Avg Popularity Score')
plt.grid(True, alpha=0.3)
plt.show()
4. Regional Comparison
python
# Load enriched tracks
df = pd.read_parquet('data/datasets/enriched_tracks/*.parquet')

# Compare regions
regional_stats = df.groupby('region').agg({
    'track_id': 'count',
    'popularity': 'mean',
    'is_hit': 'mean'
}).round(2)

print(regional_stats)

Citation

If you use this dataset in your research, please cite:

bibtex
@dataset{spotify_africa_dataset_2025,
  title={Spotify-Africa Music Dataset: A Comprehensive Collection of African Music Metadata},
  author={Spotify-Africa Dataset Project},
  year={2025},
  publisher={Hugging Face},
  howpublished={\url{https://huggingface.co/datasets/Kossisoroyce/Spotify-Africa-Dataset}}
}

Licensing

This dataset is released under CC BY 4.0 (Creative Commons Attribution 4.0 International).

You are free to:

  • β€”Share β€” copy and redistribute the material
  • β€”Adapt β€” remix, transform, and build upon the material

Under the following terms:

  • β€”Attribution β€” You must give appropriate credit and indicate if changes were made

Note: Track previews and Spotify links are subject to Spotify's Terms of Service. This dataset contains metadata only, not audio files.

Ethical Considerations

Representation

  • β€”Geographic Bias: West and Southern Africa heavily represented; Central and North Africa undersampled
  • β€”Platform Bias: Dataset reflects Spotify's catalog and recommendation algorithms
  • β€”Mainstream Bias: Focus on popular artists; independent labels and emerging artists underrepresented
  • β€”Language: Track and artist names in original languages (English, Yoruba, Zulu, Swahili, Arabic, etc.)

Intended Use

Recommended:

  • β€”Academic research on African music evolution and globalization
  • β€”Music recommendation system development
  • β€”Cultural heritage documentation
  • β€”Market analysis for music industry professionals
  • β€”Educational materials on African music diversity

Not Recommended:

  • β€”Claiming dataset represents "all" African music
  • β€”Making cultural generalizations based solely on this data
  • β€”Commercial use without proper attribution
  • β€”Reproducing Spotify proprietary metrics without permission

Privacy

  • β€”Only public Spotify metadata is included
  • β€”No user listening data or personally identifiable information
  • β€”All artist/track IDs are public Spotify identifiers

Updates and Maintenance

  • β€”Last Updated: October 30, 2025
  • β€”Version: 1.0.0
  • β€”Refresh Cadence: Dataset is a point-in-time snapshot; popularity scores and market availability will drift

To request updates or report issues, please open an issue on the repository.

Acknowledgments

  • β€”Data Source: Spotify Web API
  • β€”Regional Expertise: Curated artist lists informed by music journalism and industry knowledge
  • β€”Tools: Python, pandas, spotipy, pyarrow

Special thanks to the African music community for creating this incredible body of work.

Contact

For questions, collaborations, or dataset extensions, please reach out via the repository issues or discussions.

Repository: https://huggingface.co/datasets/Kossisoroyce/Spotify-Africa-Dataset


Explore African Music. Celebrate Diversity. Amplify Voices. 🌍🎢