{"id":30920332,"url":"https://github.com/bashlui/music-api","last_synced_at":"2025-09-10T01:13:59.892Z","repository":{"id":311284281,"uuid":"1042985253","full_name":"bashlui/music-api","owner":"bashlui","description":"Music API made with FastAPI, deployed on Docker","archived":false,"fork":false,"pushed_at":"2025-08-23T18:45:11.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-24T00:04:14.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bashlui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-22T23:14:39.000Z","updated_at":"2025-08-23T18:45:14.000Z","dependencies_parsed_at":"2025-08-24T00:04:23.459Z","dependency_job_id":"2a777d4f-9358-42a1-aabc-2463fbb00baa","html_url":"https://github.com/bashlui/music-api","commit_stats":null,"previous_names":["bashlui/music-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bashlui/music-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashlui%2Fmusic-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashlui%2Fmusic-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashlui%2Fmusic-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashlui%2Fmusic-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bashlui","download_url":"https://codeload.github.com/bashlui/music-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bashlui%2Fmusic-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274395620,"owners_count":25277383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-10T01:13:55.538Z","updated_at":"2025-09-10T01:13:59.879Z","avatar_url":"https://github.com/bashlui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Music iOS API \n\nMusic API developed with Python's FastAPI framework and deployed on Docker. This API focuses on songs, making the user able to get and post songs that they like.\nThe API is available in https://music-api-service-1cp0.onrender.com, deployed on Render.\n\n## API Reference\n\n### Welcome Message\n\n**GET /**\n\nReturns a welcome message to test if the API is working.\n\n**Response Example**\n```json\n{\n  \"message\": \"Welcome to the Music API, developed by Tono. Feel free to explore the endpoints.\"\n}\n```\n\n---\n\n### Get All Songs\n\n**GET /api/songs**\n\nReturns a list of all songs available in the API.\n\n**Response Example**\n```json\n[\n  {\n    \"id\": 1,\n    \"title\": \"Song Title\",\n    \"artist\": \"Artist Name\",\n    \"album\": \"Album Name\",\n    \"year\": \"2024\",\n    \"genre\": \"Genre\",\n    \"image_url\": \"https://example.com/image.jpg\",\n    \"description\": \"Song description\"\n  }\n]\n```\n\n---\n\n### Get Song by ID\n\n**GET /api/songs/{song_id}**\n\nReturns the song with the specified ID.\n\n**Path Parameters**\n- `song_id` (integer): The ID of the song to retrieve.\n\n**Response Example**\n```json\n{\n  \"id\": 1,\n  \"title\": \"Song Title\",\n  \"artist\": \"Artist Name\",\n  \"album\": \"Album Name\",\n  \"year\": \"2024\",\n  \"genre\": \"Genre\",\n  \"image_url\": \"https://example.com/image.jpg\",\n  \"description\": \"Song description\"\n}\n```\n\n**Error Response (404)**\n```json\n{\n  \"detail\": \"Song not found\"\n}\n```\n\n---\n\n### Create a New Song\n\n**POST /api/song**\n\nCreates a new song and adds it to the list.\n\n**Request Body Example**\n```json\n{\n  \"id\": 2,\n  \"title\": \"New Song\",\n  \"artist\": \"New Artist\", \n  \"album\": \"New Album\",\n  \"year\": \"2025\",\n  \"genre\": \"Pop\",\n  \"image_url\": \"https://example.com/new-image.jpg\",\n  \"description\": \"A new song description\"\n}\n```\n\n**Response Example**\n```json\n{\n  \"id\": 2,\n  \"title\": \"New Song\",\n  \"artist\": \"New Artist\",\n  \"album\": \"New Album\", \n  \"year\": \"2025\",\n  \"genre\": \"Pop\",\n  \"image_url\": \"https://example.com/new-image.jpg\",\n  \"description\": \"A new song description\"\n}\n```\n\n**Error Response (400)**\n```json\n{\n  \"detail\": \"Song with this ID already exists\"\n}\n```\n\n---\n\n### Search Songs\n\n**GET /api/songs/search?q={query}**\n\nSearch for songs by title, artist, album, or genre.\n\n**Query Parameters**\n- `q` (string): Search term, minimum length 1.\n\n**Response Example**\n```json\n[\n  {\n    \"id\": 3,\n    \"title\": \"Love Song\",\n    \"artist\": \"Artist Name\",\n    \"album\": \"Album Name\",\n    \"year\": \"2024\",\n    \"genre\": \"Pop\",\n    \"image_url\": \"https://example.com/image.jpg\",\n    \"description\": \"A love song\"\n  }\n]\n```\n\n---\n\n## Song Model\n\n| Field      | Type   | Description         |\n|------------|--------|--------------------|\n| id         | int    | Song ID            |\n| title      | str    | Song title         |\n| artist     | str    | Artist name        |\n| album      | str    | Album name         |\n| year       | str    | Release year       |\n| genre      | str    | Genre              |\n| image_url  | str    | Image URL          |\n| description| str    | Song description   |\n\n---\n\n## Deployment \u0026 Usage\n\nThis API is deployed using Docker and available as a pre-built image on GitHub Container Registry.\n\n### Running with Docker\n\nPull and run the pre-built Docker image:\n\n```bash\n# Pull the Docker image from GitHub Container Registry\ndocker pull ghcr.io/bashlui/music-api:latest\n\n# Run the container\ndocker run -p 8000:8000 ghcr.io/bashlui/music-api:latest\n```\n\n### Alternative: Local Development\n\nStart the API server locally:\n\n```bash\ncd app\nuvicorn main:app --reload\n```\n\n### Testing the API\n\nYou can test the endpoints using:\n\n1. **Interactive API Documentation**: Access the FastAPI automatic docs at [http://localhost:8000/docs](http://localhost:8000/docs)\n2. **Postman**: Import the endpoints into Postman to test all API functionality\n3. **curl commands**: Make direct HTTP requests from the command line\n\n#### curl Examples\n\n```bash\n# Get welcome message\ncurl http://localhost:8000/\n\n# Get all songs\ncurl http://localhost:8000/api/songs\n\n# Get song by ID (replace {song_id} with actual ID)\ncurl http://localhost:8000/api/songs/1\n\n# Create a new song\ncurl -X POST http://localhost:8000/api/song \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"id\": 1,\n    \"title\": \"Example Song\",\n    \"artist\": \"Example Artist\",\n    \"album\": \"Example Album\",\n    \"year\": \"2024\",\n    \"genre\": \"Pop\",\n    \"image_url\": \"https://example.com/image.jpg\",\n    \"description\": \"An example song for testing\"\n  }'\n\n# Search songs\ncurl \"http://localhost:8000/api/songs/search?q=love\"\n```\n\nThe API will be available at `http://localhost:8000` when running with Docker or locally.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashlui%2Fmusic-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbashlui%2Fmusic-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbashlui%2Fmusic-api/lists"}