# cyberboysumanjay/jiosaavnapi architecture

> Architecture diagram of the GitHub repository cyberboysumanjay/jiosaavnapi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cyberboysumanjay/jiosaavnapi
- Repository: https://github.com/cyberboysumanjay/jiosaavnapi

## Overview

This repository is an unofficial Flask API for searching JioSaavn and retrieving song, album, playlist, and lyrics data. Requests enter through Flask routes, which dispatch to JioSaavn retrieval functions; responses are formatted and returned as JSON. The core formats song and collection metadata, decrypts media URLs, and can optionally fetch lyrics. External service calls and route dispatches are visible in the excerpts; the README documents the universal endpoint’s additional URL-routing behavior.

Main entry points: [`app.py`](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/app.py) (Flask routes), [`jiosaavn.py`](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py) (Song details), [`helper.py`](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/helper.py) (Metadata formatting), [`endpoints.py`](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/endpoints.py) (API URL definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_routes["Flask routes<br/>[app.py]"]
end

subgraph group_retrieval["JioSaavn Retrieval"]
  node_search["Song search<br/>[jiosaavn.py]"]
  node_song["Song details<br/>[jiosaavn.py]"]
  node_collections["Album and playlist<br/>[jiosaavn.py]"]
  node_lyrics["Lyrics retrieval<br/>[jiosaavn.py]"]
  node_apiurls["API URL definitions<br/>[endpoints.py]"]
end

subgraph group_formatting["Response Formatting"]
  node_formatter["Metadata formatting<br/>[helper.py]"]
  node_media["Media URL decryption<br/>[helper.py]"]
end

node_client(("API caller"))
node_saavn["JioSaavn"]
node_response["JSON response"]

node_client -->|"sends request"| node_routes
node_routes -->|"dispatches search"| node_search
node_routes -->|"requests song"| node_song
node_routes -->|"requests collection"| node_collections
node_routes -->|"requests lyrics"| node_lyrics
node_search -->|"fetches details"| node_song
node_song -->|"formats metadata"| node_formatter
node_collections -->|"formats contents"| node_formatter
node_formatter -->|"decrypts media URL"| node_media
node_formatter -->|"optionally fetches"| node_lyrics
node_search -->|"uses search URL"| node_apiurls
node_song -->|"uses detail URL"| node_apiurls
node_collections -->|"uses collection URLs"| node_apiurls
node_lyrics -->|"uses lyrics URL"| node_apiurls
node_search -->|"requests data"| node_saavn
node_song -->|"requests details"| node_saavn
node_collections -->|"requests contents"| node_saavn
node_lyrics -->|"requests lyrics"| node_saavn
node_routes -->|"returns JSON"| node_response

click node_routes "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/app.py"
click node_search "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py"
click node_song "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py"
click node_collections "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py"
click node_lyrics "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py"
click node_apiurls "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/endpoints.py"
click node_formatter "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/helper.py"
click node_media "https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/helper.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes toneBlue
class node_search,node_song,node_collections,node_lyrics,node_apiurls toneAmber
class node_formatter,node_media,node_client toneMint
class node_saavn,node_response toneIndigo
```

## Components

### HTTP API

- [Flask routes](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/app.py): `app.py`

### JioSaavn Retrieval

- [Song search](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py): `jiosaavn.py`
- [Song details](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py): `jiosaavn.py`
- [Album and playlist](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py): `jiosaavn.py`
- [Lyrics retrieval](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/jiosaavn.py): `jiosaavn.py`
- [API URL definitions](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/endpoints.py): `endpoints.py`

### Response Formatting

- [Metadata formatting](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/helper.py): `helper.py`
- [Media URL decryption](https://github.com/cyberboysumanjay/jiosaavnapi/blob/master/helper.py): `helper.py`

### Other components

- **API caller**
- **JioSaavn**
- **JSON response**

## Connections

- API caller → Flask routes: sends request (evidence: `README.md`)
- Flask routes → Song search: dispatches search (evidence: `app.py`)
- Flask routes → Song details: requests song (evidence: `app.py`)
- Flask routes → Album and playlist: requests collection (evidence: `app.py`)
- Flask routes → Lyrics retrieval: requests lyrics (evidence: `app.py`)
- Song search → Song details: fetches details (evidence: `jiosaavn.py`)
- Song details → Metadata formatting: formats metadata (evidence: `jiosaavn.py`)
- Album and playlist → Metadata formatting: formats contents (evidence: `jiosaavn.py`)
- Metadata formatting → Media URL decryption: decrypts media URL (evidence: `helper.py`)
- Metadata formatting → Lyrics retrieval: optionally fetches (evidence: `helper.py`)
- Song search → API URL definitions: uses search URL (evidence: `jiosaavn.py`)
- Song details → API URL definitions: uses detail URL (evidence: `jiosaavn.py`)
- Album and playlist → API URL definitions: uses collection URLs (evidence: `jiosaavn.py`)
- Lyrics retrieval → API URL definitions: uses lyrics URL (evidence: `jiosaavn.py`)
- Song search → JioSaavn: requests data (evidence: `jiosaavn.py`)
- Song details → JioSaavn: requests details (evidence: `jiosaavn.py`)
- Album and playlist → JioSaavn: requests contents (evidence: `jiosaavn.py`)
- Lyrics retrieval → JioSaavn: requests lyrics (evidence: `jiosaavn.py`)
- Flask routes → JSON response: returns JSON (evidence: `app.py`)
