Skip to content

Repository files navigation

Audio Virality Analytics API

Analyze trending audio on Instagram Reels using AI.

Features

  • 🎵 Classify audio as music or speech
  • 🧠 Cluster similar audio together
  • 📊 Extract viral content patterns (hashtags, captions, triggers)
  • 🎯 Filter by content category

Quick Start

1. Clone the Repository

git clone https://github.com/yourusername/audio-analytics.git
cd audio-analytics

2. Setup Environment

# Copy the environment template
cp .env.example .env

# Edit .env with your API keys
nano .env

3. Get API Keys

You'll need free accounts for:

4. Run the API

# With Docker (recommended)
docker build -t audio-analytics .
docker run -p 8000:8000 --env-file .env audio-analytics

# Or without Docker
pip install -r requirements.txt
uvicorn api:app --host 0.0.0.0 --port 8000

5. Use the API

Open your browser: http://localhost:8000/docs

API Endpoints

POST /api/v1/analyze

Analyze audio trends.

{
  "category": "fitness",
  "top_n_clusters": 5,
  "top_k_posts": 3
}

GET /api/v1/stats

Get database statistics.

GET /api/v1/categories

List available categories.

Environment Variables

Copy .env.example to .env and fill in:

  • ASSEMBLYAI_API_KEY - Your AssemblyAI key
  • OPENROUTER_KEY - Your OpenRouter key
  • BASE_URL - https://api.assemblyai.com/v2
  • SUPABASE_URL - Your Supabase project URL
  • SUPABASE_KEY - Your Supabase key

Deployment

For production deployment (e.g., RunPod):

  1. Push your code to GitHub
  2. Use the provided Dockerfile
  3. Add your environment variables
  4. Deploy!

Tech Stack

FastAPI • TensorFlow • OpenL3 • Librosa • Supabase

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages