{"id":16612795,"url":"https://github.com/samkit-jain/musique-api","last_synced_at":"2025-03-10T19:46:25.816Z","repository":{"id":176661446,"uuid":"98028941","full_name":"samkit-jain/musique-api","owner":"samkit-jain","description":"A simple REST API using flask-resful","archived":false,"fork":false,"pushed_at":"2017-07-22T14:10:23.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T15:39:53.532Z","etag":null,"topics":["flask-restful","python","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samkit-jain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-07-22T12:08:05.000Z","updated_at":"2017-07-22T14:11:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e77c984c-5f2a-4258-a9da-7dc1a0a86e7e","html_url":"https://github.com/samkit-jain/musique-api","commit_stats":null,"previous_names":["samkit-jain/musique-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samkit-jain%2Fmusique-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samkit-jain%2Fmusique-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samkit-jain%2Fmusique-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samkit-jain%2Fmusique-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samkit-jain","download_url":"https://codeload.github.com/samkit-jain/musique-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242917557,"owners_count":20206514,"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","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":["flask-restful","python","rest-api"],"created_at":"2024-10-12T01:43:36.721Z","updated_at":"2025-03-10T19:46:25.781Z","avatar_url":"https://github.com/samkit-jain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# musique-api\n\nA simple REST API using [flask-resful](https://github.com/flask-restful/flask-restful)\n\n# How To Use\n\n1. Open terminal\n1. ```cd path/to/api.py```\n1. ```python3 api.py```\n1. Open another terminal\n1. For POST request: ```curl http://localhost:5000/v1/tracks/23 -d \"id=23\u0026title=title23\u0026rating=9.9\u0026genres=12\u0026genres=3\" -X POST -v```\n1. For GET request: Open http://localhost:5000/v1/tracks in your browser\n\n# Usage\n\nList all genres\nHTTP GET to http://localhost:5000/v1/genres\n```json\n{\n  \"count\": 3,\n  \"results\": [\n    {\n      \"id\": 1,\n      \"name\": \"rock\"\n    },\n    {\n      \"id\": 2,\n      \"name\": \"metal\"\n    },\n    {\n      \"id\": 3,\n      \"name\": \"indie\"\n    }\n  ]\n}\n```\n\nGet single genre record\nHTTP GET to http://localhost:5000/v1/genres/1  #here 1 in genres/1 is the ID of the genre\n```json\n{\n  \"id\": 1,\n  \"name\": \"rock\"\n}\n```\n\nEdit genre record\nHTTP POST to http://localhost:5000/v1/genres/1\n```json\n{\n  \"id\": 1,\n  \"name\": \"pop\"\n}\n```\n\nCreate new genre\nHTTP POST to http://localhost:5000/v1/genres\n```json\n{\n  \"name\": \"edm\"\n}\n```\n\nList all tracks\nHTTP GET to http://localhost:5000/v1/tracks\n```json\n{\n  \"count\": 2,\n  \"results\": [\n    {\n      \"id\": 1,\n      \"title\": \"Numb\",\n      \"rating\": \"9.5\",\n      \"genres\": [\n        {\n          \"id\": 1,\n          \"name\": \"rock\"\n        }\n      ]\n    },\n    {\n      \"id\": 2,\n      \"title\": \"Hey mama\",\n      \"rating\": \"5.9\",\n      \"genres\": [\n        {\n          \"id\": 4,\n          \"name\": \"edm\"\n        },\n        {\n          \"id\": 5,\n          \"name\": \"house\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nSearch track\nHTTP GET to http://localhost:5000/v1/tracks?title=Hey\n```json\n{\n  \"count\": 1,\n  \"results\": [\n    {\n      \"id\": 2,\n      \"title\": \"Hey mama\",\n      \"rating\": \"5.9\",\n      \"genres\": [\n        {\n          \"id\": 4,\n          \"name\": \"edm\"\n        },\n        {\n          \"id\": 5,\n          \"name\": \"house\"\n        }\n      ]\n    }\n  ]\n}\n```\n\nGet single track record\nHTTP GET to http://localhost:5000/v1/tracks/2\n```json\n{\n  \"id\": 2,\n  \"title\": \"Hey mama\",\n  \"rating\": \"5.9\",\n  \"genres\": [\n    {\n      \"id\": 4,\n      \"name\": \"edm\"\n    },\n    {\n      \"id\": 5,\n      \"name\": \"house\"\n    }\n  ]\n}\n```\n\nEdit track\nHTTP POST to http://localhost:5000/v1/tracks/1\n```json\n{\n  \"id\": 1,\n  \"title\": \"new title\",\n  \"rating\": 4.5,\n  \"genres\": [2]\n}\n```\n\nAdd track\nHTTP POST to http://localhost:5000/v1/tracks\n```json\n{\n  \"title\": \"new title\",\n  \"rating\": 9.5,\n  \"genres\": [1, 4]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkit-jain%2Fmusique-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamkit-jain%2Fmusique-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkit-jain%2Fmusique-api/lists"}