{"id":16151497,"url":"https://github.com/0xf4b1/tidal-kt","last_synced_at":"2025-04-06T22:45:48.092Z","repository":{"id":187338918,"uuid":"676735019","full_name":"0xf4b1/tidal-kt","owner":"0xf4b1","description":"Tidal API client library for Kotlin","archived":false,"fork":false,"pushed_at":"2023-12-22T23:27:56.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T05:16:58.891Z","etag":null,"topics":["api","client","kotlin","library","tidal"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xf4b1.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}},"created_at":"2023-08-09T22:20:40.000Z","updated_at":"2024-11-29T10:50:08.000Z","dependencies_parsed_at":"2023-08-09T23:37:53.583Z","dependency_job_id":"9e3ed2c8-4e51-4e6f-a215-56d171616632","html_url":"https://github.com/0xf4b1/tidal-kt","commit_stats":null,"previous_names":["0xf4b1/tidal-kt"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xf4b1%2Ftidal-kt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xf4b1%2Ftidal-kt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xf4b1%2Ftidal-kt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xf4b1%2Ftidal-kt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xf4b1","download_url":"https://codeload.github.com/0xf4b1/tidal-kt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563922,"owners_count":20958971,"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":["api","client","kotlin","library","tidal"],"created_at":"2024-10-10T00:57:11.264Z","updated_at":"2025-04-06T22:45:48.059Z","avatar_url":"https://github.com/0xf4b1.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tidal-kt\nTidal API client library for Kotlin\n\n## Building\n\n`./gradlew jar`\n\n## Usage\n\n### Session\n\n```kotlin\n    val api = TidalApi(TidalApi.Session(\u003cclient_id\u003e, ::callback))\n\n    // Callback to let you save session parameters\n    private fun callback(session: TidalApi.Session) {\n        session.userId\n        session.countryCode\n        session.accessToken\n        session.refreshToken\n    }\n\n    // Start new device auth\n    val verificationUriComplete = api.auth()\n\n    // Let the user visit verificationUriComplete and finish auth and\n    // periodically check if its completed\n    if (api.getAccessToken()) {\n        println(\"Auth complete\")\n    }\n\n    // If you have a stored session, you can restore it without starting new auth\n    api.session.setAuth(\u003cuser_id\u003e, \u003ccountry_code\u003e, \u003caccess_token\u003e, \u003crefresh_token\u003e)\n```\n\n### Tracks\n\n```kotlin\n    private fun printTracks(tracks: List\u003cTrack\u003e) {\n        tracks.forEach { println(\"id: ${it.id}, artist: ${it.artist}, title: ${it.title}, duration: ${it.duration}, artwork: ${it.artwork}, url: ${it.url}, liked: ${it.liked}\") }\n    }\n\n    // Get tracks saved by the user\n    // You can call this function multiple times to get next results by passing false.\n    // If you want to refresh and get results from the beginning, you can reset by passing true.\n    val tracks = api.getTracks(false /* reset? */)\n    printTracks(tracks)\n```\n\n### Artists\n\n```kotlin\n    private fun printArtists(artists: List\u003cArtist\u003e) {\n        artists.forEach { println(\"id: ${it.id}, name: ${it.name}, artwork: ${it.artwork}, url: ${it.url}\") }\n    }\n\n    // Get artists followed by the user\n    val artists = api.getArtists(false /* reset? */)\n    printArtists(first)\n\n    // Get tracks from the an artist id\n    val tracks = api.getArtist(artists[0].id, false /* reset? */)\n    printTracks(tracks)\n```\n\n### Mixes\n\n```kotlin\n    // Get mixes\n    val tracks = api.getMix(Endpoints.Mixes.MIX_DAILY_DISCOVERY, false /* reset? */)\n    printTracks(tracks)\n```\n\n### Search\n\n```kotlin\n    // Search for tracks\n    val tracks = api.query(\"Solee\", false /* reset? */)\n    printTracks(tracks)\n```\n\n### Stream\n\n```kotlin\n    // Get stream url for track id\n    val stream = api.getStreamUrl(tracks[0].id)\n    println(\"stream: $stream\")\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xf4b1%2Ftidal-kt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xf4b1%2Ftidal-kt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xf4b1%2Ftidal-kt/lists"}